当前位置: 首页>>代码示例>>C++>>正文


C++ AfxEnableControlContainer函数代码示例

本文整理汇总了C++中AfxEnableControlContainer函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxEnableControlContainer函数的具体用法?C++ AfxEnableControlContainer怎么用?C++ AfxEnableControlContainer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AfxEnableControlContainer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CSingleDocTemplate

BOOL CFaceEncryptApp::InitInstance()
{
    //AfxMessageBox("InitInstance()");
	{	// BLOCK: doc template registration
		// Register the document template.  Document templates serve
		// as the connection between documents, frame windows and views.
		// Attach this form to another document or frame window by changing
		// the document or frame class in the constructor below.
		CSingleDocTemplate* pNewDocTemplate = new CSingleDocTemplate(
			IDR_CHOOSEOPERATION_TMPL,
			RUNTIME_CLASS(CFaceEncryptDoc),		// document class
			RUNTIME_CLASS(CMainFrame),		// frame class
			RUNTIME_CLASS(CChooseOperation));		// view class
		AddDocTemplate(pNewDocTemplate);
	}

	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(CFaceEncryptDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CFaceEncryptView));
	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;

	// The one and only window has been initialized, so show and update it.
	m_pMainWnd->ShowWindow(SW_SHOW);
	m_pMainWnd->UpdateWindow();

	// Enable drag/drop open
	m_pMainWnd->DragAcceptFiles();
	return TRUE;
}
开发者ID:zephyrer,项目名称:faceencrypt,代码行数:67,代码来源:FaceEncrypt.cpp

示例2: sizeof

BOOL CCheckExamApp::InitInstance()
{
	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControlsEx()。  否则,将无法创建窗口。
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 将它设置为包括所有要在应用程序中使用的
	// 公共控件类。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinApp::InitInstance();


	AfxEnableControlContainer();

	// 创建 shell 管理器,以防对话框包含
	// 任何 shell 树视图控件或 shell 列表视图控件。
	CShellManager *pShellManager = new CShellManager;

	// 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题
	CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));

	// 标准初始化
	// 如果未使用这些功能并希望减小
	// 最终可执行文件的大小,则应移除下列
	// 不需要的特定初始化例程
	// 更改用于存储设置的注册表项
	// TODO: 应适当修改该字符串,
	// 例如修改为公司或组织名
	SetRegistryKey(_T("应用程序向导生成的本地应用程序"));

	CCheckExamDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: 在此放置处理何时用
		//  “确定”来关闭对话框的代码
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: 在此放置处理何时用
		//  “取消”来关闭对话框的代码
	}
	else if (nResponse == -1)
	{
		TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
		TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
	}

	// 删除上面创建的 shell 管理器。
	if (pShellManager != NULL)
	{
		delete pShellManager;
	}

	// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
	//  而不是启动应用程序的消息泵。
	return FALSE;
}
开发者ID:kevin12125,项目名称:Exam-mark,代码行数:62,代码来源:Check+Exam.cpp

示例3: ParseCommandLine

BOOL CFPAnalysisApp::InitInstance()
{
		// CG: The following block was added by the Splash Screen component.
\
	{
\
		CCommandLineInfo cmdInfo;
\
		ParseCommandLine(cmdInfo);
\

\
		CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
\
	}
		
	AfxEnableControlContainer();
	//m_dlgSkin.Create(IDD_SKINDIALOG_DIALOG);
    //m_pSkin = m_dlgSkin.GetDlgItem(IDC_SKIN2)->GetControlUnknown(); 

	//m_dlgAgent.Create(IDD_AGENT_DIALOG);
    //m_theAgent.Probe(&m_dlgAgent.m_Agent);


	// 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("Fingerprint Analysis 1.00"));

	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.

	CMultiDocTemplate* pDocTemplate;
	pDocTemplate = new CMultiDocTemplate(
		IDR_FPANALTYPE,
		RUNTIME_CLASS(CFPAnalysisDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CFPAnalysisView));
	AddDocTemplate(pDocTemplate);

	EnableShellOpen(); 

	// create main MDI Frame window
	CMainFrame* pMainFrame = new CMainFrame;
	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
		return FALSE;
	m_pMainWnd = pMainFrame;

	//Drag & Drop support
	m_pMainWnd->DragAcceptFiles();
	
	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// no new document at start-up
	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->ShowWindow(m_nCmdShow);
	pMainFrame->CenterWindow();
	pMainFrame->UpdateWindow();
	pMainFrame->SetTitle("Fingerprint Analysis");


	return TRUE;
}
开发者ID:Flora0409,项目名称:fingerprint-analysis,代码行数:85,代码来源:FPAnalysis.cpp

示例4: AfxEnableControlContainer

BOOL CLibraryApp::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)

	//Login Dialog
	CLoginDlg cLoginDlg;

	/*
	if(cLoginDlg.DoModal() != IDOK)
		return false;
	*/

	// 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(CLibraryDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CLibraryView));
	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;

	if(!cLoginDlg.IsUserType())
	{
		CMenu *menu = m_pMainWnd->GetMenu();
		menu->DeleteMenu(0,MF_BYPOSITION);
		m_pMainWnd->DrawMenuBar();				//ÖØ»æ²Ëµ¥À¸
	}

	// The one and only window has been initialized, so show and update it.
	m_pMainWnd->ShowWindow(SW_SHOW);
	m_pMainWnd->UpdateWindow();

	return TRUE;
}
开发者ID:zerxon,项目名称:library,代码行数:62,代码来源:Library.cpp

示例5: AfxEnableControlContainer

BOOL CApp::InitInstance()
{
	if(!CDCGFApp::InitInstance()) 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("DEAD:CODE"));

	LoadStdProfileSettings(8);  // Load standard INI file options (including MRU)

	CDCGFStringTable::Init();

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CMultiDocTemplate* pDocTemplate;
	pDocTemplate = new CMultiDocTemplate(
		IDR_PROJECTYPE,
		RUNTIME_CLASS(CProjectDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CProjectView));
	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();

	// This code replaces the MFC created menus with 
	// the Ownerdrawn versions 
	static UINT toolbars[]={
		IDR_MAINFRAME, IDR_TOOLBAR_2
	};	
	pDocTemplate->m_hMenuShared=pMainFrame->NewMenu(IDR_PROJECTYPE, toolbars, 2);
	pMainFrame->m_hMenuDefault=pMainFrame->NewDefaultMenu(IDR_MAINFRAME, toolbars, 2);
/*
	CDCGFStringTable::LocMenu(CMenu::FromHandle(pMainFrame->m_hMenuDefault));
	CDCGFStringTable::LocMenu(CMenu::FromHandle(pDocTemplate->m_hMenuShared));
*/
	// This simulates a window being opened if you don't have
	// a default window displayed at startup
	pMainFrame->OnUpdateFrameMenu(pMainFrame->m_hMenuDefault);


	// Enable DDE Execute open
	EnableShellOpen();
	RegisterShellFileTypes(FALSE);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	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;

	// The main window has been initialized, so show and update it.
	pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
	pMainFrame->UpdateWindow();

	if(cmdInfo.m_nShellCommand == CCommandLineInfo::FileNothing)
	{
		DoSomeNagging();

		if(GetRegInt(HKEY_CURRENT_USER, DCGF_TOOLS_REG_PATH, "AutoCheckUpdates", 1))
		{
			pMainFrame->CheckForUpdates(true);
		}
	}

	pMainFrame->UpdateMenuURL(pMainFrame->GetMenu());


	return TRUE;
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:98,代码来源:ProjectMan.cpp

示例6: CheckUpgrade


