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


C++ CComModule::Init方法代码示例

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


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

示例1: DllMain

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
#endif
{
	switch (dwReason)
	{
		case DLL_PROCESS_ATTACH:
			_Module.Init(ObjectMap, (HINSTANCE)hInstance, &LIBID_NCSECWLib);
#if !defined(_WIN32_WCE) || !(_WIN32_WCE <= 211)
		    DisableThreadLibraryCalls((HINSTANCE)hInstance);
#endif
			//NCSecwInitInternal();
			break;
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
			// We do the iDWT detach in the main process shutdown.
			// If you add anything here, you may need to remove
			// the call to DisableThreadLibraryCalls() above.
			break;
		case DLL_PROCESS_DETACH:
			_Module.Term();
//For windows CE, must call NCSEcwShutdown from program before it is closes
#if !defined(_WIN32_WCE)
//			if (pNCSEcwInfo) {
//				pNCSEcwInfo->bShutdown = TRUE;
//				NCSecwShutdownInternal();
//			}
#endif
			break;
    }

    return TRUE;
}
开发者ID:makinacorpus,项目名称:libecw,代码行数:32,代码来源:NCSEcw.cpp

示例2: if

extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		::hInstance = hInstance;
		RegisterLineToolTip();
		InitCommonControls();
		RegisterCMHotKey( hInstance );

#ifdef _ACTIVEX
		CMRegisterControl( CM_VERSION );
		_Module.Init(ObjectMap, hInstance);
		DisableThreadLibraryCalls(hInstance);
#endif
	}
	else if (dwReason == DLL_PROCESS_DETACH)
	{
		UnregisterLineToolTip();
		UnregisterCMHotKey( hInstance );
#ifdef _ACTIVEX
		_Module.Term();
		CMUnregisterControl();
#endif
	}
	return 1;   // ok
}
开发者ID:obeoneji,项目名称:light_field_personal,代码行数:26,代码来源:exports.cpp

示例3: DllMain

BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD  dwReason, LPVOID lpReserved)
{
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
#if _MSC_VER <= 1200
		_Module.Init(ObjectMap, hInstance);
		DisableThreadLibraryCalls(hInstance);
#endif
		break;

	case DLL_THREAD_ATTACH:
		break;

	case DLL_THREAD_DETACH:
		break;

	case DLL_PROCESS_DETACH:
#if _MSC_VER <= 1200
	        _Module.Term();
#endif
		break;
	}

	return TRUE;
}
开发者ID:pvginkel,项目名称:wave-notify,代码行数:26,代码来源:DllMain.cpp

示例4: wWinMain

