Simple gui

I've been programming in c++ a while now, and in the program I'm writing I want to use some simple gui. I am wondering if it is possible to make a dialog box without starting a new Win32 project? I found some code online, but I can't make it work..
#include <windows.h>
int main()

return ::MessageBox(NULL, "Says hello", "Console", MB_ICONINFORMATION);

Will be super-happy if someone can help me=)
Thank you! I found what you had posted previously on the c++ forum really helpfull!

I used your cbox code and just changed it a little bit to fit my program, but I had a problem when I used sprintf() on a function that returned an int value. It didn't return what I expected it to.. Does it have anything to do with the "%3.2f"?
I googled some and figured it out=) Put an "%i" instead of "%3.2f" if anyone's interested.
Yep. The printf family of C Runtime functions take quite a variety of format specifiers to tell the function what sort of variable is to be formatted in terms of field size, decimal points or lack thereof, etc.
what's the difference between true /*and/* false */ and TRUE /*and*/ FALSE? is the value returned is 32 bit while the other is just 16 bit?
@chipp: Do not hijack other people's threads. If you have a question of your own, post your own thread, especially when the question seems unrelated. To quickly answer you: TRUE and FALSE are defined in the Windows SDK because the Windows SDK is C, not C++, and C did not have a boolean data type, much less boolean values true and false. Therefore, the Windows SDK provide a BOOL type and the respective boolean values TRUE and FALSE.
ok, one more question.

i don't understand. isn't it C does have boolean data type which have boolean values of true or false? what do you mean by: C doesn't have boolean data type?
I mean exactly that: The C language doesn't have a boolean data type. C++ does.
Topic archived. No new replies allowed.