//.........这里部分代码省略.........
		}
		return FALSE;
	}
	if (CAppUtils::GetMsysgitVersion() < 0x01070a00)
	{
		int ret = CMessageBox::ShowCheck(NULL, IDS_PROC_OLDMSYSGIT, IDS_APPNAME, 1, IDI_EXCLAMATION, IDS_PROC_GOTOMSYSGITWEBSITE, IDS_ABORTBUTTON, IDS_IGNOREBUTTON, _T("OldMsysgitVersionWarning"), IDS_PROC_NOTSHOWAGAINIGNORE);
		if (ret == 1)
		{
			CMessageBox::RemoveRegistryKey(_T("OldMsysgitVersionWarning")); // only store answer if it is "Ignore"
			ShellExecute(NULL, NULL, _T("http://code.google.com/p/msysgit/"), NULL, NULL, SW_SHOW);
			return FALSE;
		}
		else if (ret == 2)
		{
			CMessageBox::RemoveRegistryKey(_T("OldMsysgitVersionWarning")); // only store answer if it is "Ignore"
			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.

	INITCOMMONCONTROLSEX used = {
		sizeof(INITCOMMONCONTROLSEX),
			ICC_ANIMATE_CLASS | ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_DATE_CLASSES |
			ICC_HOTKEY_CLASS | ICC_INTERNET_CLASSES | ICC_LISTVIEW_CLASSES |
			ICC_NATIVEFNTCTL_CLASS | ICC_PAGESCROLLER_CLASS | ICC_PROGRESS_CLASS |
			ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS |
			ICC_USEREX_CLASSES | ICC_WIN95_CLASSES
	};
	InitCommonControlsEx(&used);
	AfxOleInit();
	AfxEnableControlContainer();
	AfxInitRichEdit2();
	CWinAppEx::InitInstance();
	SetRegistryKey(_T("TortoiseGit"));
	AfxGetApp()->m_pszProfileName = _tcsdup(_T("TortoiseProc")); // w/o this ResizableLib will store data under TortoiseGitProc which is not compatible with older versions

	CCmdLineParser parser(AfxGetApp()->m_lpCmdLine);

	hWndExplorer = NULL;
	CString sVal = parser.GetVal(_T("hwnd"));
	if (!sVal.IsEmpty())
		hWndExplorer = (HWND)_ttoi64(sVal);

	while (GetParent(hWndExplorer)!=NULL)
		hWndExplorer = GetParent(hWndExplorer);
	if (!IsWindow(hWndExplorer))
	{
		hWndExplorer = NULL;
	}

	// if HKCU\Software\TortoiseGit\Debug is not 0, show our command line
	// in a message box
	if (CRegDWORD(_T("Software\\TortoiseGit\\Debug"), FALSE)==TRUE)
		AfxMessageBox(AfxGetApp()->m_lpCmdLine, MB_OK | MB_ICONINFORMATION);

	if ( parser.HasKey(_T("path")) && parser.HasKey(_T("pathfile")))
	{
		CMessageBox::Show(NULL, IDS_ERR_INVALIDPATH, IDS_APPNAME, MB_ICONERROR);
		return FALSE;
	}

	CTGitPath cmdLinePath;
	CTGitPathList pathList;
开发者ID:mirror,项目名称:TortoiseGit,代码行数:67,代码来源:TortoiseProc.cpp

示例7: sizeof

BOOL CWinLauncher2App::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();
    AfxEnableControlContainer();

    // Create the shell manager, in case the dialog contains
    // any shell tree view or shell list view controls.
    CShellManager *pShellManager = new CShellManager;

    // Activate "Windows Native" visual manager for enabling themes in MFC controls
    CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));

    // Set CWinApp default registry key. Must be consistent with all apps using findjava2.
    SetRegistryKey(_T("Android-FindJava2"));

    // Use VERSIONINFO.FileDescription as the canonical app name
    initUtils(NULL);

    CLauncherCmdLineInfo cmdLine;
    ParseCommandLine(cmdLine);

    if (cmdLine.mDoHelp) {
        const TCHAR *msg =
            _T("WinLauncher2 [/7|/f|/h]\r\n")
            _T("/7 : Requires Java 1.7 instead of 1.6\r\n")
            _T("/f : Force UI\r\n")
            _T("/h : Help\r\n");
            AfxMessageBox(msg);
        return FALSE; // quit without starting MFC app msg loop
    }

    CJavaFinder javaFinder(JAVA_VERS_TO_INT(1, cmdLine.mDoJava1_7 ? 7 : 6));
    CJavaPath javaPath = javaFinder.getRegistryPath();
    if (cmdLine.mDoForceUi || javaPath.isEmpty()) {
        javaPath.clear();

        CFindJava2Dlg dlg;
        dlg.setJavaFinder(&javaFinder);
        m_pMainWnd = &dlg;
        INT_PTR nResponse = dlg.DoModal();

        if (nResponse == IDOK) {
            // Use choice selected by user and save in registry.
            javaPath = dlg.getSelectedPath();
            javaFinder.setRegistryPath(javaPath);
        } else if (nResponse == IDCANCEL) {
            // Canceled by user, exit silently.
        } else if (nResponse == -1) {
            TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n");
        }
    }

    if (!javaPath.isEmpty()) {
        // TODO actually launch configured app instead of just printing path.
        CString msg(_T("PLACEHOLDER TODO run app using "));
        msg.Append(javaPath.mPath);
        AfxMessageBox(msg);
    }

    // Delete the shell manager created above.
    if (pShellManager != NULL) {
        delete pShellManager;
    }

    // Since the dialog has been closed, return FALSE so that we exit the
    // application, rather than start the application's message pump.
    return FALSE;
}
开发者ID:MIPS,项目名称:sdk,代码行数:77,代码来源:WinLauncher2App.cpp

