main.cpp

来自「一个非常有用的开源代码」· C++ 代码 · 共 58 行

CPP
58
字号
// ********************************************************
// This is demo code. You may derive from, use, modify, and
// distribute it without limitation for any purpose.
// Obviously you don't get a warranty or an assurance of
// fitness for a particular purpose with this code. Your
// welcome to remove this header and claim original
// authorship. I really don't care.
// ********************************************************

#include "MainMenu.h"
#include "Gui.h"
#include <time.h>
#include "../GClasses/GApp.h"


void ShowWafflesMainMenu()
{
	MainMenuController c;
	c.RunModal();
}


int main(int argc, char *argv[])
{
	// Seed the random number generator
	time_t t;
	srand((unsigned int)time(&t));

	// Exceptions are better than signals
	GApp::TurnSegFaultsIntoExceptions();

	// Find the app path
	ControllerBase::SetAppPath(GApp::GetApplicationPath(argv[0]));

	// Show the main menu
	try
	{
		ShowWafflesMainMenu();
	}
	catch(const char* szError)
	{
		printf("%s\n", szError);
	}
	catch(const wchar_t* wszError)
	{
#ifdef WIN32
		wprintf(L"%ls\n", wszError);
#else
		ConvertUnicodeToAnsi(wszError, szError);
		printf("%s\n", szError);
#endif
	}

	return 0;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?