#include <Windows.h>
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show)
{
//...
return 0; // <- returning 0 indicates success, just like with the normal main().
// return TRUE is the same as return 1, which indicates failure.
}
I'm using Microsoft Visual Studios 2010 Ultimate, the same as you. Just wondering did you crack your version? Because that might be why it not working but it should be fine.
Hey all again it does not work i did not crack it i have the Open gl lib and everything which came with it.again you're code or naraku or Disch code did not work at all.
I feel I must interject with a technical correction.
MessageBox(NULL, L"Text", L"Caption", MB_OK);
This is wrong. MessageBox takes TCHAR strings, you are giving it WCHAR strings.
1 2 3
MessageBoxA(NULL, "Text", "Caption", MB_OK); // <- Correct. ANSI ver of the function with char strings
MessageBoxW(NULL, L"Text", L"Caption", MB_OK); // <- Correct. Wide ver of the function with wide strings
MessageBox(NULL, TEXT("Text"), TEXT("Caption"), MB_OK); // <- Correct. TCHAR ver of the function with TCHAR strings
Whether or not passing wide strings to a TCHAR version of the function will work depends on whether or not UNICODE is defined (depends on your compiler settings or whether you are manually #defining it).
Best practice: pick one and run with it. Don't mix and match.
I personally try to use the 'W' version of all WinAPI functions whenever practical.