示例8: LoadLibrary

BOOL KSceneEditorApp::InitInstance()
{
    BOOL                        bResult             = false;
	BOOL                        bRetCode            = false;
	HRESULT                     hr                  = E_FAIL;
    char*                       pszRetCWD           = NULL;
    IRecorderFactory*           piRecorderFactory   = NULL;
    CMultiDocTemplate*          pDocTemplate        = NULL;
    MFCFramework::CMainFrame*   pMainFrame    = NULL;
    KGLOG_PARAM                 LogParam;
    char                        szCWD[MAX_PATH];
    CCommandLineInfo            cmdInfo;

    //使用Dummper
    m_hDummperModule = LoadLibrary(_T("dumper.dll"));

    pszRetCWD = getcwd(szCWD, sizeof(szCWD));
    KGLOG_PROCESS_ERROR(pszRetCWD);

	g_SetRootPath();

    g_SetFindFileMode(TRUE);
    g_SetFilePath("");
    g_LoadPackageFiles("config.ini", "PackFile");

	memset(&LogParam, 0, sizeof(LogParam));
	snprintf(LogParam.szPath,sizeof(LogParam.szPath),"%s\\logs",szCWD);
	LogParam.szPath[sizeof(LogParam.szPath) - 1] = '\0';

	strcpy(LogParam.szIdent, "SceneEditor");
	LogParam.nMaxLineEachFile = 65536;
	LogParam.Options = (KGLOG_OPTIONS)KGLOG_OPTION_FILE;

	bRetCode = KGLogInit(LogParam, NULL);
    KGLOG_PROCESS_ERROR(bRetCode);
    m_bLogInitFlag = true;

    bRetCode = KMemory::Initialize("SceneEditor.memory");
    KGLOG_PROCESS_ERROR(bRetCode);
    m_bMemoryInitFlag = true;

	g_cEditorDirectory.Load();

	{
		TCHAR AppDir[256] = {0};
		GetCurrentDirectory(256, AppDir);
		wsprintf(g_szDefWorkDirectory,"%s\\",AppDir);
		wsprintf(g_szDefExeDirectory,"%s\\",AppDir);
	}

	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.

	// 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(10);  // 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.

	
	pDocTemplate = new CMultiDocTemplate(
		IDR_SCENEETYPE,
		RUNTIME_CLASS(KSceneEditorDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(KSceneEditorView));
	pDocTemplate->SetContainerInfo(IDR_SCENEETYPE_CNTR_IP);
	AddDocTemplate(pDocTemplate);

	pDocTemplate = new CMultiDocTemplate(
		IDR_MESHETYPE,
		RUNTIME_CLASS(KSceneModelEditorDoc),
		RUNTIME_CLASS(KSceneModelEditorFrameWnd), // custom MDI child frame
		RUNTIME_CLASS(KSceneModelEditorView));
	pDocTemplate->SetContainerInfo(IDR_SCENEETYPE_CNTR_IP);
	AddDocTemplate(pDocTemplate);

	pDocTemplate = new CMultiDocTemplate(
		IDS_OBJECTTYPE,
		RUNTIME_CLASS(KSceneObjectEditorDoc),
		RUNTIME_CLASS(KSceneObjectEditorFrameWnd), // custom MDI child frame
		RUNTIME_CLASS(KSceneObjectEditorView));
	pDocTemplate->SetContainerInfo(IDR_SCENEETYPE_CNTR_IP);
	AddDocTemplate(pDocTemplate);

	pDocTemplate = new CMultiDocTemplate(
		IDR_SFXEDITOR,
		RUNTIME_CLASS(KSceneSFXEditorDoc),
		RUNTIME_CLASS(KSceneSFXEditorFrame), // custom MDI child frame
		RUNTIME_CLASS(KSceneSFXEditorView));
	pDocTemplate->SetContainerInfo(IDR_SFXEDITOR);
	AddDocTemplate(pDocTemplate);

//.........这里部分代码省略.........
开发者ID:viticm,项目名称:pap2,代码行数:101,代码来源:SceneEditor.cpp

示例9: AfxMessageBox

BOOL CRemoteMediaClientApp::InitInstance()
{
    if (!cmVLPLogStartup(_T("RMCRunning.log")))
    {
        AfxMessageBox(IDS_INITLOGMODERR, MB_OK | MB_ICONWARNING);
    }

	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 将它设置为包括所有要在应用程序中使用的
	// 公共控件类。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinApp::InitInstance();


	AfxEnableControlContainer();

	// 创建 shell 管理器,以防对话框包含
	// 任何 shell 树视图控件或 shell 列表视图控件。
	CShellManager *pShellManager = new CShellManager;

	// 标准初始化
	// 如果未使用这些功能并希望减小
	// 最终可执行文件的大小,则应移除下列
	// 不需要的特定初始化例程
	// 更改用于存储设置的注册表项
	// TODO: 应适当修改该字符串,
	// 例如修改为公司或组织名
	SetRegistryKey(_T("UBiTerSoft\\RemoteMedia"));

	CRemoteMediaClientDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: 在此放置处理何时用
		//  “确定”来关闭对话框的代码
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: 在此放置处理何时用
		//  “取消”来关闭对话框的代码
	}

	// 删除上面创建的 shell 管理器。
	if (pShellManager != NULL)
	{
		delete pShellManager;
	}

    cmVLPLogShutdown();

	// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
	//  而不是启动应用程序的消息泵。
	return FALSE;
}
开发者ID:a524631266,项目名称:Ongoing-Study,代码行数:61,代码来源:RemoteMediaClient.cpp

示例10: sizeof

BOOL CAVTCameraManipulateApp::InitInstance()
{
	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 将它设置为包括所有要在应用程序中使用的
	// 公共控件类。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinApp::InitInstance();

	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}


	AfxEnableControlContainer();

	// 创建 shell 管理器,以防对话框包含
	// 任何 shell 树视图控件或 shell 列表视图控件。
	CShellManager *pShellManager = new CShellManager;

	// 标准初始化
	// 如果未使用这些功能并希望减小
	// 最终可执行文件的大小,则应移除下列
	// 不需要的特定初始化例程
	// 更改用于存储设置的注册表项
	// TODO: 应适当修改该字符串,
	// 例如修改为公司或组织名
	SetRegistryKey(_T("应用程序向导生成的本地应用程序"));

	vmbError = VmbStartup();
	if (VmbErrorSuccess !=  vmbError)
	{
		AfxMessageBox(_T("Vimba Startup Error!"));
	}

	CAVTCameraManipulateDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: 在此放置处理何时用
		//  “确定”来关闭对话框的代码
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: 在此放置处理何时用
		//  “取消”来关闭对话框的代码
	}

	// 删除上面创建的 shell 管理器。
	if (pShellManager != NULL)
	{
		delete pShellManager;
	}


	// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
	//  而不是启动应用程序的消息泵。
	return FALSE;
}
开发者ID:fecite,项目名称:AVT,代码行数:67,代码来源:AVTCameraManipulate.cpp

