Help a newb
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
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-
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-
and for more information, i''m going to send you here.
---
Come to #directxdev IRC channel on AfterNET
---
Come to #directxdev IRC channel on AfterNET
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...
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...
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.
wndclass.lpfnWndProc = (WNDPROC)WndProc;
This is a typical casting problem. Are you sure you cast it correctly? (As above)
Crispy
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement