Archived

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

Dark Rain

Having my Event Handler inside an object?

Recommended Posts

Dark Rain    157
I''m trying to have my Event Handler for my window inside a class with all the other Win32 specific stuff that handle windows. Mostly to make porting easier. Now I''m kinda new to Windows programming and I get what I guess must be a beginner problem. When I try to enter the function name in "wc.lpfnWndProc", I get a type cast error : error C2440: ''type cast'' : cannot convert from '''' to ''long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'' None of the functions with this name in scope match the target type I''m guessing it''s because I never tried to pass a function that was inside an object as an argument. I must be doing it wrong : wc.lpfnWndProc = (WNDPROC)WndProc; I also tried : wc.lpfnWndProc = (WNDPROC) WindowImpWIN32::WndProc; I also tried to type cast it to "long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)", but no dice.

Share this post


Link to post
Share on other sites
Oluseyi    2116
I usually post links to previous threads addressing the same problem, but this time I''ll have to ask you to look for yourself. Using the "search" link in the upper right corner (below "GDSE" and to the left of "login"), locate any of the three recent threads that covered this in entirety - or any prior to that. You''ll find full discussion and source code too!

I usually use terms like "window procedure object class" and then sift through the returned links.

[ 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