示例11: sizeof

BOOL CbaltoshopApp::InitInstance()
{
	// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
	// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다. 
	// InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다.
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록
	// 이 항목을 설정하십시오.
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinAppEx::InitInstance();

	// OLE 라이브러리를 초기화합니다.
	if (!AfxOleInit())
	{
		AfxMessageBox(IDP_OLE_INIT_FAILED);
		return FALSE;
	}
	AfxEnableControlContainer();
	// 표준 초기화
	// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
	// 아래에서 필요 없는 특정 초기화
	// 루틴을 제거해야 합니다.
	// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
	// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
	// 적절한 내용으로 수정해야 합니다.
	SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
	LoadStdProfileSettings(4);  // MRU를 포함하여 표준 INI 파일 옵션을 로드합니다.

	InitContextMenuManager();

	InitKeyboardManager();

	InitTooltipManager();
	CMFCToolTipInfo ttParams;
	ttParams.m_bVislManagerTheme = TRUE;
	theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
		RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);

	// 응용 프로그램의 문서 템플릿을 등록합니다. 문서 템플릿은
	//  문서, 프레임 창 및 뷰 사이의 연결 역할을 합니다.
	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CbaltoshopDoc),
		RUNTIME_CLASS(CMainFrame),       // 주 SDI 프레임 창입니다.
		RUNTIME_CLASS(CbaltoshopView));
	if (!pDocTemplate)
		return FALSE;
	AddDocTemplate(pDocTemplate);



	// 표준 셸 명령, 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 후에 이러한 호출이 발생해야 합니다.
	return TRUE;
}
开发者ID:shepherd44,项目名称:bitstudy,代码行数:72,代码来源:baltoshop.cpp

