Archived

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

Help a newb

This topic is 5624 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

Ok I get an error on this line of code, but i dont get what the problem is: wndclass.lpfnWndProc = WndProc; ------------------------------------------------------ error C2440: ''='' : cannot convert from ''long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'' to ''unsigned int'' This conversion requires a reinterpret_cast, a C-style cast or function-style cast ==================================== I''m pretty sure I didn''t change anything related to that sence the last time it worked. Also if I try to cast it to an unsigned int like it says it should be, the error messege reverses

Share this post


Link to post
Share on other sites
Make sure WndProc is defined like this:

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

And it''s a global function, not a member of a class.


My compiler generates one error message: "Doesn''t compile."
-Albert Tedja-

Share this post


Link to post
Share on other sites
Yes its defined as:
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

And its global.
Could it just be that the compiler is messed up? Theres a few odd buggs in the vb 6 compiler, maby vc++ is a little buggy too...

Share this post


Link to post
Share on other sites
Yeah I tried to cast it to the type it said it should be, and it didn''t work, maby it told me the wrong type... anyway that shouldn''t be the problem because i never had to cast it before and it worked fine.

Share this post


Link to post
Share on other sites

  
wndclass.lpfnWndProc = (WNDPROC)WndProc;


This is a typical casting problem. Are you sure you cast it correctly? (As above)

Crispy

Share this post


Link to post
Share on other sites
muahahahhaahah!!! Found the problem... i forgot to uncomment some crap, seems to have messed this up. Thanks for helping anyway.

[edited by - Lash on July 26, 2002 8:06:31 PM]

Share this post


Link to post
Share on other sites