Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


c++ win32 some newb errors HELP!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Assassinbeast   Members   -  Reputation: 271

Like
0Likes
Like

Posted 09 October 2012 - 07:29 AM

Hello everyone.

I just bought Jonathan S. Harbours book called Beginning Game Programming Third Edition.
And already in the beginning... i get two errors that says identifier not found.

[source lang="cpp"]#include <Windows.h>int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ MSG msg; MyRegisterClass(hInstance); if(!InitInstance (hInstance, nCmdShow)) return FALSE; while(GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam;}[/source]

Its the "MyRegisterClass" and "InitInstance" i get the red line below the text, and it says identifier not found.
Im using vc++ express 2010 and im sure i made everything correct according to the book so far.Posted Image

Someone help me with this thanks Posted Image

Sponsor:

#2 JiiPee   Members   -  Reputation: 135

Like
0Likes
Like

Posted 09 October 2012 - 07:54 AM

Have you included Windows.h header file?
See my game dev blog: http://gamedev4hobby.blogspot.fi/

#3 PyroDragn   Members   -  Reputation: 404

Like
0Likes
Like

Posted 09 October 2012 - 08:00 AM

You're not including anything in your #include line at the top. Presumably you're missing the appropriate include file for MyRegisterClass and InitInstance.

#4 Assassinbeast   Members   -  Reputation: 271

Like
0Likes
Like

Posted 09 October 2012 - 08:20 AM

no no... i have included it.
But i figured out what the problem was.... it was because that the program was not finished yet, so i thought i could debug and run it, but he continued the program after 1 chapter...

#5 Pointer2APointer   Members   -  Reputation: 283

Like
0Likes
Like

Posted 09 October 2012 - 03:05 PM

You can't invoke a function from a function if it isn't defined yet before scope enters that particular function call(in C++, for this predicament).

MyRegisterClass() has to be defined above for it to work. Same with the other function.

"Identifier not found" is the compiler's way of saying "This function call doesn't exist from this scope yet."
Yes, this is red text.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS