示例#1
0
//-----------------------------------------------------------------------------
// Name: wWinMain()
// Desc: The application's entry point
//-----------------------------------------------------------------------------
INT WINAPI wWinMain( HINSTANCE hInst, HINSTANCE, LPWSTR, INT )
{
	#if defined(DEBUG) | defined(_DEBUG)
	_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
	//_CrtSetBreakAlloc(234);
#endif

	//_wsetlocale(LC_ALL, _T("korean") );

	UNREFERENCED_PARAMETER( hInst );

	CApp* pApp = new CApp();

	if(FAILED(pApp->Initialize(
		hInst, _T("ExpressWork"), _T("qiomoip"), SCREEN_WIDTH, SCREEN_HEIGHT)))
	{
		Safe_Delete(pApp);
		return 0;
	}

	pApp->Run();

	Safe_Delete(pApp);

	#ifdef _DEBUG
	_CrtDumpMemoryLeaks();
#endif
	return 0;
}
int main(int argc, char* *argv)
{
    bool bResume;
    int iWorldID;
    int iInstanceID;

    CAppUtility::AppLaunch(argc, argv, CRegAuthApp::SetAppCmd, bResume, iWorldID, iInstanceID);

    CSharedMemory stShmMain;
    CApp* pApp = CShmObjectCreator<CRegAuthApp>::CreateObjectByKey(&stShmMain, GenerateServerShmKey(GAME_SERVER_REGAUTH,0));
    if (!pApp)
    {
        exit(3);
    }

    int iRet = pApp->Initialize(bResume, iWorldID);
    if (iRet != 0)
    {
        exit(4);
    }

    pApp->Run();

    return 0;
}
示例#3
0
int main(int argv, char** argc)
{
	CApp myGame;

	if (!myGame.OnInit()) return -1;
	return myGame.Run();
}
示例#4
0
void main()
{
	CApp app;

	app.Init();
	app.Run();
	app.Exit();
}
示例#5
0
int main(int argc, char *argv[])
{
    gApp.RelayoutArgs(argc, argv);
    gApp.Initialize(argc, argv) && gApp.Startup() && gApp.Run();
    gApp.Shutdown();

    return 0;
}
示例#6
0
文件: main.cpp 项目: purebe/RTTDS
int main(int argc, char **argv)
{
	// We can print errors to the console window
	// FreeConsole();

	CApp app;

	app.Startup();

	app.Run();

	app.Shutdown();

	;

	return 0;
}
示例#7
0
/*============================================================================*/
	int APIENTRY 
WinMain(HINSTANCE, HINSTANCE, LPSTR, int)				/*

	Application entry point. None of the entry parameters are used and
	are therefore omitted above.
*-----------------------------------------------------------------------------*/
{
	  // semaphore name, instances, and  handle: make sure the name is 
	  // unique to this application
	static const CString szSemaphoreName = _T("Unique name: TimeDemo");
	   // number of allowed instances: here, 1 avoids archive file clashes
	static const int nInstances = 1;
	  // set default return value
	int rtn = -1; 
	  // Create and  check the semaphore that limits the number of
	  // simultaneously executing instances of this application
	  // to m_nInstances.
	static	HANDLE 	m_hSemaphore;
        if ((m_hSemaphore = CreateSemaphore(NULL, nInstances, nInstances,
	    szSemaphoreName)) != NULL)
	{
	        if (WaitForSingleObject(m_hSemaphore, 0) == WAIT_TIMEOUT)
	        {
			::MessageBox(NULL,
			    _T("The allowed number of instances of this\n")
			    _T("application are already running."),
			    _T("Stop"), MB_OK | MB_ICONSTOP | MB_TASKMODAL);
		        return 0;
		}
		try
		{
			CApp thisApp;

			  // Run the application
			rtn = thisApp.Run();
		}
		
		catch(const CWinException e)
		{
			CString msg,
				what(e.what());
			msg.Format(_T("%s\n%s,%s"), e.GetErrorString(),
			    what.c_str(), _T("\nWinMain Goodbye..."));
			::MessageBox(NULL, msg.c_str(), _T("Exception"),
			    MB_OK | MB_ICONSTOP | MB_TASKMODAL);
		}
		catch (const CException &e) // catch all other CException events  
		{
			// Display the exception and quit
			MessageBox(NULL, e.GetText(), A2T(e.what()), MB_ICONERROR);

			return -1;
		}
		catch(...)      // catch all other exception events
		{
			::MessageBox(NULL, _T("WinMain Goodbye..."),
			    _T("Error"),
			    MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL);
		}

		  // release the semaphore
	        ReleaseSemaphore(m_hSemaphore, 1, NULL);
	        CloseHandle(m_hSemaphore);
        }
	return rtn;
}