I have a win32 wrapper class with a functioning WndProc (i use a static wndproc to forward messages to the WndProc member function).
I also have another app class which creates an instance of my win32 wrapper class.
I want the user of the app class to be able to write their own functions that represent events, such as OnMouseClick(), or OnMouseMove(), but in order for this to work, I need to call the event functions from the win32 wrapper class’s Wndproc (which has no knowledge of the app class).
What’s the best way to do this? Should I send a pointer to each event function to my win32 wrapper class, and call it via pointer? Or is there a better way?
The structure of your classes and their purpose is not clear. Nevertheless, the typical recommnded structure of wrapper classes is the following:
Base class is calling virtual methods when it receives Windows events in its static WndProc handler. And this triggers execution of the app code.