BOOL CMFCTestApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMFCTestDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CMFCTestView)); AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // The one and only window has been initialized, so show and update it. m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; }
BOOL CLLKCLIApp::InitInstance() { AfxSocketInit(); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif GetPrivateProfileStringA("SERVER_INFO","IP","127.0.0.1",ip,sizeof(ip),"./set.ini"); char strPort[5]; GetPrivateProfileStringA("SERVER_INFO","PORT","5601",strPort,sizeof(strPort),"./set.ini"); port = atoi(strPort); m_pSockThd = new CSockThd; m_pSockThd->CreateThread(); CLLKCLIDlg login; int nResponse = login.DoModal(); if(nResponse == IDCANCEL) return FALSE; CLLKHome home; home.m_uid=userInfo.id; home.m_nick=userInfo.nick; home.m_score=userInfo.type; if(userInfo.sex==0){ home.m_sex="Å®"; } else{ home.m_sex="ÄÐ"; } m_pMainWnd = &home; home.DoModal(); return FALSE; }
BOOL CImagingApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate( IDR_IMAGINTYPE, RUNTIME_CLASS(CImagingDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CImagingView)); AddDocTemplate(pDocTemplate); // create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; m_pMainWnd = pMainFrame; // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // The main window has been initialized, so show and update it. pMainFrame->ShowWindow(m_nCmdShow); pMainFrame->UpdateWindow(); return TRUE; }
BOOL CDataViewApp::InitInstance() { CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // ProcessShellCommand(cmdInfo); CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash); //Set up date and time defaults so they're the same as system defaults setlocale(LC_ALL, "usa"); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif AfxEnableControlContainer(); HBRUSH hBrush=(HBRUSH)GetStockObject(WHITE_BRUSH); HCURSOR hCur=(HCURSOR)::LoadCursor(NULL,IDC_ARROW); HICON hIco=LoadIcon(MAKEINTRESOURCE(IDR_MAINFRAME)); LPCTSTR lpClass=AfxRegisterWndClass(CS_DBLCLKS|CS_VREDRAW,hCur,hBrush,hIco); CMainFrame *pMainFrame = new CMainFrame; RECT rcM = { 0,0,100,100 }; ::GetWindowRect(::GetDesktopWindow(),&rcM); if (!pMainFrame->Create(lpClass,"Interactive Time Series Viewer", WS_VISIBLE | WS_OVERLAPPEDWINDOW,rcM,NULL,NULL)) return FALSE; m_pMainWnd = pMainFrame; pMainFrame->ShowWindow(m_nCmdShow|SW_SHOWMAXIMIZED); pMainFrame->UpdateWindow(); pMainFrame->MaiFrameMenu.LoadMenu(IDR_MAINFRAME); pMainFrame->SetMenu(&pMainFrame->MaiFrameMenu); pMainFrame->SendMessage(WM_COMMAND,IDC_AUTOAMP); LoadGainMenu(); LoadFilterMenu(); return TRUE; }
BOOL CStatusPanesApp::InitInstance() { InitCommonControls(); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #if _MFC_VER < 0x700 #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey( _T("Foss") ); // To create the main window, this code creates a new frame window // object and then sets it as the application's main window object. CMainFrame* pFrame = new CMainFrame; m_pMainWnd = pFrame; // create and load the frame with its resources pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); // // The one and only window has been initialized, so show and update it. // pFrame->ShowWindow(SW_SHOW); // pFrame->UpdateWindow(); // window placement persistence pFrame->ActivateFrame( SW_SHOW ); return TRUE; }
BOOL CIgnitionApp::InitInstance() { #ifdef _AFXDLL Enable3dControls(); #else Enable3dControlsStatic(); #endif m_state = IGNITION_STATE_STARTUP; m_stateError = 0; m_pMainWnd = &theDlg; theDlg.DoModal(); return FALSE; }
BOOL AtheroApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. Enable3dControls(); LoadStdProfileSettings(); // Load standard INI file options (including MRU) CMainWindow dlg; m_pMainWnd = &dlg; dlg.DoModal(); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CVideoIntecomSrvApp::InitInstance() { m_Mutex = new CMutex(FALSE,"VedioIntercomSrv030407",NULL); if(m_Mutex->Lock(1) == 0) { AfxMessageBox("已经有另外一个实例在运行"); return FALSE; } if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif NET_DVR_Init(); SetDialogBkColor(RGB(233,233,233),RGB(0,0,0)); CVideoIntecomSrvDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CCStatusLogDemoApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif g_statusLog.Init("StatusLog.txt"); g_statusLog.PrintTime(TRUE); g_statusLog.PrintAppName(TRUE); g_statusLog.StatusOut("%s", "Howdy, stranger!"); g_statusLog.StatusOut("Did you know that %d * %4.2f = %4.2f ?", 15, 32.434, (15 * 32.434)); g_statusLog.StatusOut("Ain't that great?"); g_statusLog.StatusOut("I'm at : 0x%x", this); g_statusLog.StatusOut("Is anyone else here?"); CCStatusLogDemoDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } g_statusLog.StatusOut("Bye bye"); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CPKCSDemoApp::InitInstance() { AfxEnableControlContainer(); CK_RV rv; rv = C_Initialize(NULL_PTR); if(CKR_OK != rv) { AfxMessageBox("Can not load ePassNG PKCS#11 runtime!", MB_OK | MB_ICONERROR); return FALSE; } // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CPKCSDemoDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. C_Finalize(NULL_PTR); return FALSE; }
BOOL CVolumeControlApp::InitInstance() { CreateMutex( NULL, TRUE, PROG_INSTANCE_NAME ); if( GetLastError() == ERROR_ALREADY_EXISTS ) { HWND hChatterWnd = FindWindow( NULL, PROG_NAME ); ShowWindow( hChatterWnd, SW_RESTORE ); MessageBox( NULL, "Volume Control already running", "Volume Control", MB_OK | MB_ICONASTERISK ); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CVolumeControlDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CCallMeSleepApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif if(*m_lpCmdLine != 0) { int hour = 0; int min = 0; int sec = 0; _stscanf(m_lpCmdLine, _T("%d:%d:%d"), &hour, &min, &sec); _Module.Init(m_hInstance, _T("CallMeSleep"), NULL); _Module.m_bService = TRUE; _Module.SetTime(hour, min, sec); _Module.Start(); } else { CCallMeSleepDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CEnrollApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CEnrollDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CCourseView)); AddDocTemplate(pDocTemplate); // Enable DDE Execute open EnableShellOpen(); RegisterShellFileTypes(TRUE); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // Enable drag/drop open m_pMainWnd->DragAcceptFiles(); return TRUE; }
BOOL CXphoneApp::InitInstance() { CWaitCursor pCursor; if ( ! SetFirstInstance() ) return FALSE; CString xUserId, xPassword; if ( ! CheckUsage( xUserId, xPassword ) ) return FALSE; Enable3dControls(); SetRegistryKey( gcszCopyright ); GetVersionNumber(); AfxOleInit(); AfxEnableControlContainer(); CSplashDlg* dlgSplash = new CSplashDlg; dlgSplash->Topmost(); dlgSplash->Step( _T("Winsock") ); WSADATA wsaData; if ( WSAStartup( 0x0101, &wsaData ) ) return FALSE; dlgSplash->Step( _T("注册表") ); Settings.Load(); Skin.Apply(); dlgSplash->Step( _T("GUI") ); m_pMainWnd = new CConnectDlg; CoolMenu.EnableHook(); dlgSplash->Topmost(); m_pMainWnd->ShowWindow( SW_SHOWNORMAL ); // m_pMainWnd->BringWindowToTop(); dlgSplash->Step( _T("连接") ); m_pMainWnd->SendMessage( WM_COMMAND, ID_NETWORK_CONNECT ); dlgSplash->Hide(); pCursor.Restore(); return m_bInitialized = TRUE; }
BOOL CFraktaleApp::InitInstance() { // Standardinitialisierung // Wenn Sie diese Funktionen nicht nutzen und die Größe Ihrer fertigen // ausführbaren Datei reduzieren wollen, sollten Sie die nachfolgenden // spezifischen Initialisierungsroutinen, die Sie nicht benötigen, entfernen. #ifdef _AFXDLL Enable3dControls(); // Diese Funktion bei Verwendung von MFC in gemeinsam genutzten DLLs aufrufen #else Enable3dControlsStatic(); // Diese Funktion bei statischen MFC-Anbindungen aufrufen #endif // Ändern des Registrierungsschlüssels, unter dem unsere Einstellungen gespeichert sind. // ZU ERLEDIGEN: Sie sollten dieser Zeichenfolge einen geeigneten Inhalt geben // wie z.B. den Namen Ihrer Firma oder Organisation. SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(0); // Standard INI-Dateioptionen laden (einschließlich MRU) // Dokumentvorlagen der Anwendung registrieren. Dokumentvorlagen // dienen als Verbindung zwischen Dokumenten, Rahmenfenstern und Ansichten. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CFraktaleDoc), RUNTIME_CLASS(CMainFrame), // Haupt-SDI-Rahmenfenster RUNTIME_CLASS(CFraktaleView)); AddDocTemplate(pDocTemplate); // Befehlszeile parsen, um zu prüfen auf Standard-Umgebungsbefehle DDE, Datei offen CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Verteilung der in der Befehlszeile angegebenen Befehle if (!ProcessShellCommand(cmdInfo)) return FALSE; // Das einzige Fenster ist initialisiert und kann jetzt angezeigt und aktualisiert werden. m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; }
BOOL CMapMgrApp::InitInstance() { if( !FirstInstance() ) return FALSE; // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif SetDialogBkColor(); // Set dialog background color to gray LoadStdProfileSettings(); // Load standard INI file options (including MRU) AfxEnableControlContainer(); // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMapMgrDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CPictView)); AddDocTemplate(pDocTemplate); // create a new (empty) document OnFileNew(); ((CMainFrame*)GetMainWnd())->RestorePosition( SW_SHOWNORMAL ); if (m_lpCmdLine[0] != '\0') { // TODO: add command line processing here } m_pMainWnd->SendMessage( WM_COMMAND, ID_APPSTART, 0 ); return TRUE; }
BOOL CWeekdayApp::InitInstance() { // Standardinitialisierung // Wenn Sie diese Funktionen nicht nutzen und die Größe Ihrer fertigen // ausführbaren Datei reduzieren wollen, sollten Sie die nachfolgenden // spezifischen Initialisierungsroutinen, die Sie nicht benötigen, entfernen. #ifdef _AFXDLL Enable3dControls(); // Diese Funktion bei Verwendung von MFC in gemeinsam genutzten DLLs aufrufen #else Enable3dControlsStatic(); // Diese Funktion bei statischen MFC-Anbindungen aufrufen #endif CWeekdayDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); return FALSE; }
BOOL CClientApp::InitInstance() { if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("DIRT software")); m_ClientDlgHWND = 0; CClientDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; };
BOOL CSrv_orsanApp::InitInstance() { if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif //MessageBox(NULL, m_lpCmdLine, "Titulo", MB_OK); CSrv_orsanDlg dlg; dlg.m_argumentos = m_lpCmdLine; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CGetIhtmlApp::InitInstance() { HANDLE mtx=CreateMutex(NULL,TRUE,"26jtj"); if (GetLastError()==ERROR_ALREADY_EXISTS) { return FALSE; } AfxEnableControlContainer(); CoInitialize( NULL );//±ØÐëÏȳõʼ»¯ // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CGetIhtmlDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. ReleaseMutex(mtx); return FALSE; }
BOOL CTwisterApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CTwisterDialog dlg; m_pMainWnd = &dlg; dlg.DoModal(); return FALSE; }
BOOL CESFEA2DApp::InitInstance() { Enable3dControls(); SetRegistryKey(_T("ESFEA")); LoadStdProfileSettings(8); CAnimateCtrl animctrl; m_sg.create_tree(); m_i_manip_mode = 0; m_drag_mode = true; m_font.CreateFont(-11, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, _T("Arial")); m_font_small.CreateFont(-10, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, _T("Arial Bold")); m_background_color.set_value(0.8f, 0.8f, 0.8f); CMainFrame* pFrame = new CMainFrame; m_pMainWnd = pFrame; pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); m_app_icon = LoadIcon(IDI_SEJIKA); m_pMainWnd->SetIcon(m_app_icon, TRUE); m_pMainWnd->SetIcon(m_app_icon, FALSE); pFrame->ShowWindow(SW_SHOW); pFrame->UpdateWindow(); m_last_file = GetProfileString("user", "last_file", "..\\Mesh Files\\P3.xml"); open_file(m_last_file); return TRUE; }
BOOL uApp::InitInstance() { Enable3dControls(); uInit(); plg = new Eqp1; uPluginContainer* upc = (uPluginContainer*) plg->create_cp(NULL); ASSERT(upc); plg->cp = upc; plg->set_defaults(); m_pMainWnd = (CWnd*) upc; //upc->CenterWindow(); upc->ShowWindow(SW_SHOW); return TRUE; }
BOOL CSaverApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. Enable3dControls(); SetRegistryKey(_T("Complex\\ProbableWorlds")); if (__argc == 1 || MatchOption(__argv[1], _T("c"))) DoConfig(); else if (MatchOption(__argv[1], _T("p"))) { /* // sorry no preview!!! CWnd* pParent = CWnd::FromHandle((HWND)atol(__argv[2])); ASSERT(pParent != NULL); CDrawWnd* pWnd = new CDrawWnd(); CRect rect; pParent->GetClientRect(&rect); pWnd->Create(NULL, WS_VISIBLE|WS_CHILD, rect, pParent, NULL); m_pMainWnd = pWnd; return TRUE; */ return FALSE; } else if (MatchOption(__argv[1], _T("s"))) { CSaverWnd* pWnd = new CSaverWnd; pWnd->Create(); m_pMainWnd = pWnd; return TRUE; } /* CSaverWnd* pWnd = new CSaverWnd; pWnd->Create(); m_pMainWnd = pWnd; return TRUE; */ return FALSE; }
BOOL CListCtrlDemoApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // We need to init COM in order to show an image in the // list control if (!AfxOleInit()) { AfxMessageBox("Unable to initialize OLE.\nTerminating application!"); return FALSE; } // Then shown the dialog CListCtrlDemoDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CUsbhidiocApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. //call this to enable using a rich text box. //AfxEnableControlContainer(); #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CUsbhidiocDlg dlg; m_pMainWnd = &dlg; //AfxInitRichEdit(); int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CAniClientApp::InitInstance() { DIAG_SET( ConnectInfo, false ); DIAG_SET( ConnectionGeneralInfo, false ); DIAG_SET( ConnectWarning, true ); DIAG_SET( ConnectUnknownTransactionType, true ); DIAG_SET( UnknownObjectType, true ); if ( !AfxSocketInit( ) ) { AfxMessageBox( IDP_SOCKETS_INIT_FAILED ); return FALSE; } AfxEnableControlContainer( ); srand( ( unsigned int )time( NULL ) ); // Standard initialization #ifdef _AFXDLL Enable3dControls( ); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic( ); // Call this when linking to MFC statically #endif CProfileVarLinker::LoadAll( ); CBaseLibCleaner Cleaner; ::AfxInitRichEdit( ); CAniClientDlg Dlg; m_pMainWnd = &Dlg; Dlg.DoModal( ); CProfileVarLinker::SaveAll( ); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CPcShareApp::InitInstance() { AfxOleInit(); //保证只启动一次 m_LockHandle = CreateMutex(NULL,TRUE,"PcShare2005"); if(m_LockHandle == NULL || GetLastError() == ERROR_ALREADY_EXISTS) return FALSE; ReleaseMutex(m_LockHandle); //初始化SOCKET环境 WSADATA data; if(WSAStartup(MAKEWORD(2, 2), &data)) return FALSE; if (LOBYTE(data.wVersion) !=2 || HIBYTE(data.wVersion) != 2) { WSACleanup(); return FALSE; } //初始化控件环境 AfxEnableControlContainer(); Enable3dControls(); CoInitialize(NULL); memset(&m_MainValue, 0, sizeof(m_MainValue)); //启动主界面 CMainFrame* pFrame = new CMainFrame; m_pMainWnd = pFrame; pFrame->LoadFrame(IDR_MAINFRAME); pFrame->ShowWindow(SW_SHOWMAXIMIZED); pFrame->ResizeWnd(); pFrame->UpdateWindow(); pFrame->StartWork(); return TRUE; }
BOOL CGuiMPIRunApp::InitInstance() { AfxEnableControlContainer(); AfxInitRichEdit(); // Standard initialization #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. //SetRegistryKey(_T("Local AppWizard-Generated Applications")); //LoadStdProfileSettings(0); // Load standard INI file options (including MRU) // Register document templates CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CGuiMPIRunDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CGuiMPIRunView)); AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->SetWindowText("guiMPIRun"); m_pMainWnd->UpdateWindow(); return TRUE; }
BOOL CChatServerApp::InitInstance() { //Using Logger //#include "logger.h" Logger.Init("logger.property", "Server"); Logger.LogInfo("InitInstance()..."); //Using CXmlWrapper //#include "XmlWrapper.h" CXmlWrapper::Init(); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CChatServerDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }