Hello, I'm coming here for help about custom events. My application works with DirectInput API (it's not a game just to mention) and I have written my own "wrapper" around it. Let me explain my project structure:
cApp -> the very main class that inherits from wxApp
mainFrame -> class that inherits from wxFrame with my main (and only) window, here is the whole GUI, Binded events for buttons, etc.
so far everything is fine, now I need to add this functionality:
dIHandler -> class for my very own DirectInput API wrapper that don't inherit from any wx class
Basically dIHandler constantly reads device (joystick, etc.) data and I need to update GUI elements in mainFrame (some sliders, text inputs) accordingly. I need few events, for when the device gets connected to the PC (diEVT_DI_DEVICE_CONNECTED), when it gets disconnected (diEVT_DI_DEVICE_DISCONNECTED), gets polled (diEVT_DI_DEVICE_POLLED) and some other events. I also need to send some data through the event (poll event).
So what is my problem you are asking? I tried to implement this, but I'm having issues. I created class dIEvent, that inherits from wxEvent, included it in dIHandler.h and proceeded as explained
here.
The error I'm getting is this:
error C2664: 'wxEvtHandler *wxPrivate::HandlerImpl<Class,EventArg,true>::ConvertToEvtHandler(T *)': cannot convert argument 1 from 'EventHandler *const ' to 'T *'
Also can you direct me the right way with multithreading? As I need to constantly read DirectInput data and at the same time constantly updating the GUI. Thank you!