Datastream from .dll file in C++

Hi there

I have made a small GUI interface for other people at my lab used for training rats and to acknowledge that everything is working in the system. The rats are supposed to move a joystick while collecting information from both the joystick and an incoming information from intra cortical electrodes implanted in the rats.

My problem is the communication with the joystick. I have made a program that can read the position of the joystick and have compiled it as a .dll. The mainprogram then calls this .dll in a thread but how in the world can I get a streaming data from this .dll? Right now I am outputting the joystick position to the console using cout, but how do I read this using my main program? Also - there surely must be some much better way of communicating with my joystick?

I am rather a beginner in C++, so please have that in mind when explaining me what I'm not getting here ;). Anyway, here is the line of code I use for implementing my .dll:

typedef void (*EntryPointfuncPtr)();

//Declare an HINSTANCE and load the library dynamically. Dont forget

//to specify a correct path to the location of LoadMe.dll


HINSTANCE LoadMe;
LoadMe = LoadLibrary(L"hapidll2.dll");

EntryPointfuncPtr LibMainEntryPoint;

LibMainEntryPoint = (EntryPointfuncPtr)GetProcAddress(LoadMe,"hapitest");

LibMainEntryPoint();

Thank you very much

Michael
You need something to poll your function and translate that to some kind of stream or event.

I'd write a wrapper DLL that, when started, starts a thread that polls the device and makes the data available.
Thanks for answering.

My question is, how does I make the data available from the .dll? I can't use return argument, as I can't get live feed using that - so how do I make the data come flowing in/streaming in from my .dll?

If you can just point me in the right direction.

Thanks
Michael
I've only now seen your reply. Is this still a problem?
Topic archived. No new replies allowed.