Help a newb

Started by
6 comments, last by Lash 21 years, 8 months ago
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
Advertisement
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-
My compiler generates one error message: "does not compile."
and for more information, i''m going to send you here.

---
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...
i think you need to cast it
check the help files (soz )
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
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
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
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]

This topic is closed to new replies.

Advertisement