Exemple #1
0
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR lpCmdLine, int nCmdShow)
{
	try
	{
		base::com::guard com;

		base::i18n::initialize(base::path::ydwe(true) / "share" / "locale");
		base::i18n::set_domain(L"config");

		DuiLib::CPaintManagerUI::SetInstance(hInstance);
		DuiLib::CPaintManagerUI::SetLanguage(base::i18n::get_language());
		
		CMainWindow* pFrame = new CMainWindow();
		pFrame->Create(NULL, L"YDWEÅäÖóÌÐò", UI_WNDSTYLE_DIALOG, 0);
		pFrame->CenterWindow();
		pFrame->ShowWindow(true);
		DuiLib::CPaintManagerUI::MessageLoop();
	}
	catch (std::exception const& e)
	{
		::MessageBoxW(NULL, bee::u2w(e.what()).c_str(), L"ERROR", MB_ICONERROR | MB_OK);
	}
	catch (...)
	{
		MessageBoxW(NULL, L"Unknown error", L"ERROR", MB_OK | MB_ICONERROR);
	}

    return 0;
}
Exemple #2
0
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR lpCmdLine, int nCmdShow)
{
	base::warcraft3::command_line cmd;
	
	if (cmd.has(L"launchwar3"))
	{
		bool launch_warcraft3(base::warcraft3::command_line&);
		launch_warcraft3(cmd);
		return 1;
	}

	try
	{
		base::com::guard com;

		DuiLib::CPaintManagerUI::SetInstance(hInstance);

		CMainWindow* pFrame = new CMainWindow();
		pFrame->Create(NULL, L"YDWEÅäÖóÌÐò", UI_WNDSTYLE_DIALOG, 0);
		pFrame->CenterWindow();
		pFrame->ShowWindow(true);
		DuiLib::CPaintManagerUI::MessageLoop();
	}
	catch (std::exception const& e)
	{
		::MessageBoxW(NULL, base::u2w(e.what(), base::conv_method::replace | '?').c_str(), L"ERROR", MB_ICONERROR | MB_OK);
	}
	catch (...)
	{
		::MessageBoxA(NULL, boost::current_exception_diagnostic_information().c_str(), "ERROR", MB_ICONERROR | MB_OK);
	}

    return 0;
}