PDA

View Full Version : NeHe base code error



Running_Wolf
02-03-2001, 11:10 AM
When I try to compile the NeHe base code for window creation I get the following error:

The line of code:
wc.lpfnWndProc = (WNDPROC) WndProc;

The error:
'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

Could someone please help?

Elixer
02-03-2001, 06:38 PM
You sure that is the line with the error?

That looks OK.
What compiler you using?

Running_Wolf
02-04-2001, 04:41 PM
I am using VC++ 6.0 with SP2. It used to work. I didn't change anything really essential. I just added some drawing stuff to the DrawGLScene() function and it quit working.

Running_Wolf
02-05-2001, 05:50 AM
Does anybody know what my problem is?

BwB
02-05-2001, 08:26 AM
Well, from the looks of your error message WNDPROC is undefined. Have you tried doing Build->Clean and then remaking everything? The only reason why I can think that WNDPROC would be undefined would be if Windows.h wasnt included (unlikely or you'd get alot more errors) or if you using precompiled headers and things got wacky.
Assuming that remaking everything doesnt work, what happens if you remove all the code you added? (just '#if 0' it out). If that solves the compilation problem and you cant find anything wrong with your code, post the changes.

Deiussum
02-05-2001, 12:21 PM
This may be too obvious to be the problem, but did you name your WindowProc function WndProc?

Running_Wolf
02-05-2001, 04:55 PM
Yes, I named my function WndProc just like NeHe had it in Tutorial #1.