本文整理汇总了C++中EnableShellOpen函数的典型用法代码示例。如果您正苦于以下问题:C++ EnableShellOpen函数的具体用法?C++ EnableShellOpen怎么用?C++ EnableShellOpen使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EnableShellOpen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AfxEnableControlContainer
BOOL CKh_2App::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.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_KH_2TYPE,
RUNTIME_CLASS(CKh_2Doc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CKh_2View));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// 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;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
示例2: RUNTIME_CLASS
BOOL COthelloApp::InitInstance()
{
CWinApp::InitInstance();
// SetRegistryKey(_T("Local AppWizard-Generated Applications"));
// LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate
(
IDR_MAINFRAME,
RUNTIME_CLASS(COthelloDoc),
RUNTIME_CLASS(COthelloMainFrame),
RUNTIME_CLASS(COthelloView)
);
AddDocTemplate(pDocTemplate);
EnableShellOpen();
RegisterShellFileTypes(TRUE);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo)) return FALSE;
int x = (GetSystemMetrics(SM_CXSCREEN) - APP_WIDTH) / 2;
int y = (GetSystemMetrics(SM_CYSCREEN) - APP_HEIGHT) / 2;
m_pMainWnd->MoveWindow(x,y,APP_WIDTH,APP_HEIGHT);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例3: _chdir
BOOL CGumpEditorApp::InitInstance()
{
_chdir(CFileString::GetModuleDir());
try {
std::string config_file = "xml\\config.xml";
if(!nConfig::Init(config_file)) {
pDebug.Log("Unable to load configuration file - Using defaults ", __FILE__, __LINE__, LEVEL_WARNING);
MessageBox(NULL, config_file.c_str(), "Can't Open File", MB_OK|MB_ICONERROR);
return FALSE;
}
} catch (...) {
return FALSE;
}
// InitCommonControls() 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.
InitCommonControls();
CWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CGumpEditorDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CGumpListView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
EnableShellOpen();
RegisterShellFileTypes(TRUE);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例4: sizeof
BOOL CMathApp::InitInstance()
{
// 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);
CWinApp::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
// 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(4); // 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(CMathDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMathView));
if (!pDocTemplate)
return FALSE;
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. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
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();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
// Enable drag/drop open
// m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例5: Enable3dControls
BOOL CImconApp::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_IMCONTYPE,
RUNTIME_CLASS(CImconDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CImconView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// DON'T display a new MDI child window during startup!!!
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->SetImageFormat("");
pMainFrame->SetImageSize(0, 0, 0);
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
示例6: EnableTaskbarInteraction
BOOL CLogiSimApp::InitInstance()
{
CWinApp::InitInstance();
EnableTaskbarInteraction(FALSE);
// RichEdit 컨트롤을 사용하려면 AfxInitRichEdit2()가 있어야 합니다.
// AfxInitRichEdit2();
// 표준 초기화
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
// 아래에서 필요 없는 특정 초기화
// 루틴을 제거해야 합니다.
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
// 적절한 내용으로 수정해야 합니다.
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
LoadStdProfileSettings(4); // MRU를 포함하여 표준 INI 파일 옵션을 로드합니다.
// 응용 프로그램의 문서 템플릿을 등록합니다. 문서 템플릿은
// 문서, 프레임 창 및 뷰 사이의 연결 역할을 합니다.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CLogiSimDoc),
RUNTIME_CLASS(CMainFrame), // 주 SDI 프레임 창입니다.
RUNTIME_CLASS(CLogiSimView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// 표준 셸 명령, DDE, 파일 열기에 대한 명령줄을 구문 분석합니다.
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// DDE Execute 열기를 활성화합니다.
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// 명령줄에 지정된 명령을 디스패치합니다.
// 응용 프로그램이 /RegServer, /Register, /Unregserver 또는 /Unregister로 시작된 경우 FALSE를 반환합니다.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// 창 하나만 초기화되었으므로 이를 표시하고 업데이트합니다.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// 접미사가 있을 경우에만 DragAcceptFiles를 호출합니다.
// SDI 응용 프로그램에서는 ProcessShellCommand 후에 이러한 호출이 발생해야 합니다.
// 끌어서 놓기에 대한 열기를 활성화합니다.
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例7: _tsetlocale
BOOL CDBFExplorerApp::InitInstance()
{
_tsetlocale(LC_ALL, _T(""));
// 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.
InitCommonControls();
#ifndef _WIN64
AfxDaoInit();
#endif
// Change the registry key under which our settings are stored.
SetRegistryKey(_T("Pablo Software Solutions"));
LoadStdProfileSettings(max(_AFX_MRU_COUNT, 9)); // 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.
AddDocTemplates();
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE | FWS_PREFIXTITLE))
return FALSE;
m_pMainWnd = pMainFrame;
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Enable DDE Execute open
EnableShellOpen();
#ifdef _DEBUG
RegisterShellFileTypes(TRUE);
#endif
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
// prevent application from opening a new (empty) document
//cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
ParseCommandLine(cmdInfo);
if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_nCmdShow = SW_SHOWMAXIMIZED;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
示例8: InitCommonControls
BOOL CMyIEApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControls()。否则,将无法创建窗口。
InitCommonControls();
CWinApp::InitInstance();
// 初始化 OLE 库
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
LoadStdProfileSettings(4); // 加载标准 INI 文件选项(包括 MRU)
// 注册应用程序的文档模板。文档模板
// 将用作文档、框架窗口和视图之间的连接
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CQQRegDoc),
RUNTIME_CLASS(CMainFrame), // 主 SDI 框架窗口
RUNTIME_CLASS(CMyIEView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// 启用“DDE 执行”
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// 分析标准外壳命令、DDE、打开文件操作的命令行
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// 调度在命令行中指定的命令。如果
// 用 /RegServer、/Register、/Unregserver 或 /Unregister 启动应用程序,则返回 FALSE。
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// 唯一的一个窗口已初始化,因此显示它并对其进行更新
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// 仅当存在后缀时才调用 DragAcceptFiles,
// 在 SDI 应用程序中,这应在 ProcessShellCommand 之后发生
// 启用拖/放
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例9: AfxInitRichEdit
BOOL CEasyToonApp::InitInstance()
{
AfxInitRichEdit();
// 標準的な初期化処理
// もしこれらの機能を使用せず、実行ファイルのサイズを小さく
// したければ以下の特定の初期化ルーチンの中から不必要なもの
// を削除してください。
#ifdef _AFXDLL
Enable3dControls(); // 共有 DLL の中で MFC を使用する場合にはここを呼び出してください。
#else
Enable3dControlsStatic(); // MFC と静的にリンクしている場合にはここを呼び出してください。
#endif
// 設定が保存される下のレジストリ キーを変更します。
// 会社名または所属など、適切な文字列に
// 変更してください。
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // 標準の INI ファイルのオプションをロードします (MRU を含む)
// アプリケーション用のドキュメント テンプレートを登録します。ドキュメント テンプレート
// はドキュメント、フレーム ウィンドウとビューを結合するために機能します。
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CEasyToonDoc),
RUNTIME_CLASS(CMainFrame), // メイン SDI フレーム ウィンドウ
RUNTIME_CLASS(CEasyToonView));
AddDocTemplate(pDocTemplate);
// DDE Execute open を使用可能にします。
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// DDE、file open など標準のシェル コマンドのコマンドラインを解析します。
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// コマンドラインでディスパッチ コマンドを指定します。
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// メイン ウィンドウが初期化されたので、表示と更新を行います。
m_pMainWnd->ShowWindow(SW_SHOWNORMAL);
m_pMainWnd->UpdateWindow();
// ドラッグ/ドロップ オープンを許可します
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
示例10: VERIFY
BOOL CNPreApp::InitInstance()
{
CGridCtrlBase::RegisterClass();
VERIFY( AfxInitRichEdit() );
SetRegistryKey(_T("nSights"));
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(CNPreDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CNPreView));
AddDocTemplate(pDocTemplate);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// mView initialization
MviewColorSetup(); // basic color setup
FuncObjC::AddRecalcCallback(RecalcCallback); // add the recalc callback
// mView menu initialization
nPreAppMenu.InitAppData(ID_PULLMENU_START);
MenuRootC::currTreeObj = NULL;
ChangeToHtmlHelp();
// 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();
AppMenuC::SetMenuBarSensitive();
return TRUE;
}
示例11: AfxMessageBox
BOOL CRecalcApp::InitInstance()
{
// WIN32 multi-threading APIs are not available on non-NT versions
// of Windows less than Windows version 4.0.
if ((::GetVersion() & 0x80000000) && (BYTE(::GetVersion()) < 4))
{
AfxMessageBox(IDS_CANNOT_RUN_ON_16BIT_WINDOWS_LT_4);
return FALSE;
}
// Standard initialization
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register document templates
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_RECALCTYPE,
RUNTIME_CLASS(CRecalcDoc),
RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
RUNTIME_CLASS(CRecalcView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) {
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// 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();
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
示例12: AfxMessageBox
BOOL CDrawApp::InitInstance()
{
// Initialize OLE 2.0 libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
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.
Enable3dControls(); // enable 3d controls in dialogs
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(CDrawDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CDrawView));
pDocTemplate->SetContainerInfo(IDR_SEPEDTTYPE_CNTR_IP);
AddDocTemplate(pDocTemplate);
// enable file manager drag/drop and DDE Execute open
EnableShellOpen();
RegisterShellFileTypes();
// simple command line parsing
if (m_lpCmdLine[0] == '\0')
{
// create a new (empty) document
OnFileNew();
}
else
{
// open an existing document
OpenDocumentFile(m_lpCmdLine);
}
m_pMainWnd->DragAcceptFiles();
OnIdle(0); // updates buttons before showing the window
return TRUE;
}
示例13: LoadStdProfileSettings
//***********************************************************************
// Function: CDynaMenuApp::InitInstance()
//
// Purpose:
// InitInstance is called by the framework to perform per-instance
// initialization of the application.
//
// This function is the code generated by AppWizard with one
// exception - we use our own class for the frame window attached
// to a document template, instead of using CMDIChildWnd.
//
// Parameters:
// none
//
// Returns:
// nonzero if successful, otherwise 0
//
// Comments:
// see the CWinApp::InitInstance() documentation for further info.
//
//***********************************************************************
BOOL CDynaMenuApp::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.
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_DYMENUTYPE,
RUNTIME_CLASS(CDynaMenuDoc),
RUNTIME_CLASS(CDynaMDIChildWnd), // our private MDI child class!!
RUNTIME_CLASS(CDynaMenuView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME)){
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// enable file manager drag/drop and 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;
m_pMainWnd->DragAcceptFiles();
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
示例14: AfxMessageBox
BOOL
mfc_boss::InitInstance()
{
if (!AfxOleInit()) { /* all this for richedit... */
AfxMessageBox(IDP_OLE_INIT_FAILED);
return 0;
}
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
SetRegistryKey(m_pszAppName); // AFX_IDS_APP_TITLE, considered IDR_MAINFRAME
LoadStdProfileSettings(10); // Load standard INI file options (including MRU)
mfc_template =
new CMultiDocTemplate(IDR_EDITFRAME,
RUNTIME_CLASS(mfc_edit_doc),
RUNTIME_CLASS(mfc_edit_child),
RUNTIME_CLASS(mfc_edit_view));
AddDocTemplate(mfc_template);
/* create the main window, but don't show it until
* the terminal window or a graphics child window is created
* -- MFC Run method kills process if no main window */
CMDIFrameWnd* fw = new mfc_frame_wnd;
if (!fw->LoadFrame(IDR_MAINFRAME)) return 0;
m_pMainWnd = fw;
m_pMainWnd->DragAcceptFiles();
EnableShellOpen();
RegisterShellFileTypes(0); /* do not register for printing */
/* some command line stuff needs to be merged with w_init... */
CCommandLineInfo cmd_info;
ParseCommandLine(cmd_info);
/* prevent opening an empty untitled document at startup */
if (cmd_info.m_nShellCommand == CCommandLineInfo::FileNew)
cmd_info.m_nShellCommand = CCommandLineInfo::FileNothing;
if (!ProcessShellCommand(cmd_info)) return 0;
the_worker=
AfxBeginThread(RUNTIME_CLASS(mfc_worker), THREAD_PRIORITY_BELOW_NORMAL);
return 1;
}
示例15: AfxEnableControlContainer
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;
}