int main(int argc, const char * argv[]){ CApp app; return app.onExecute(); }
int main(int argc, char **argv) { CApp app; app.setStartScreen(new IntroScreen()); app.setStartScreen(new NewGameScreen()); return app.OnExecute(); }
int main(int argc, char** argv) { // Initialize CApp Client; Client.bRunning = Client.initializeSDL(); // Main loop int i = 0; while ( Client.bRunning ) { Client.update(); SDL_Delay( 20 ); i++; if ( i > 100 ) { Client.bRunning = false; } } // Close Client.shutdown(); return 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; }
//------------------------------------------------------------------ // // GetInstance(..) // // Windows event callback method. // Don't handles events here, do it in OnEvent(...) // //------------------------------------------------------------------ LRESULT CALLBACK CApp::MsgHandlerMain(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { if (hWnd == NULL) { CDEBUGLOG->WriteError("Invalid window handle in message callback"); throw std::runtime_error("Invalid window handle"); } // Retrieve a pointer to the D3D9Application object CApp* app = (CApp*)GetWindowLongPtr( hWnd, GWLP_USERDATA ); if ( app == NULL ) return DefWindowProc( hWnd, uiMsg, wParam, lParam ); // Handle required messages switch ( uiMsg ) { case WM_CLOSE: ShowWindow( app->m_hWnd, SW_HIDE ); app->m_bRun = false; break; } if(app->OnEvent(hWnd, uiMsg,wParam,lParam) == FALSE) return DefWindowProc( hWnd, uiMsg, wParam, lParam ); 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; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int nCmdShow) { DbgInitialise(hInstance); g_App.SetAppValues(hInstance, APPNAME, IDS_APP_TITLE) ; // Perform application initialization: if(! g_App.InitInstance(nCmdShow)) { DbgTerminate(); return (FALSE) ; } HACCEL hAccelTable ; hAccelTable = LoadAccelerators(hInstance, g_App.GetAppName()) ; // Main message loop: MSG msg ; while(GetMessage(&msg, NULL, 0, 0)) { if(! TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg) ; DispatchMessage(&msg) ; } } DbgTerminate(); return ((int) msg.wParam) ; }
int main(int argc, char** argv) #endif { tCreationFlags creationFlags; creationFlags.sWindowTitle = "Raytracer"; int32 iWidth = 320; int32 iHeight = 240; #ifdef __amigaos4__ if ( argc == 3 ) { iWidth = iClamp( atoi( argv[1] ), 160, 1600 ); iHeight = iClamp( atoi( argv[2] ), 160, 1280 ); } #endif #ifdef WIN32 creationFlags.hIcon = LoadIcon( GetModuleHandle( 0 ), MAKEINTRESOURCE( IDI_ICON1 ) ); #endif creationFlags.iWindowWidth = iWidth; creationFlags.iWindowHeight = iHeight; creationFlags.bWindowed = true; CApp theApp; if( !theApp.bInitialize( creationFlags ) ) return 1; return theApp.iRun(); }
int main(int argv, char** argc) { CApp myGame; if (!myGame.OnInit()) return -1; return myGame.Run(); }
int main(int argc, char *argv[]) { gApp.RelayoutArgs(argc, argv); gApp.Initialize(argc, argv) && gApp.Startup() && gApp.Run(); gApp.Shutdown(); return 0; }
int main(int argc, char** argv) { CApp theApp; int retCode = 0; retCode = theApp.onExecute(); return retCode; }
void main() { CApp app; app.Init(); app.Run(); app.Exit(); }
static void ExecuteCommand(UINT commandID) { CPanel::CDisableTimerProcessing disableTimerProcessing1(g_App.Panels[0]); CPanel::CDisableTimerProcessing disableTimerProcessing2(g_App.Panels[1]); switch (commandID) { case kAddCommand: g_App.AddToArchive(); break; case kExtractCommand: g_App.ExtractArchives(); break; case kTestCommand: g_App.TestArchives(); break; } }
//Starting point of program int main(int argc, char* argv[]){ CApp theApp; // START DISPLAY SDL VERSION SDL_version compiled; SDL_VERSION(&compiled); printf("We compiled against SDL version %d.%d.%d ...\n", compiled.major, compiled.minor, compiled.patch); // END DISPLAY SDL VERSION return theApp.OnExecute(); }
/// @brief entry point int main() { // catch to properly free all gl resources try { CApp app; Log::msg("main loop start"); app.run(); Log::msg("main loop end"); } catch(std::exception& e) { Log::err(e.what()); } }
void ExecuteCommand(UINT commandID) { switch (commandID) { case kAddCommand: g_App.AddToArchive(); break; case kExtractCommand: g_App.ExtractArchives(); break; case kTestCommand: g_App.TestArchives(); break; } }
/* A very short main as we do everything else in classes. */ int main(int argc, char *argv[]) { CApp APP; if ( !APP.init(argc, argv) ) { printf("init failed\n"); return 1; } APP.run(); APP.quit(); return 0; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { g_hInstance = hInstance; srand(timeGetTime()); CApp* pApp = CFactory<CApp>::Create(s_sApp); s_aqs = pApp->Query(); CFactory<CApp>::Destroy(pApp); pApp = NULL; // Init(lpCmdLine); // MSG msg; PeekMessage(&msg, NULL, 0U, 0U, PM_NOREMOVE); while( WM_QUIT != msg.message ) { BOOL bMsg = PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE); if ( bMsg ) { TranslateMessage(&msg); DispatchMessage(&msg); } else { if ( /*active*/ true ) { Idle(); } else { WaitMessage(); } } } // Term(); return 0; }
void CViewMeetings::OnMeetingsChart() { int nSel = m_ListMeetings.GetCurSel(); if(nSel == -1) { AfxMessageBox("No Meeting is selected."); return; } SMeeting* pMeeting = m_arMeetings[nSel]; if(!pMeeting) return; if(pMeeting->nCompanyID == 0) { AfxMessageBox("This meeting was about a 'New Idea'. No specific Company was discussed."); return; } CCompany* pCompany = NULL; CString sTicker = CSQLCompany::GetCompanyTickerByID(pMeeting->nCompanyID); int nIndex = theApp.m_Universe.GetIndexByTicker(sTicker); if(nIndex == -1) return; pCompany = theApp.m_Universe.GetCompanyByTicker(nIndex); if(!pCompany) return; CViewCharts* pView = theApp.NewViewCharts(); CString sTokens; sTokens.Format("%s_REPV %s_NEPV %s_Price", sTicker, sTicker, sTicker); pView->SetCharts(sTokens, "", true); }
void CViewMeetings::OnMeetingsCompany() { int nSel = m_ListMeetings.GetCurSel(); if(nSel == -1) { AfxMessageBox("No Meeting is selected."); return; } SMeeting* pMeeting = m_arMeetings[nSel]; if(!pMeeting) return; if(pMeeting->nCompanyID == 0) { AfxMessageBox("This meeting was about a 'New Idea'. No specific Company was discussed."); return; } CCompany* pCompany = NULL; CString sTicker = CSQLCompany::GetCompanyTickerByID(pMeeting->nCompanyID); int nIndex = theApp.m_Universe.GetIndexByTicker(sTicker); if(nIndex == -1) return; pCompany = theApp.m_Universe.GetCompanyByTicker(nIndex); if(!pCompany) return; theApp.NewViewGeneral(pCompany); }
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; }
/* Short main as most is done in classes. */ int main(int argc, char *argv[]) { CApp APP; if ( !APP.init(argc, argv) ) { printf("init failed\n"); APP.quit(); return 1; } APP.setRunning(true); /* main application loop */ while(APP.isRunning()) { if ( !APP.update() ) break; } APP.quit(); return 0; }
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT ) { // Enter the message loop MSG msg; ZeroMemory( &msg, sizeof(msg) ); // main loop while( msg.message != WM_QUIT ) { if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { // start measuring FPS cApp.GetScene( )->Starttiming( ); // update input and camera cApp.GetInput( )->update( ); cApp.GetCamera( )->Update( ); // once 5 frames do update the scene // if trees dont move between circles, etc. if( tickCount > 2) { cApp.GetScene( )->Update( ); tickCount = 0; } else { tickCount++; } // each frame do tickUpdate cApp.GetScene( )->Animate( ); // and draw scene cApp.GetScene( )->Draw( ); cApp.GetScene( )->Endtiming( ); // and print FPS in window label cApp.PrintFPS( ); } } // Clean up everything and exit the app // destructor of the CApp class will do it return 0; }
BOOL CDialogConnections::OnInitDialog() { CDialog::OnInitDialog(); m_sServer1 = theApp.GetProfileString("Server Connections", "server1"); m_sServer2 = theApp.GetProfileString("Server Connections", "server2"); m_sServer3 = theApp.GetProfileString("Server Connections", "server3"); m_sLogin1 = theApp.GetProfileString("Server Connections", "login1"); m_sLogin2 = theApp.GetProfileString("Server Connections", "login2"); m_sLogin3 = theApp.GetProfileString("Server Connections", "login3"); m_sPassw1 = theApp.GetProfileString("Server Connections", "psw1"); m_sPassw2 = theApp.GetProfileString("Server Connections", "psw2"); m_sPassw3 = theApp.GetProfileString("Server Connections", "psw3"); CString sDb = theApp.GetProfileString("Server Connections", "db"); if(sDb.IsEmpty()) m_nDatabase = 0; else m_nDatabase = atoi(sDb); if(m_sServer1.IsEmpty()) { m_sServer1 = "localhost"; //m_sServer1 = "cornerstone_dev"; m_sLogin1 = "root"; //m_sLogin1 = "cip_client"; m_sPassw1 = "root"; //m_sPassw1 = "cipclientresearch"; } UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
LRESULT CApp::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HDC hDC ; static PAINTSTRUCT ps; switch(message) { case WM_PAINT: hDC = BeginPaint(hWnd, &ps) ; ASSERT(hDC); if (hDC) g_App.DrawStatus(hDC); EndPaint(hWnd, &ps) ; break ; case WM_KEYUP: g_App.KeyProc(wParam, lParam) ; break ; case WM_COMMAND: g_App.MenuProc(hWnd, wParam, lParam) ; break; case WM_NOTIFY: return g_App.ToolTipProc(hWnd, message, wParam, lParam); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_SIZE: // we do this to cause the toolbar to resize correctly SendMessage(g_App.m_hwndToolBar, WM_SIZE, wParam, lParam); return DefWindowProc(hWnd, message, wParam, lParam); break; default: return (DefWindowProc(hWnd, message, wParam, lParam)); } return 0; // let Windows know we handled the message }
int main() { CConfig *cfg = new CConfig(L"../system/config.xml"); if(!cfg->load()) { std::cerr << "Can't read XML file" << std::endl; return 1; } CApp *app = new CApp(); if(!app->init(cfg->getParam(), cfg->getConfig(L"title"), cfg->getBool(L"resize")) ) { std::cerr << "Could not init device." << std::endl; return 1; } app->loop(); delete app; return 0; }
int main(int argc, char *argv[]) { SDL_Window * window = NULL; // init SDL if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { cout << "Cannot initialize SDL: " << SDL_GetError() << endl; return false; } // init window if ((window = SDL_CreateWindow( APP_NAME, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, APP_WIDTH, APP_HEIGHT, SDL_WINDOW_SHOWN) ) == NULL) { cout << "Window cannot be created: " << SDL_GetError() << endl; return false; } // init SDL_image int imgFlags = IMG_INIT_PNG; if(!(IMG_Init(imgFlags) & imgFlags)) { cout << "Cannot initialize SDL_image: " << SDL_GetError() << endl; } // init SDL_mixer int mixFlags = MIX_INIT_OGG; if(!(Mix_Init(mixFlags) & mixFlags)) { cout << "Cannot initialize SDL_mixer: " << Mix_GetError() << endl; } // init app try { CApp * app = new CApp(window); app->Init(); app->Loop(); app->Cleanup(); } catch (char * e) { cout << e << SDL_GetError() << endl; return false; } catch (exception& e) { cout << e.what() << endl; return false; } }
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd) { InitializeCriticalSection(&cs_CountThread); /*LANGID lid = LOBYTE (GetUserDefaultUILanguage()); if (lid != LANG_RUSSIAN) {return (0);}*/ App.CreateWnd(hInstance,lpCmdLine,nShowCmd,WndProc); App.CreateTreeView(); App.ParseMainFolder(); MSG msg; App.CreateToolBar(); //_beginthreadex(NULL,0,LogWindow,(void *)123,0,NULL); //_beginthreadex(NULL,0,LogWindow,(void *)123,0,NULL); //_beginthreadex(NULL,0,LogWindow,(void *)123,0,NULL); while(GetMessage(&msg,0,0,0)==TRUE) { TranslateMessage(&msg); DispatchMessage(&msg); } App.DeleteTrayIcon(); return 0; }
BOOL CALLBACK CApp::SelectParentalLevel(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { DbgLog((LOG_TRACE, 5, TEXT("CApp::SelectParentalLevel()"))) ; switch(message) { case WM_INITDIALOG: g_App.MakeParentLevelList(hDlg, IDC_LEVEL_LIST) ; return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: { LONG lLevel ; lLevel = (LONG) SendDlgItemMessage(hDlg, IDC_LEVEL_LIST, LB_GETCURSEL, static_cast<WPARAM>(0), static_cast<LPARAM>(0)); if(CB_ERR == lLevel) DbgLog((LOG_ERROR, 1, TEXT("WARNING: Couldn't get selected parental control level (Error %d)"), lLevel)) ; else g_App.m_pDvdCore->SetParentalLevel(g_App.m_pParentLevels->GetValue(lLevel)) ; } // Now fall through to just end the dialog case IDCANCEL: EndDialog(hDlg, TRUE); return TRUE; } break; default: break; } return FALSE; }
//----------------------------------------------------------------------------- // Name: FullScreenWndProc() // Desc: The WndProc funtion used when the app is in fullscreen mode. This is // needed simply to trap the ESC key. //----------------------------------------------------------------------------- LRESULT CALLBACK FullScreenWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { if( msg == WM_CLOSE ) { // User wants to exit, so go back to windowed mode and exit for real g_AppFormView->OnToggleFullScreen(); g_App.GetMainWnd()->PostMessage( WM_CLOSE, 0, 0 ); } if( msg == WM_SETCURSOR ) { SetCursor( NULL ); } if( msg == WM_KEYUP && wParam == VK_ESCAPE ) { // User wants to leave fullscreen mode g_AppFormView->OnToggleFullScreen(); } return DefWindowProc( hWnd, msg, wParam, lParam ); }