示例12: CloseHandle

BOOL CHeavenShadowApp::InitInstance()
{
	//////////////////////////////////////////////////////////////////////////


	HANDLE hMutex = ::CreateMutexW(NULL,TRUE,HS_ONLY_ONE_PROCESS);
	if (GetLastError() == ERROR_ALREADY_EXISTS)
	{
		::MessageBox(
			NULL,
			L"您已经运行了天影卫士!",
			L"天影卫士",
			0
			);	//弹出对话框确认不能运行第二个实例。

		CloseHandle(hMutex);
		ExitProcess(0);
	}

	if (HsIs64BitWindows() == TRUE && sizeof(ULONG_PTR) == sizeof(ULONG32))
	{
		::MessageBox(
			NULL,
			L"您在使用 64 位的 Windows 操作系统。运行天影卫士 32 位版\r\n可能会造成不可预料的后果。敬请选择天影卫士 64 位版。",
			L"天影卫士",
			0
			);
		ExitProcess(0);
	}

	//////////////////显示Splash,2010-10-15///////////////////////////////////
	CWzdSplash wndSplash;                 //创建启动窗口类的实例
	wndSplash.Create(IDB_BITMAP_WZDSPLASH);
	wndSplash.CenterWindow();
	wndSplash.UpdateWindow();          //send WM_PAINT


	//////////////////////////////////////////////////////////////////////////

	//////////////////////////////////////////////////////////////////////////

	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 将它设置为包括所有要在应用程序中使用的
	// 公共控件类。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinApp::InitInstance();


	AfxEnableControlContainer();

	// 创建 shell 管理器,以防对话框包含
	// 任何 shell 树视图控件或 shell 列表视图控件。
	CShellManager *pShellManager = new CShellManager;

	// 标准初始化
	// 如果未使用这些功能并希望减小
	// 最终可执行文件的大小,则应移除下列
	// 不需要的特定初始化例程
	// 更改用于存储设置的注册表项
	// TODO: 应适当修改该字符串,
	// 例如修改为公司或组织名
	SetRegistryKey(_T("天影卫士"));


	//////////////////////////////////////////////////////////////////////////

	// 	WCHAR *Temp = AfxGetApp()->m_lpCmdLine;
	// 
	// 	BOOL bIsHideWnd = FALSE;
	// 
	// 	if (wcslen(Temp))
	// 	{
	// 		WCHAR* p = Temp;
	// 
	// 		for (int i = 0; i< wcslen(Temp); i++)
	// 		{
	// 			if (_wcsnicmp(p,L"-HideWnd",wcslen(L"-HideWnd"))==0)
	// 			{
	// 				bIsHideWnd = TRUE;
	// 			}
	// 			p++;
	// 		}
	// 	}

	// 	CHeavenShadowDlg* dlg = new CHeavenShadowDlg();
	// 
	// 	m_pMainWnd = dlg;
	// 
	// 	INT_PTR nResponse = dlg->Create(IDD_HEAVENSHADOW_DIALOG);
	// 
	// 	dlg->ShowWindow(SW_HIDE);
	// 
	// 	return FALSE;

//.........这里部分代码省略.........
开发者ID:ChengChengCC,项目名称:Ark-tools,代码行数:101,代码来源:HeavenShadow.cpp

示例13: sizeof

BOOL CGraphShowerApp::InitInstance()
{
	// 如果一个运行在 Windows XP 上的应用程序清单指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
	//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 将它设置为包括所有要在应用程序中使用的
	// 公共控件类。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	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(CGraphShowerDoc),
		RUNTIME_CLASS(CMainFrame),       // 主 SDI 框架窗口
		RUNTIME_CLASS(CGraphShowerView));
	if (!pDocTemplate)
		return FALSE;
	AddDocTemplate(pDocTemplate);

	//------------------------------------------------------------------------------
	// GDI+图像库初始化
	GdiplusStartup(&m_GdiplusToken, &m_GdiplusStartupInput, NULL);
	//------------------------------------------------------------------------------

	// 分析标准外壳命令、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  之后发生
	return TRUE;
}
开发者ID:ptthisdan,项目名称:DIPVC,代码行数:64,代码来源:GraphShower.cpp

