-
a little confused
I'm reading a tutorial on Win32 app programming and its done in C which I don't know (I don't really know any C++) but I figured I'd give it a shot (I do know some java). I'm using Visual C++ in visual studio so I made an empty project file and put in this code:
Code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}
I compiled it and got errors but then I realized that it was a .cpp file and just renamed it to a .c file. It then compiled and ran but the message that popped up was in like japanese or something. It was characters.
-
Use the TEXT() around any text - this means that your code will work both when it's unicode and when it's not. e.g.
Code:
MessageBox(NULL, TEXT("Goodbye, cruel world!"), TEXT("Note"), MB_OK);
--
Mats
-
-
I have a question about icons, in my test.c file I have these lines:
Code:
wc.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MYICON));
wc.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MYICON), IMAGE_ICON, 16, 16, 0);
And in my testr.rc file I have:
Code:
IDI_MYICON ICON "menu_one.ico"
And finally in my resource.h file I have:
Code:
#define IDI_MYICON 201
I put the icon "menu_one.ico" in the same folder as all three of those files.
-
And the question is?
--
Mats
-
o haha sry, why doesn't it work?
-
Describe what doesn't work, please!
Are you checking the return values from LoadIcon and LoadImage? Are they valid, if not, what is the error code?
--
Mats