int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { CoInitialize(NULL); SetUnhandledExceptionFilter(HandleUnknownException); AtlInitCommonControls(ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES); HRESULT hRes = _Module.Init(NULL, hInstance); ATLASSERT(SUCCEEDED(hRes)); int nRet = 0; // BLOCK: Run application { MainGui dlgMain; pMainGui = &dlgMain; // o_O CMessageLoop loop; _Module.AddMessageLoop(&loop); dlgMain.Create(GetDesktopWindow()); dlgMain.ShowWindow(SW_SHOW); loop.Run(); } _Module.Term(); CoUninitialize(); return nRet; }
int main(int argc, char **argv) { QApplication app(argc, argv); auto format = QSurfaceFormat::defaultFormat(); format.setVersion(3, 3); format.setProfile(QSurfaceFormat::CoreProfile); format.setOption(QSurfaceFormat::DeprecatedFunctions, false); QSurfaceFormat::setDefaultFormat(format); MainGui gui; gui.resize(1000, 600); gui.show(); return app.exec(); }
int InitializeGui(HINSTANCE hInstance, LPARAM param) { CoInitialize(NULL); AtlInitCommonControls(ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES); Scylla::initAsGuiApp(); IsDllMode = false; HRESULT hRes = _Module.Init(NULL, hInstance); ATLASSERT(SUCCEEDED(hRes)); int nRet = 0; // BLOCK: Run application { MainGui dlgMain; pMainGui = &dlgMain; // o_O CMessageLoop loop; _Module.AddMessageLoop(&loop); dlgMain.Create(GetDesktopWindow(), param); dlgMain.ShowWindow(SW_SHOW); loop.Run(); } _Module.Term(); CoUninitialize(); return nRet; }