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


C++ CAppModule::Term方法代码示例

本文整理汇总了C++中CAppModule::Term方法的典型用法代码示例。如果您正苦于以下问题:C++ CAppModule::Term方法的具体用法?C++ CAppModule::Term怎么用?C++ CAppModule::Term使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAppModule的用法示例。


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

示例1: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpstrCmdLine*/, int /*nCmdShow*/)
{
	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);	// add flags to support other controls

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	int nRet = 0;
	// BLOCK: Run application
	{
		CMainDlg dlgMain;
		nRet = dlgMain.DoModal();
	}

	_Module.Term();
	::CoUninitialize();

	return nRet;
}
开发者ID:BBLN,项目名称:VirtualKD,代码行数:25,代码来源:vminstall.cpp

示例2: DllMain

BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH) {
		hInstance = hInst;
		HRESULT hRes = ::CoInitialize(NULL);
	// If you are running on NT 4.0 or higher you can use the following call instead to 
	// make the EXE free threaded. This means that calls come in on a random RPC thread.
	//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
		ATLASSERT(SUCCEEDED(hRes));

	#if 0
		INITCOMMONCONTROLSEX iccx;
		iccx.dwSize = sizeof(iccx);
		iccx.dwICC = ICC_BAR_CLASSES|ICC_PROGRESS_CLASS ;	// change to support other controls
		BOOL bRet = ::InitCommonControlsEx(&iccx);
		bRet;
		ATLASSERT(bRet);
	#else
		::InitCommonControls();
	#endif

		hRes = _Module.Init(NULL, hInstance);

        V2::GUI::Initialize(); // 4 gdiplus 

		ATLASSERT(SUCCEEDED(hRes));
	}	else if(dwReason == DLL_PROCESS_DETACH) {

        V2::GUI::Uninitialize(); // 4 gdiplus

		_Module.Term();
		::CoUninitialize();
	}
	return 1;
}
开发者ID:Ambrevar,项目名称:fr_public,代码行数:35,代码来源:vstiext.cpp

示例3: _tWinMain

/**
 * @brief Application entry point.
 * @param hInstance - Handle to the current instance of the application.
 * @param hPrevInstance - Handle to the previous instance of the application. This parameter is always NULL.
 * @param pszCmdLine - Pointer to a null-terminated string specifying the command line for the application, excluding the program name.
 * @param nCmdShow - Specifies how the window is to be shown.
 */
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, PTSTR pszCmdLine, int nCmdShow)
{
#ifdef _CRTDBG_MAP_ALLOC
	// Watch for memory leaks.
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	HRESULT hRes = OleInitialize(NULL);
	ATLASSERT(SUCCEEDED(hRes));

	// This resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used.
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES);	// Add flags to support other controls.

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	int nRet = Run(pszCmdLine, nCmdShow);

	_Module.Term();
	OleUninitialize();

	return nRet;
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:32,代码来源:CrashExplorer.cpp

示例4: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
#if 0
	MessageBox(NULL, "attach debugger", "tips", IDOK);
#endif
	//Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA).
	HRESULT hRes = ::CoInitialize(NULL);
	ATLASSERT(SUCCEEDED(hRes));

	// Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL.
	// An application must call this function before creating a common control.
	AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);

	hRes = _Module.Init(NULL, hInstance);

	int nRet = Run(lpstrCmdLine, nCmdShow);

	_Module.Term();

	//Closes the COM library on the current thread, unloads all DLLs loaded by the thread, 
	//frees any other resources that the thread maintains, and forces all RPC connections on the thread to close.
	::CoUninitialize();

	return nRet;
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例5: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
	HRESULT hRes = ::CoInitialize(NULL);
	Gdiplus::GdiplusStartupInput gdiplusStartupInput;

	ULONG_PTR gdiplusToken;
	Gdiplus::GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, NULL );

// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.
//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT( SUCCEEDED(hRes) );
	// in WinMain
	INITCOMMONCONTROLSEX icce;
	icce.dwSize = sizeof(INITCOMMONCONTROLSEX);
	icce.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_USEREX_CLASSES;
	InitCommonControlsEx(&icce);

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc( NULL, 0, 0, 0L );

	AtlInitCommonControls( ICC_BAR_CLASSES );	// add flags to support other controls

	hRes = _Module.Init( NULL, hInstance );
	ATLASSERT( SUCCEEDED(hRes) );

	int nRet = Run( lpstrCmdLine, nCmdShow );

	_Module.Term();
	::CoUninitialize();

	return nRet;
}
开发者ID:vladios13,项目名称:image-uploader,代码行数:33,代码来源:ImageEditor.cpp

示例6: DllMain

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
	// init resource module
	resutils::set_handle((HMODULE)hModule);

	switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			{
			HRESULT hRes = _Module.Init(NULL, (HINSTANCE) hModule);
			ATLASSERT(SUCCEEDED(hRes));	// Don't call important functions inside ASSERT.
			}
			break;
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
			break;
		case DLL_PROCESS_DETACH:
			_Module.Term();
			break;
    }
    return TRUE;
}
开发者ID:mosunovpa,项目名称:Projects,代码行数:25,代码来源:Tasks.cpp

示例7: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
	HRESULT hRes = CMiniPieFrame::ActivatePreviousInstance(hInstance, lpstrCmdLine);

	if(FAILED(hRes) || S_FALSE == hRes)
	{
		return hRes;
	}

	hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	AtlInitCommonControls(ICC_DATE_CLASSES);
	SHInitExtraControls();

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	AtlAxWinInit();

	int nRet = CMiniPieFrame::AppRun(lpstrCmdLine, nCmdShow);

	AtlAxWinTerm();

	_Module.Term();
	::CoUninitialize();

	return nRet;
}
开发者ID:FreeDao,项目名称:ZaoQiBu,代码行数:29,代码来源:MiniPie.cpp

示例8: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpstrCmdLine*/, int /*nCmdShow*/)
{
   HRESULT hRes = ::CoInitialize(NULL);
   ATLASSERT(SUCCEEDED(hRes));

   INITCOMMONCONTROLSEX iccx;
   iccx.dwSize = sizeof(iccx);
   iccx.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
   BOOL bRet = ::InitCommonControlsEx(&iccx);
   bRet;
   ATLASSERT(bRet);

   hRes = _Module.Init(NULL, hInstance);
   ATLASSERT(SUCCEEDED(hRes));

   int nRet;
   {
      CMainDlg dlgMain;
      nRet = dlgMain.DoModal();
   }

   _Module.Term();
   ::CoUninitialize();

   return nRet;
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例9: wWinMain

int WINAPI wWinMain(_In_ HINSTANCE hInstance,
	_In_opt_ HINSTANCE hPrevInstance,
	_In_ PWSTR lpCmdLine,
	_In_ int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);
	if (!CoInitializeSingle::Initialize()){

	}
	HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
	Metro::MUI::muiController.Init();
	_Module.Init(nullptr, hInstance);
	MSG msg;
	::InitCommonControls();
	Metro::MetroWindow iMetroWindow;
	
	RECT rect = { (::GetSystemMetrics(SM_CXSCREEN) - 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) - 450) / 2, (::GetSystemMetrics(SM_CXSCREEN) + 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) + 450) / 2 };
	if (iMetroWindow.Create(nullptr, rect, METRO_INTERNAL_WINDOWLNAME, WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_ACCEPTFILES) == nullptr)
	{
		return -1;
	}
	DWORD dwExit = 0;
	iMetroWindow.ShowWindow(nCmdShow);
	iMetroWindow.UpdateWindow();

	while (GetMessage(&msg, nullptr, 0, 0)>0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	dwExit = iMetroWindow.GetExitCode();
	_Module.Term();
	return dwExit;
}
开发者ID:codepongo,项目名称:iBurnMgr,代码行数:35,代码来源:iBurnMgrStart.cpp

示例10: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
	HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.
//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);	// add flags to support other controls

	//hRes = _Module.Init(NULL, hInstance);
	GUID guid;
	hRes = _Module.Init(NULL,hInstance,&guid);
	ATLASSERT(SUCCEEDED(hRes));

	BkString::Load(IDR_BK_STRING_DEF);
	BkFontPool::SetDefaultFont(BkString::Get(IDS_APP_FONT), -12);
	BkSkin::LoadSkins(IDR_BK_SKIN_DEF);
	BkStyle::LoadStyles(IDR_BK_STYLE_DEF);

	CMainDlg dlgMain;
	dlgMain.DoModal();

	_Module.Term();
	::CoUninitialize();

	return 0;
}
开发者ID:hua3505,项目名称:tinyBrowser,代码行数:31,代码来源:tinyBrowser.cpp

