这篇教程C++ AddDocTemplate函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AddDocTemplate函数的典型用法代码示例。如果您正苦于以下问题:C++ AddDocTemplate函数的具体用法?C++ AddDocTemplate怎么用?C++ AddDocTemplate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AddDocTemplate函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: _TBOOL CNewPasEditApp::InitInstance(){ m_hScintilla = ::LoadLibrary( _T("SciLexer.dll") ); if( !m_hScintilla ) { AfxMessageBox( IDS_ERR_NODLL, MB_ICONERROR ); return FALSE; } // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinAppEx::InitInstance(); // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); SetRegistryKey(_T("NewPas")); LoadStdProfileSettings(4); // Load standard INI file options (including MRU) InitKeyboardManager(); InitTooltipManager(); CMFCToolTipInfo ttParams; ttParams.m_bVislManagerTheme = TRUE; theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL, RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams); // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate( IDR_NewPasEditTYPE, RUNTIME_CLASS(CNewPasEditDoc), RUNTIME_CLASS(CChildFrame), // main MDI frame window RUNTIME_CLASS(CNewPasEditView)); if (!pDocTemplate) return FALSE; AddDocTemplate(pDocTemplate); // create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME)) { delete pMainFrame; 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. Will return FALSE if // app was launched with /RegServer, /Register, /Unregserver or /Unregister. if (!ProcessShellCommand(cmdInfo)) return FALSE; // call DragAcceptFiles only if there's a suffix // In an SDI app, this should occur after ProcessShellCommand m_pMainWnd->DragAcceptFiles( TRUE ); // The one and only window has been initialized, so show and update it m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE;}
开发者ID:valentingalea,项目名称:newpas,代码行数:79,
示例2: AfxMessageBoxBOOL cvCTestApp::InitInstance(){ // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // 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(IDS_APPREGISTRY); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register document templates CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(cvCTestDoc), RUNTIME_CLASS(cvCMainFrame), // main SDI frame window RUNTIME_CLASS(cvCTestSuiteView)); pDocTemplate->SetServerInfo( IDR_SRVR_EMBEDDED, IDR_SRVR_INPLACE, RUNTIME_CLASS(cvCInPlaceFrame)); AddDocTemplate(pDocTemplate); m_server.ConnectTemplate(clsid, pDocTemplate, TRUE); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) { COleTemplateServer::RegisterAll(); // Application was run with /Embedding or /Automation. Don't show the // main window in this case. return TRUE; } m_server.UpdateRegistry(OAT_INPLACE_SERVER); COleObjectFactory::UpdateRegistryAll(); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE;}
开发者ID:dineshkummarc,项目名称:TestRunner_automation,代码行数:62,
示例3: InitializeIIDsCGenViewerCtrl::CGenViewerCtrl(){ InitializeIIDs(&IID_DGenViewer, &IID_DGenViewerEvents); // TODO: Initialize your control's instance data here. SetInitialSize(200, 200);#ifdef HOOPS m_pHDB=new HDB(); m_pHDB->Init(); m_pHDB->SetIsolatedDrivers(false);#endif TCHAR cur_dir[MVO_BUFFER_SIZE]; GetCurrentDirectory(MVO_BUFFER_SIZE, cur_dir); memset(m_AppDirectory,0,MVO_BUFFER_SIZE); //UtC(cur_dir, m_AppDirectory);#if defined(INTEROP) || defined(ACIS)#ifdef ACIS //Base configuration must happen before unlocking ACIS. // If not using initialize_base, then unlock must // happen after the initialize modeller base_configuration base_config; logical ok = initialize_base( &base_config); unlock_spatial_products_4158();#endif // ACIS#ifdef INTEROP char *path; path = getenv("PATH"); if (path == NULL) { wchar_t * error_msg = L"Unable to add CATIA V5 DLLs to the path. CATIA V5 translation will not work."; AfxMessageBox(LPCTSTR(error_msg), MB_ICONSTOP); } else { _putenv(H_FORMAT_TEXT("PATH=%s//lib3dx//intel_a//code//bin;%s", m_AppDirectory, path)); }#endif // INTEROP#endif // defined(INTEROP) || defined(ACIS)#ifdef ACIS outcome o; o = api_start_modeller(0); check_outcome(o); //Issue #10605: Default Entity Manager Factory no longer registered by default if (get_major_version() >= 20) { entity_mgr_factory* my_manager = new default_entity_mgr_factory(); { outcome o = asmi_set_entity_mgr_factory(my_manager); check_outcome(o); } } o = api_initialize_hoops_acis_bridge(); check_outcome(o); ha_rendering_options &roptions=HA_Get_Rendering_Options(); { roptions.SetMergeFacesMode(TRUE); roptions.SetGeomPattern ("?Include Library/ACIS model geometry"); roptions.SetPattern("entity"); } #endif // ACIS AfxInitRichEdit(); AddDocTemplate(new CActiveXDocTemplate( RUNTIME_CLASS(CGenViewerDoc), //改为你的文档类 RUNTIME_CLASS(CMainFrame), //改为你的框架类 RUNTIME_CLASS(CGenViewerView))); //改为你的视图类}
开发者ID:binhpt,项目名称:vltest,代码行数:75,
|