Jump to content
  • Advertisement


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

Dark Rain

Having my Event Handler inside an object?

This topic is 6127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!