示例14: SetRegistryKey

BOOL CPBXClientApp::InitInstance()
{
	
	// 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(REG_KEY_APP);

	CString lang = GetProfileString("Settings", "Language", "");
	SetLanguage(lang);
	   
	CString cmdLine = this->m_lpCmdLine;

	HWND hwnd = FindWindow(NULL, _T("BSOC Main Application Window"));

	m_bShellOpenFile = FALSE;	
	m_bAllowCmdLineOriginate = 1;	
	m_bDeveloperVersion = TRUE;

	if (cmdLine.Left(9).MakeLower()=="originate") {
		Semaphore s(ORIGINATE_FILE_MUTEX);
		CStdioFile debugFile(::theApp.GetInstallDir()+"\\originate.tmp", CFile::modeCreate | CFile::modeWrite);
		debugFile.SeekToEnd();
		debugFile.WriteString(cmdLine);
		debugFile.Close();		
		return TRUE;
	}	

	if (hwnd!=NULL) { //only one instance of OutCALL can be run		
		CString str;
		str.Format(_("%s is already running."), APP_NAME);
		MessageBox(NULL, str, APP_NAME, MB_ICONINFORMATION | MB_OK);
		return FALSE;
	}

	WSADATA		WSAData = { 0 };
	if ( 0 != WSAStartup( WSA_VERSION, &WSAData ) )
	{
		// Tell the user that we could not find a usable
		// WinSock DLL.
		if ( LOBYTE( WSAData.wVersion ) != LOBYTE(WSA_VERSION) ||
			 HIBYTE( WSAData.wVersion ) != HIBYTE(WSA_VERSION) )
			 ::MessageBox(NULL, _("Incorrect version of WS2_32.dll found."), APP_NAME, MB_OK | MB_ICONERROR);

		WSACleanup( );
		return FALSE;
	}	
	

	if (_tcscmp(this->m_lpCmdLine, _T("background"))==0) {
		Sleep(10000);
	} else if (cmdLine!="") {
		m_bShellOpenFile = TRUE;
		ReadConfigFile(cmdLine);		
	}

	AfxOleInit();
	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

	CMainFrame* pFrame = new CMainFrame;
	m_pMainWnd = pFrame;

	pFrame->CreateDatabaseTable("RecivedCalls", "CREATE TABLE RecivedCalls(Date TEXT, Time TEXT, Callee TEXT, CallerID TEXT, Sec NUMERIC)");
	pFrame->CreateDatabaseTable("PlacedCalls", "CREATE TABLE PlacedCalls(Date TEXT, Time TEXT, Callee TEXT, CallerID TEXT, Sec NUMERIC)");
	pFrame->CreateDatabaseTable("MissedCalls", "CREATE TABLE MissedCalls(NewCall NUMERIC, Date TEXT, Time TEXT, Callee TEXT, CallerID TEXT, Sec NUMERIC)");
	pFrame->CreateDatabaseTable("Contacts", "CREATE TABLE Contacts(Title TEXT, FirstName TEXT, MiddleName TEXT, LastName TEXT, Suffix TEXT, CompanyName TEXT, Assistant TEXT, Business TEXT, Business2 TEXT, BusinessFax TEXT, Callback TEXT, Car TEXT, Company TEXT, Home TEXT, Home2 TEXT, HomeFax TEXT, ISDN TEXT, Mobile TEXT, Other TEXT, OtherFax TEXT, Pager TEXT, PrimaryTel TEXT, Radio TEXT, Telex TEXT, TTYTDD TEXT)");

	// create and load the frame with its resources
	int left = (GetSystemMetrics(SM_CXSCREEN)-500)/2;	
	int top = (GetSystemMetrics(SM_CYSCREEN)-500)/2;
	

	pFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW | WS_MINIMIZE | FWS_ADDTOTITLE, NULL,
		NULL);
	pFrame->MoveWindow(left, top, left+500, top+500);


	// The one and only window has been initialized, so show and update it.
	pFrame->ShowWindow(SW_HIDE);
	pFrame->UpdateWindow();

	//pFrame->SetWindowPos(&pFrame->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
	this->m_pMainWnd = pFrame;	
		
	// To create the main window, this code creates a new frame window
	// object and then sets it as the application's main window object.

	IntegrateIntoOutlook();
