From: Leon W. <moo...@us...> - 2005-02-04 14:01:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24600 Modified Files: AnyEdit.cpp Log Message: - Cleaned up InitInstance code, so we have less flickering on startup. This is achieved by showing the Window at the last moment. Also removed some obsolete code. - Added Open Last Workspace code to InitInstance, before opening command line files. Index: AnyEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** AnyEdit.cpp 27 Jan 2005 13:46:08 -0000 1.105 --- AnyEdit.cpp 4 Feb 2005 14:01:29 -0000 1.106 *************** *** 206,219 **** } // Initialize Tag Parsing Thread. CTagsInitialize(); AfxEnableControlContainer(); - CStringArray ar; - m_strSupportEmail = "de...@an..."; - - HINSTANCE hInst = LoadLibrary("AELocal.dll"); - if (hInst != NULL) - AfxSetResourceHandle(hInst); // Get the Application Path --- 206,219 ---- } + // Check for memory leaks + #ifdef _DEBUG + _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + #endif + // Initialize Tag Parsing Thread. CTagsInitialize(); + // Enable containment of ActiveX controls AfxEnableControlContainer(); // Get the Application Path *************** *** 269,272 **** --- 269,273 ---- } + // Show Splash Screen CSplashWnd::EnableSplashScreen( m_ConfigFile.GetSplashScreen() ? TRUE : FALSE ); CSplashWnd::ShowSplashScreen(); *************** *** 285,300 **** // 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(COMPANY); SetRegistryBase(_T("Settings")); free((void*)m_pszProfileName); m_pszProfileName=_tcsdup(APPNAME); - LoadStdProfileSettings(8); // 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. ! m_pDocTemplate = new CMultiDocTemplate( IDR_ANYEDITYPE, --- 286,297 ---- // Change the registry key under which our settings are stored. SetRegistryKey(COMPANY); SetRegistryBase(_T("Settings")); free((void*)m_pszProfileName); m_pszProfileName=_tcsdup(APPNAME); LoadStdProfileSettings(8); // 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. m_pDocTemplate = new CMultiDocTemplate( IDR_ANYEDITYPE, *************** *** 311,314 **** --- 308,312 ---- AddDocTemplate(m_pBrowserTemplate); + // Create tag parsing thread. // Must be created before the main window! m_pCreateTags = new CCreateTagThread(); *************** *** 317,324 **** // Parse command line for standard shell commands, DDE, file open CAECommandLineInfo cmdInfo; - ParseCommandLine(cmdInfo); ! //Do not show empty window if not needed if( !m_ConfigFile.GetStartNewDocument() ) { --- 315,321 ---- // Parse command line for standard shell commands, DDE, file open CAECommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); ! // Do not show empty window if not needed if( !m_ConfigFile.GetStartNewDocument() ) { *************** *** 327,331 **** } ! // create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) --- 324,328 ---- } ! // Create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) *************** *** 341,378 **** instanceChecker.TrackFirstInstanceRunning(); } - LoadPlugins(); InitializeManagers(); if( m_ConfigFile.GetMaximizeWindow() ) m_nCmdShow = SW_SHOWMAXIMIZED; pMainFrame->ShowWindow( m_nCmdShow ); pMainFrame->UpdateWindow(); ! LoadState(); ! ! //Load document save positions ! LoadDocumentPosition(); ! ! //check for leaks ! #ifdef _DEBUG ! _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); ! #endif ! if(m_ConfigFile.GetQuickStartPage() ) { ! OpenStartupPage(); } - AfxInitRichEdit(); - ::HtmlHelp( NULL, - NULL, - HH_INITIALIZE, - (DWORD)&m_dwHelpCookie) ; // Cookie returned by Hhctrl.ocx. // Dispatch commands specified on the command line // Must return false actually but we do it different here :) ! //just for the workspace view files to load up heh! ProcessShellCommand(cmdInfo); if( cmdInfo.m_iColumn != -1 || cmdInfo.m_iLine != -1 ) SendMessage(pMainFrame->m_hWnd,AEM_SETCURSOR,cmdInfo.m_iLine,cmdInfo.m_iColumn); return TRUE; #ifdef _CATCHDUMP --- 338,383 ---- instanceChecker.TrackFirstInstanceRunning(); } + // Initilize menus and keyboard InitializeManagers(); + // Load document save positions + LoadDocumentPosition(); + + // Load the quick start page if wanted. + if(m_ConfigFile.GetQuickStartPage() ) + { + OpenStartupPage(); + } + + // AfxInitRichEdit(); + + // Load the AnyEdit Plugins + // LoadPlugins(); + + // After Initialization has finished show the window if( m_ConfigFile.GetMaximizeWindow() ) m_nCmdShow = SW_SHOWMAXIMIZED; pMainFrame->ShowWindow( m_nCmdShow ); pMainFrame->UpdateWindow(); ! // Initialize HTML Help ! ::HtmlHelp( NULL, NULL, HH_INITIALIZE, (DWORD)&m_dwHelpCookie ); ! // m_dwHelpCookie returned by Hhctrl.ocx. ! // Open the last workspace if the user wanted too ! if (theApp.GetConfigFile()->GetAutoOpenLastWorkspace()) { ! OnMenuWsOpen( ID_FILE_RECENTWORKSPACES_WS1 ); } // Dispatch commands specified on the command line // Must return false actually but we do it different here :) ! // just for the workspace view files to load up heh! ProcessShellCommand(cmdInfo); if( cmdInfo.m_iColumn != -1 || cmdInfo.m_iLine != -1 ) SendMessage(pMainFrame->m_hWnd,AEM_SETCURSOR,cmdInfo.m_iLine,cmdInfo.m_iColumn); + // Just set the e-mail address + m_strSupportEmail = "de...@an..."; + return TRUE; #ifdef _CATCHDUMP *************** *** 485,496 **** int CAnyEditApp::ExitInstance() { ! // TODO: Add your specialized code here and/or call the base class ! UnloadPlugins(); ::HtmlHelp( NULL, NULL, HH_CLOSE_ALL, 0 ); ::HtmlHelp( NULL, NULL, HH_UNINITIALIZE, (DWORD)m_dwHelpCookie ); // Pass in cookie ! if (m_pCreateTags != NULL) { ! if (m_pCreateTags->IsRunning()) m_pCreateTags->Stop(); delete m_pCreateTags; --- 490,504 ---- int CAnyEditApp::ExitInstance() { ! // Close the help file if needed. ::HtmlHelp( NULL, NULL, HH_CLOSE_ALL, 0 ); ::HtmlHelp( NULL, NULL, HH_UNINITIALIZE, (DWORD)m_dwHelpCookie ); // Pass in cookie ! // Unload the Plugins ! // UnloadPlugins(); ! ! // Stop the tag parser thread ! if( m_pCreateTags != NULL ) { ! if( m_pCreateTags->IsRunning() ) m_pCreateTags->Stop(); delete m_pCreateTags; *************** *** 498,502 **** } ! if (m_pWorkspaceTags != NULL) { delete m_pWorkspaceTags; --- 506,511 ---- } ! // Delete left over workspace tags ! if( m_pWorkspaceTags != NULL ) { delete m_pWorkspaceTags; *************** *** 504,510 **** } ! //Save doc positions SaveDocumentPosition(); CTagsUninitialize(); --- 513,520 ---- } ! // Save document positions SaveDocumentPosition(); + // Uninitialize Ctags library CTagsUninitialize(); *************** *** 512,516 **** m_ConfigFile.Save(); ! //Delete all the files in the temp folder CString pat = GetAppPath(); pat += "temp\\"; --- 522,526 ---- m_ConfigFile.Save(); ! // Delete all the files in the temp folder CString pat = GetAppPath(); pat += "temp\\"; |