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
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?