View Single Post
  #11   Spotlight this post!  
Unread 20-12-2007, 22:06
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Creating Windows GUIs with C++

Thank you. It now compiles. And it works perfectly on my machine. However it still generates an error whenever I show it to somebody else:

Quote:
this application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
My code:
Code:
#include <Windows.h>
#include <tchar.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
				   LPSTR lpCmdLine, int nShowCmd)
{
	MessageBox(NULL, _T("Hello!"), 
		_T("Hello World"), MB_OK | MB_ICONINFORMATION);
	if (MessageBox(NULL, _T("I'm learning to use C++ to write native Windows programs.  Cool, isn't it?"),
		_T("Cool, No?"), MB_YESNO | MB_ICONQUESTION) == IDYES)
		MessageBox(NULL, _T("You know it!"), _T("Sweet!"), MB_OK);
	else MessageBox(NULL, _T("Jerk."), _T("Grrr"), MB_OK);
	return 0;
}
__________________