extern "C" int WINAPI wWinMain(HINSTANCE hInstance,
    HINSTANCE /*hPrevInstance*/, __in LPWSTR lpCmdLine, int /*nShowCmd*/)
{
    lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT

    CoInitialize(0);
    _Module.Init( ObjectMap, hInstance, &LIBID_ATLLib );

    ::InitCommonControls();

    RECT rcPos = { CW_USEDEFAULT, 0, 0, 0 };
    HMENU hMenu = LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MENU1));
    HICON hIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON1));

    CWMPHost frame;
    frame.GetWndClassInfo().m_wc.hIcon = hIcon;
    frame.Create(GetDesktopWindow(), rcPos, L"WMP Host Container", 0, 0, (UINT)hMenu);
    frame.ShowWindow(SW_SHOWNORMAL);

    MSG msg;
    while (GetMessage(&msg, 0, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    _Module.Term();
    CoUninitialize();
    return 0;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:29,代码来源:wmphost.cpp

示例5: DllMain

BOOL WINAPI DllMain (HINSTANCE hInstance,
                     DWORD dwReason,
                     LPVOID /*lpReserved*/)
{
	TraceMsg( L"-->DllMain.\n");

	if (dwReason == DLL_PROCESS_ATTACH) {

		TraceMsg( L"   Reason: Attach.\n");

		_Module.Init(ObjectMap, hInstance);

		DisableThreadLibraryCalls(hInstance);
	}
	else if (dwReason == DLL_PROCESS_DETACH) {

		TraceMsg( L"   Reason: Detach.\n");

		   _Module.Term();
	}

	TraceMsg( L"<--DllMain.\n");

	return TRUE;
}
开发者ID:0xhack,项目名称:Windows-driver-samples,代码行数:25,代码来源:dllmain.cpp

示例6: DllMain

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    lpReserved;

#ifdef _MERGE_PROXYSTUB
    if (!PrxDllMain(hInstance, dwReason, lpReserved))
    {
        return FALSE;
    }
#endif

    if (dwReason == DLL_PROCESS_ATTACH)
    {

#ifdef DEBUG_HEAPS
        // turn on leak detection on process exit
        _CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF );
#endif // DEBUG_HEAPS
        
        _Module.Init(ObjectMap, hInstance);
        DisableThreadLibraryCalls(hInstance);
        MSPLOGREGISTER(_T("sampleterm"));

    }
    else if (dwReason == DLL_PROCESS_DETACH)
    {
        MSPLOGDEREGISTER();
        _Module.Term();
    }
    return TRUE;    // ok
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:31,代码来源:pluggable.cpp

示例7: WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT

    HRESULT hRes = CoInitialize(NULL);
    _ASSERTE(SUCCEEDED(hRes));

    _Module.Init(0, hInstance, &LIBID_ATLLib);

	CMainDlg mainDlg;
	g_pMainWin = &mainDlg;

	mainDlg.Create(NULL);
	mainDlg.ShowWindow(SW_SHOW);

    MSG msg;
    while (GetMessage(&msg, 0, 0, 0))
	{
		if (!IsDialogMessage(mainDlg, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

    _Module.Term();
    CoUninitialize();
    return msg.wParam;
}
开发者ID:harrysun2006,项目名称:07_UltraSpy,代码行数:32,代码来源:UltraSpy.cpp

示例8: InitInstance

//------------------------------------------------------------------*
BOOL
    CCSC_OnlineApp::InitInstance()
{
    _Module.Init(ObjectMap, m_hInstance);
    ::InitTrace(m_hInstance,_T("SOFTWARE\\SOFTING\\4ControlV2\\"),_T("CSC_ONLINE"));
	return CWinApp::InitInstance();
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:8,代码来源:CSC_Online.cpp

示例9: CDynLinkLibrary

//
// for MFC initialization
//
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason)
	{
	case DLL_PROCESS_ATTACH:
		_hdllInstance = hInstance;
		if(!AfxInitExtensionModule(DesignCtrSampleDll, hInstance))
			return 0;
		new CDynLinkLibrary(DesignCtrSampleDll);

		_Module.Init(ObjectMap, hInstance);
		//
		registerAppInfo(hInstance);
		DllRegisterServer();
		break;
	
	case DLL_PROCESS_DETACH:
		AfxTermExtensionModule(DesignCtrSampleDll);
		_Module.Term();
		break;
	}

	return 1;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:28,代码来源:DesignCtrSample.cpp

示例10: initialize

BOOL OPCEngine::initialize(
	IN enum serverTypeCOM type, 
	IN REFCLSID clsid, 
	IN UINT rgsResource, 
	IN HINSTANCE hInst,
	IN DWORD coInit)	// COM init mode
{ 
	_TRACE(TL_INF, TG_ENG, (_T("initialize engine; clsid:%8.8X-%4.4X-%4.4X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X"), clsid.Data1, clsid.Data2, clsid.Data3, clsid.Data4[0], clsid.Data4[1], clsid.Data4[2], clsid.Data4[3], clsid.Data4[4], clsid.Data4[5], clsid.Data4[6], clsid.Data4[7]));
	HRESULT res;

	g_clsid = clsid;
	g_registerId = rgsResource;

	m_type = type;

	if (type != InProc)
	{
		if (SUCCEEDED(res = ::CoInitializeEx(NULL, coInit)))
			m_initialized = TRUE;
		else
			_ERROR(TG_ENG, OPCENGINE_ERR_COM,(_T("Can't initialize COM: coInit:0x%X [0x%X]"), coInit, res));
	}

	_Module.Init(g_objectMap, hInst);
    ::CoFileTimeNow(&m_startTime);

	GenericPointer<GenericServer> pg = m_creator->createServer(TRUE);
	m_opcRoot->addBranch(pg);
	pg->setName(_T("PublicGroups"));
	
	_TRACE(TL_DEB, TG_ENG, (_T("< initialize 0x%X"), res));
	return SUCCEEDED(res); 
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:33,代码来源:OPCEngine.cpp

示例11: _tWinMain

int APIENTRY _tWinMain(_In_ HINSTANCE hCurInst,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPTSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{

 	// TODO: ここにコードを挿入してください。
	MSG msg;
	BOOL bRet;

   hInst = hCurInst; // グローバル変数にインスタンス処理を格納します。

   //モジュールの初期化
   _Module.Init(ObjectMap, hInst);

   if (!MyRegisterClass(hCurInst))
	   return FALSE;
	// アプリケーションの初期化を実行します:
	if (!InitInstance (hCurInst, nCmdShow))
	{
		return FALSE;
	}

	// メイン メッセージ ループ:
	while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0){
		if (bRet == -1){
			break;
		}else{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}
	return (int) msg.wParam;
}
开发者ID:tomorrow56,项目名称:VS2010,代码行数:34,代码来源:inetbr.cpp

示例12: InitInstance

BOOL CTestProjectWizardApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
    hProxyDll = m_hInstance;
#endif
    _Module.Init(ObjectMap, m_hInstance, &LIBID_TESTPROJECTWIZARDLib);
    return CWinApp::InitInstance();
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:8,代码来源:TestProjectWizard.cpp

示例13: InitInstance

BOOL CMMGeoPunktDLKApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
	hProxyDll = m_hInstance;
#endif
	_Module.Init(ObjectMap, m_hInstance);
	return CWinApp::InitInstance();
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:8,代码来源:MMGeoPunktDLK.cpp

示例14: InitInstance

/////////////////////////////////////////////////////////////////////////////
//++
//
//  CFileShareSampleApp::InitInstance
//
//  Description:
//      Initialize this instance of the application.
//
//  Arguments:
//      None.
//
//  Return Value:
//      Any return codes from CWinApp::InitInstance().
//
//--
/////////////////////////////////////////////////////////////////////////////
BOOL
CFileShareSampleApp::InitInstance( void )
{
    _Module.Init( ObjectMap, m_hInstance );

    return CWinApp::InitInstance();

}  //*** CFileShareSampleApp::InitInstance
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:24,代码来源:File+Share+SampleEx.cpp

示例15: InitInstance

BOOL CEdbsApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
    hProxyDll = m_hInstance;
#endif
    _Module.Init(ObjectMap, m_hInstance, &LIBID_TRiAS_EDBS);
    return CWinApp::InitInstance();
}
开发者ID:gsaralji,项目名称:TRiAS,代码行数:8,代码来源:edbs.cpp


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