示例11: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpstrCmdLine*/, int /*nCmdShow*/)
{
	HRESULT hRes = ::CoInitialize(NULL);		//初始化COM
// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.
//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);		// add flags to support other controls

	hRes = _Module.Init(NULL, hInstance);		//全局对象_Module被初始化
	ATLASSERT(SUCCEEDED(hRes));

	BkString::Load(IDR_BK_STRING_DEF);			//加载指定资源ID的string定义xml
	BkFontPool::SetDefaultFont(BkString::Get(IDS_APP_FONT), -12);

	BkSkin::LoadSkins(IDR_BK_SKIN_DEF);			//加载指定资源ID的skin定义xml
	BkStyle::LoadStyles(IDR_BK_STYLE_DEF);		//加载指定资源ID的Style定义xml

	int nRet = 0;
	// BLOCK: Run application, 将CMainDlg变量放在一个区块中是很重要的
	{
		CMainDlg dlgMain;
		nRet = dlgMain.DoModal();
	}

	_Module.Term();
	::CoUninitialize();

	return nRet;
}
开发者ID:liguyu,项目名称:cppexample,代码行数:34,代码来源:LoadAging.cpp

示例12: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);

	HRESULT hRes = ::CoInitialize(NULL);
	// If you are running on NT 4.0 or higher you can use the following call instead to
	// make the EXE free threaded. This means that calls come in on a random RPC thread.
	//HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_BAR_CLASSES);	// add flags to support other controls

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	int ret = Run(lpCmdLine);

	_Module.Term();
	::CoUninitialize();

	return ret;
}
开发者ID:mozii,项目名称:weasel,代码行数:28,代码来源:WeaselSetup.cpp

示例13: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
	HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to 
// make the EXE free threaded. This means that calls come in on a random RPC thread.
//	HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
	ATLASSERT(SUCCEEDED(hRes));

	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);

	AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);	// add flags to support other controls
	HINSTANCE hInstRich = ::LoadLibrary(CRichEditCtrl::GetLibraryName());

	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));

	AtlAxWinInit();

	int nRet = 0;
	// BLOCK: Run application
	{
		CBoggleThreadManager mgr;
		nRet = mgr.Run(lpstrCmdLine, nCmdShow);
	}

	_Module.Term();
	::CoUninitialize();

	return nRet;
}
开发者ID:pkrnjevic,项目名称:Boggle,代码行数:31,代码来源:boggle.cpp

示例14: LoadLuaRunTime

extern "C" __declspec(dllexport) void LoadLuaRunTime(char* szInstallDir)
{
	TSTRACEAUTO();
	HRESULT hr = ::CoInitialize(NULL);
	hr = _Module.Init(NULL, gInstance);


	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	CLRTAgent lrtAgent;
	//lrtAgent.InitLua(szInstallDir);
	//g_hXappLuaToolDll = lrtAgent.GetXappLuaToolDllModuleHandle();
	if (lrtAgent.InitLua(szInstallDir))
	{
		TSDEBUG4CXX(_T(">>>>>theLoop.Run()"));
		theLoop.Run();
		TSDEBUG4CXX(_T("<<<<<theLoop.Run()"));
	}
	_Module.RemoveMessageLoop();
	_Module.Term();
	::CoUninitialize();
	TerminateProcess(::GetCurrentProcess(), S_OK);

	return;
}
开发者ID:fanliaokeji,项目名称:lvdun,代码行数:26,代码来源:dllmain.cpp

示例15: WinMain

int __stdcall WinMain(HINSTANCE hinst, HINSTANCE, PSTR cmdLine, int cmdShow)
{
    _Module.Init(0, hinst, 0);

    CMessageLoop msgLoop;
    _Module.AddMessageLoop(&msgLoop);

    int result = -1;

    CMainFrame frame;

    frame.Create(
        ::GetDesktopWindow(),
        CWindow::rcDefault,
        TEXT("Notepad--"));

    if (frame.IsWindow()) {
        frame.ShowWindow(cmdShow);
        result = msgLoop.Run();
    }

    _Module.RemoveMessageLoop();
    _Module.Term();

    return result;
}
开发者ID:YDS19872712,项目名称:Notepad--,代码行数:26,代码来源:main.cpp


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