//.........这里部分代码省略.........
开发者ID:BradZA,项目名称:outcall,代码行数:101,代码来源:PBXClient.cpp

示例15: AfxEnableControlContainer

BOOL CVecDemoApp::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.
    if (!AfxOleInit())
    {
        AfxMessageBox("Ole Initialization Failed");
        return FALSE;
    }   

   HDC hdc=GetDC(NULL);
   ASSERT(hdc!=NULL);
   int bpp = GetDeviceCaps(hdc, BITSPIXEL);
   ReleaseDC(NULL, hdc);
   if(bpp <= 8)
   {
      AfxMessageBox("This application requires more then 256 colors.");
      return FALSE;
   }


#if _MSC_VER<8
#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("Monfort Software"));

	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(CVecDemoDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CVecDemoView));
	AddDocTemplate(pDocTemplate);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

   // main frame will not show itself on creation
   m_nCmdShow = SW_HIDE;

	// Dispatch commands specified on the command line
   BOOL bFileOpen = FALSE;
   if(cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen)
   {
      cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
      bFileOpen = TRUE;
   }
   
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;


   ((CMainFrame*)m_pMainWnd)->LoadWorkspace();

   // show the main frame with the size that we loded from the registery
   m_pMainWnd->ShowWindow(m_nCmdShow);
	m_pMainWnd->UpdateWindow();
	

   if(bFileOpen)
   {
      POSITION pos = pDocTemplate->GetFirstDocPosition();
      pDocTemplate->GetNextDoc(pos)->OnOpenDocument(cmdInfo.m_strFileName);
   }
   else
   {
	  POSITION pos = pDocTemplate->GetFirstDocPosition();
	  CVecDemoDoc* pAlbDoc = (CVecDemoDoc*)pDocTemplate->GetNextDoc(pos);
	  pos = pAlbDoc->GetFirstViewPosition();
	  CVecDemoView* pVecDemoView = (CVecDemoView*) pAlbDoc->GetNextView(pos);
	  pVecDemoView->ClearDocument();

   }
   return TRUE;
}
开发者ID:monfort,项目名称:VecEngine,代码行数:93,代码来源:VecDemo.cpp


注:本文中的AfxEnableControlContainer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。