problem with MessageBox
-
Hola! I´m making a small Windows Forms App. using VC++.net 2003. Adding a "MessageBox" in the self generated code (the Form1.h - file) works fine, until I add my own header file to the project and include this new header file at the top of the "Form1.h" -file. I get the error message:
error C2653:"MessageBoxA" is not a class or a namespace name.
Why this "MessageBoxA"? What could be wrong? thanks doneirik -
Hola! I´m making a small Windows Forms App. using VC++.net 2003. Adding a "MessageBox" in the self generated code (the Form1.h - file) works fine, until I add my own header file to the project and include this new header file at the top of the "Form1.h" -file. I get the error message:
error C2653:"MessageBoxA" is not a class or a namespace name.
Why this "MessageBoxA"? What could be wrong? thanks doneirikdoneirik wrote: Adding a "MessageBox" in the self generated code... Are you adding your own
MessageBox()
function, or are you callingMessageBox()
? If the latter, why do this in a .H file?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
doneirik wrote: Adding a "MessageBox" in the self generated code... Are you adding your own
MessageBox()
function, or are you callingMessageBox()
? If the latter, why do this in a .H file?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
I´m callin MessageBox : MessageBox::Show("string"); I´m doing it in the self generated code simply because double-clicking e.g. an Button in the design mode, the method that handles this is placed in the Form1.h file automatically. Don´t really need to have it there. Just trying to learn the basics now... doneirik
-
Hola! I´m making a small Windows Forms App. using VC++.net 2003. Adding a "MessageBox" in the self generated code (the Form1.h - file) works fine, until I add my own header file to the project and include this new header file at the top of the "Form1.h" -file. I get the error message:
error C2653:"MessageBoxA" is not a class or a namespace name.
Why this "MessageBoxA"? What could be wrong? thanks doneirikMessageBoxA is the ANSI version of MessageBox (MessageBox is actually a macro that expands to MessageBoxA in ANSI builds and MessageBoxW in UNICODE builds). Apparently the compiler can't see the definition of MessageBoxA at the point of error. Perhaps you didn't include the correct header files in the correct order, or you may have unmatched #ifdef/#endif statements. Since it happens when you include your own header file I'd look in that for unmatched statements. Disclaimer: I have never worked in VC++.net 2003, but the above applies to VC++ 6.0. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"