本文整理汇总了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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例8: InitInstance
//------------------------------------------------------------------*
BOOL
CCSC_OnlineApp::InitInstance()
{
_Module.Init(ObjectMap, m_hInstance);
::InitTrace(m_hInstance,_T("SOFTWARE\\SOFTING\\4ControlV2\\"),_T("CSC_ONLINE"));
return CWinApp::InitInstance();
}
示例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;
}
示例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);
}
示例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;
}
示例12: InitInstance
BOOL CTestProjectWizardApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
hProxyDll = m_hInstance;
#endif
_Module.Init(ObjectMap, m_hInstance, &LIBID_TESTPROJECTWIZARDLib);
return CWinApp::InitInstance();
}
示例13: InitInstance
BOOL CMMGeoPunktDLKApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
hProxyDll = m_hInstance;
#endif
_Module.Init(ObjectMap, m_hInstance);
return CWinApp::InitInstance();
}
示例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
示例15: InitInstance
BOOL CEdbsApp::InitInstance()
{
#ifdef _MERGE_PROXYSTUB
hProxyDll = m_hInstance;
#endif
_Module.Init(ObjectMap, m_hInstance, &LIBID_TRiAS_EDBS);
return CWinApp::InitInstance();
}