Help me!!!!
I'm learning to program using Blocks but the book I'm learning from tells me to put:
//register the class
MyRegisterClass(hInstance);
and when I try to build it tells me that It is undeclared and that I need to use some function
Help!!!!
Hey, ya know, start 9 or 10 user accounts and ask the same question. And when you get an answer, ask again anyway under a different name.
That's ridiculous, dude.
That's ridiculous, dude.
MyRegisterClass() is not a function of the WinAPI. You have to write it. If you wrote it and you code looks like this one:
Then you broke one of the basic rule of C++ which is: I can't use something that hasn't been declared yet. Put the declaration of MyRegisterClass() at the top of your file and it should run:
HTH
func1(){ // here, I use MyRegisterClass() if (!MyRegisterClass(hinstance)) { // error: MyRegisterClass is undeclared ... }}bool MyRegisterClass(HINSTANCE hinstance) // MyRegisterClass definition{}
Then you broke one of the basic rule of C++ which is: I can't use something that hasn't been declared yet. Put the declaration of MyRegisterClass() at the top of your file and it should run:
bool MyRegisterClass(HINSTANCE hinstance); // MyRegisterClass declarationfunc1(){ // here, I use MyRegisterClass() if (!MyRegisterClass(hinstance)) { // MyRegisterClass is declared ... }}bool MyRegisterClass(HINSTANCE hinstance) // MyRegisterClass definition{}
HTH
If so, then he already asked. Why ask again?
The anonymous poster in Chip Holder's thread is me. Another poster and I answered your question there.
[addendum] And thank you, Emmanuel, for explaining it in code for them. Apologies that I didn't do it, myself.
The anonymous poster in Chip Holder's thread is me. Another poster and I answered your question there.
[addendum] And thank you, Emmanuel, for explaining it in code for them. Apologies that I didn't do it, myself.
Chip holder put the code you said on the top, and it said
ISO C++ forbids declaration of 'func1' with no type
what does that mean??
ISO C++ forbids declaration of 'func1' with no type
what does that mean??
I put in MyRegisterClass in the parantheses at the top and it says:
expected constructor, destructor, or type conversion before '(' token
can you explain please?
expected constructor, destructor, or type conversion before '(' token
can you explain please?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement