Another Windows problem

Started by
15 comments, last by Oluseyi 18 years, 7 months ago
Here is my source code #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE PrevInstance, 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; } Here is my error log Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make clean rm -f Untitled1.o Project1.exe g++.exe -c Untitled1.cpp -o Untitled1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" Untitled1.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)': Untitled1.cpp:6: error: `MyRegisterClass' undeclared (first use this function) Untitled1.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.) Untitled1.cpp:7: error: `InitInstance' undeclared (first use this function) make.exe: *** [Untitled1.o] Error 1 Execution terminated Whats wrong with it?
Advertisement
"Untitled1.cpp:6: error: `MyRegisterClass' undeclared (first use this function)"
Tell me. What do YOU think this error means? What does "undeclared" mean?
According to MSDN, the functions are:
myregisterclassinitinstance


Source.
hippopotomonstrosesquippedaliophobia- the fear of big words
Quote:Original post by Gunslinger RR
According to MSDN, the functions are:
myregisterclassinitinstance


Source.


No, those are keywords, not function names. They are all lowercase because keyword lookups on MSDN are not case sensitive, so it doesn't matter.

Sneftel's response should have him on the right track.
Quote:Original post by Dave Hunt
Quote:Original post by Gunslinger RR
According to MSDN, the functions are:
myregisterclassinitinstance


Source.


No, those are keywords, not function names. They are all lowercase because keyword lookups on MSDN are not case sensitive, so it doesn't matter.

Sneftel's response should have him on the right track.


Bleh that's what I get for trying to be helpful [grin]

In that case ignore my post and look at Sneftel's.
hippopotomonstrosesquippedaliophobia- the fear of big words
Well to tell you the truth I have no idea maybe capatilazation?I'am really knew to windows programming.
"undeclared" says nothing about capital letters. Look it up in the dictionary if you have to. Better yet, look it up in your book on C++. What does it mean to "declare" a function? Have you "declared" what your compiler has told you is "undeclared"?

Error messages aren't hieroglyphics. Modern compilers go far, far out of their way to give you error messages which are concise and helpful. They're written in English. Read them.
are you saying I need to declare it like void registermyclass(HINSTANCE)
and then
{
....what it does...
}
I'am so confusing why can't you just tell me?
Quote:Original post by thugkilla
are you saying I need to declare it like void registermyclass(HINSTANCE)
and then
{
....what it does...
}

Pretty much. However, keep in mind that case sensitivity DOES matter.
But This function is a function included in the windows header.

This topic is closed to new replies.

Advertisement