As a sort of introductory app to windows applications in C++, I've written a short program that displays a few messageboxes, and plays around with the buttons in them (OK, OKCANCEL, etc).
It works beautifully in Windows 2000. However, it silently fails (i.e. no error messages) in XP and I'm not sure why that is. I use both OSes, so I want to be able to run the app in both of them.
Here's the important part of the code: (I've removed a few things from the code, but trust me I didn't omit anything pertinent)
Is there something in that code that's win2k specific? Is it to do with the OS it was compiled on? Ideally I'd like some code that runs the same on both OSes, but if I have to, I'll settle with compiling a seperate version for each.
//sorry for the immature variable/window naming :P
int lol = MessageBox (NULL, "This is a message box",
if (lol == 2) //if user clicked cancel
MessageBox (NULL, "Why did you select cancel?",
"ERROR", 0 + 48);
Any help is appreciated!