Archived

This topic is now archived and is closed to further replies.

hajkr

Pointer to Member-function...

Recommended Posts

hello, I want to have a function-pointer to a funtion that is defined in a class: class a { private: LRESULT CALLBACK InternalMainWndProc( HWND hWnd, unsigned uMsg, WPARAM wParam, LPARAM lParam ); }; I can''t compile it when i want to set set to function pointer, the copmpiler says he can''t convert the types, but i don''t want to use a static funtion, because and the instances of the class would all have the same statuic function, right? Does see anyone another way do solve this ?

Share this post


Link to post
Share on other sites
Previous threads on this topic:
Message handler can be wrapped?
Windows
C++ & Win32
Static Member Functions?
Event Handlers and Classes. Wrappers and stuff.
Having my Event Handler inside an object?
How do I turn my message procedure into a member function of a class?
Windows in a class
Class member as window callback function???
WindowProc in a class
Window handler in a class

And many more...

As you can see, this topic has been covered a ton of times. GameDev has a search tool exactly for this reason; it''s located in the upper-right corner just under the "GDSE" link, in between "faq" and "login." I got the above results by using the terms "window handler class."

Reference:
Pointers to member functions, C++ FAQ Lite

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites