Original Post
I am looking for a way to make a function pointer to a non static class member. The reason is that I am making a Win32 wrapper, which takes function pointers for the called events.
Inside the WndProc I search if the event has a function pointer associated, and if so, I'll call the function.
The eventhandler looks like
-Earth is 98% full. Please delete anybody you can. [edited by - toolmaker on November 24, 2003 6:29:53 AM]
typedef long (* MessageHandler) (wgBaseWindow *, HWND hWnd, WPARAM wParam, LPARAM lParam);and to handle the events in code, I want to have something like this:
class CApp
{
public:
long OnCreate(wgBaseWindow *Wnd, HWND hwnd, WPARAM wParam, LPARAM lParam);
long onPaint(wgBaseWindow *Wnd, HWND hwnd, WPARAM wParam, LPARAM lParam);
};
// Inside application
CApp App;
Wnd->RegisterEvent(WM_CREATE, App::OnCreate);
Wnd->RegisterEvent(WM_PAINT, App::OnPaint);
Is this possible? I heard it should be possible with boost::bind, but I don't understand shit of it. Anyone?
Toolmaker
-Earth is 98% full. Please delete anybody you can. [edited by - toolmaker on November 24, 2003 6:29:53 AM]