本文整理匯總了C++中AfxTermExtensionModule函數的典型用法代碼示例。如果您正苦於以下問題:C++ AfxTermExtensionModule函數的具體用法?C++ AfxTermExtensionModule怎麽用?C++ AfxTermExtensionModule使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AfxTermExtensionModule函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
g_instance = hInstance;
// Extension DLL one-time initialization.
if (!AfxInitExtensionModule(extensionDLL, hInstance))
return 0;
WNEW CDynLinkLibrary(extensionDLL);
break;
case DLL_PROCESS_DETACH:
// Extension DLL per-process termination
AfxTermExtensionModule(extensionDLL);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return 1;
}
示例2: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("VALVELIB.AWX Initializing!\n");
// Extension DLL one-time initialization
AfxInitExtensionModule(ValvelibDLL, hInstance);
// Insert this DLL into the resource chain
new CDynLinkLibrary(ValvelibDLL);
// Register this custom AppWizard with MFCAPWZ.DLL
SetCustomAppWizClass(&Valvelibaw);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("VALVELIB.AWX Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(ValvelibDLL);
}
return 1; // ok
}
示例3: DllMain
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("StateMachineEditor.DLL Initializing!\n");
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(StateMachineEditorDLL, hInstance))
return 0;
// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.
new CDynLinkLibrary(StateMachineEditorDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("StateMachineEditor.DLL Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(StateMachineEditorDLL);
}
return 1; // ok
}
示例4: DllMain
//DLL 導出主函數
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason==DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(KernelEngineDLL,hInstance)) return 0;
new CDynLinkLibrary(KernelEngineDLL);
//初始化 COM
CoInitialize(NULL);
//初始化 SOCKET
WSADATA WSAData;
WORD wVersionRequested=MAKEWORD(2,2);
int iErrorCode=WSAStartup(wVersionRequested,&WSAData);
if (iErrorCode!=0) return 0;
}
else if (dwReason==DLL_PROCESS_DETACH)
{
CoUninitialize();
AfxTermExtensionModule(KernelEngineDLL);
}
return 1;
}
示例5: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE1("FLWLIB.DLL Initializing %08x!\n", hInstance);
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(FlwLibDLL, hInstance))
return 0;
// Insert this DLL into the resource chain
new CDynLinkLibrary(FlwLibDLL);
if (!MakeVersionOK("FLWLIB.DLL", _MAKENAME, SCD_VERINFO_V0, SCD_VERINFO_V1, SCD_VERINFO_V2, SCD_VERINFO_V3))
return 0;
#if WithOEP
SetOEPOptions(False); // OEP should load after this and reset if neccessary
#endif
#if WithQAL
SetQALOptions(False); // QAL should load after this and reset if neccessary
#endif
#if WithMG
SetMGOptions(False); // MG should load after this and reset if neccessary
#endif
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("FLWLIB.DLL Terminating!\n");
AfxTermExtensionModule(FlwLibDLL);
}
return 1; // ok
}
示例6: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("V7UI.DLL Initializing!\n");
if (!AfxInitExtensionModule(V7uiDLL, hInstance))
return 0;
context_obj::CContextBase::InitAllContextClasses();
Init1CGlobal(hInstance);
// INITCOMMONCONTROLSEX InitCtrlEx;
// InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
// InitCtrlEx.dwICC = ICC_PROGRESS_CLASS|ICC_LISTVIEW_CLASSES|ICC_BAR_CLASSES|
// ICC_COOL_CLASSES|ICC_TAB_CLASSES;
// InitCommonControlsEx(&InitCtrlEx);
new CDynLinkLibrary(V7uiDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("V7UI.DLL Terminating!\n");
context_obj::CContextBase::DoneAllContextClasses();
AfxTermExtensionModule(V7uiDLL);
}
return 1;
}
示例7: DllMain
//
// 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;
}
示例8: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE1("AlcoaSpMdl.DLL Initializing %08x!\n", hInstance);
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(AlcoaSpMdlDLL, hInstance))
return 0;
// Insert this DLL into the resource chain
new CDynLinkLibrary(AlcoaSpMdlDLL);
if (!MakeVersionOK("AlcoaSpMdl.DLL", _MAKENAME, SCD_VERINFO_V0, SCD_VERINFO_V1, SCD_VERINFO_V2, SCD_VERINFO_V3))
return 0;
// ForceLoadModelLibrary();
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("AlcoaSpMdl.DLL Terminating!\n");
AfxTermExtensionModule(AlcoaSpMdlDLL);
}
return 1; // ok
}
示例9: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("NodeSimEx.DLL Initializing!\n");
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(NodeSimExDLL, hInstance))
{
return 0;
}
// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.
sg_pomDynLinkLib = new CDynLinkLibrary(NodeSimExDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
if (sg_pouNS_CAN != NULL)
{
sg_pouNS_CAN->ExitInstance();
delete sg_pouNS_CAN;
sg_pouNS_CAN = NULL;
}
if (sg_pouNS_J1939 != NULL)
{
sg_pouNS_J1939->ExitInstance();
delete sg_pouNS_J1939;
sg_pouNS_J1939 = NULL;
}
if (NULL != sg_pomDynLinkLib)
{
delete sg_pomDynLinkLib;
sg_pomDynLinkLib = NULL;
}
// Terminate the library before destructors are called
AfxTermExtensionModule(NodeSimExDLL);
}
//CGlobalObj::m_pEditorDocTemplate = NULL;
return 1; // ok
}
示例10: DllMain
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
extern "C" int APIENTRY DllMain ( HINSTANCE hInstance, DWORD dwReason, LPVOID )
{
if ( dwReason == DLL_PROCESS_ATTACH )
{
g_hInstanceCommon = hInstance;
if ( !AfxInitExtensionModule ( COMMONDLL, hInstance ) )
{
return 0;
}
new CDynLinkLibrary ( COMMONDLL );
if ( g_hCommonLocRes && AfxInitExtensionModule(COMMONDLLRes, g_hCommonLocRes) )
new CDynLinkLibrary(COMMONDLLRes);
g_hLockBitmap = (HBITMAP)::LoadImage(hInstance,
MAKEINTRESOURCE(IDB_COMMON_LOCK_BITMAP), IMAGE_BITMAP, 0, 0, LR_SHARED);
g_hLockBitmapMask = (HBITMAP)::LoadImage(hInstance,
MAKEINTRESOURCE(IDB_COMMON_LOCK_BITMAP_MASK), IMAGE_BITMAP, 0, 0, LR_SHARED);
BITMAP bm = {0};
::GetObject(g_hLockBitmap, sizeof(BITMAP), &bm);
g_LockBitmapSize.cx = bm.bmWidth;
g_LockBitmapSize.cy = bm.bmHeight;
}
else if ( dwReason == DLL_PROCESS_DETACH )
{
AfxTermExtensionModule ( COMMONDLL );
AfxTermExtensionModule ( COMMONDLLRes );
if (g_hCommonLocRes)
{
FreeLibrary(g_hCommonLocRes);
g_hCommonLocRes = NULL;
}
}
return 1;
}
示例11: DllMain
extern "C" int APIENTRY
DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved )
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER( lpReserved );
if ( dwReason == DLL_PROCESS_ATTACH )
{
// TRACE0( "ZDCTL.DLL Initializing!\n" );
g_hInstanceDLL = hInstance;
// Extension DLL one-time initialization - do not allocate memory here,
// use the TRACE or ASSERT macros or call MessageBox
if ( AfxInitExtensionModule( extensionDLL, hInstance ) == 0 )
return( 0 );
// Other initialization could be done here, as long as
// it doesn't result in direct or indirect calls to AfxGetApp.
// This extension DLL doesn't need to access the app object
// but to be consistent with ZDrApp.dll, this DLL requires
// explicit initialization as well (see below).
// This allows for greater flexibility later in development.
///////////////////////////////////////////////////////////////////////
//
// We are calling this DLL from regular DLL's, so we have moved
// the call to CDynLinkLibrary .
//
// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control) instead of an
// MFC application, then you will want to remove this line from
// DllMain and put it in a separate function exported from this
// Extension DLL. The Regular DLL that uses this Extension DLL
// should then explicitly call that function to initialize this
// Extension DLL. Otherwise, the CDynLinkLibrary object will not
// be attached to the Regular DLL's resource chain, and serious
// problems will result.
//
///////////////////////////////////////////////////////////////////////
// new CDynLinkLibrary( extensionDLL );
}
else
if ( dwReason == DLL_PROCESS_DETACH )
{
// TRACE0( "ZDCTL.DLL Terminating!\n" );
AfxTermExtensionModule( extensionDLL );
}
return( 1 ); // ok
}
示例12: DllMain
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// lpReserved를 사용하는 경우 다음을 제거하십시오.
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("IOCPNetwork.DLL을 초기화하고 있습니다.\n");
// 확장 DLL을 한 번만 초기화합니다.
if (!AfxInitExtensionModule(IOCPNetworkDLL, hInstance))
return 0;
// 이 DLL을 리소스 체인에 삽입합니다.
// 참고: 이 확장 DLL이 MFC 응용 프로그램이
// 아닌 ActiveX 컨트롤과 같은 MFC 기본 DLL에
// 의해 명시적으로 링크되어 있는 경우에는
// DllMain에서 이 줄을 제거하고, 제거한 줄은 이 확장 DLL에서
// 내보낸 별도의 함수에 추가합니다.
// 그런 다음 이 확장 DLL을 사용하는 기본 DLL은
// 해당 함수를 명시적으로 호출하여 이 확장 DLL을 추가해야 합니다.
// 그렇지 않으면 CDynLinkLibrary 개체가
// 기본 DLL의 리소스 체인에 추가되지 않으므로
// 심각한 문제가 발생합니다.
new CDynLinkLibrary(IOCPNetworkDLL);
// 소켓 초기화입니다.
// 참고: 이 확장 DLL이 MFC 응용 프로그램이
// 아닌 ActiveX 컨트롤과 같은 MFC 기본 DLL에
// 의해 명시적으로 링크되어 있는 경우에는
// DllMain에서 다음 줄을 제거하고, 제거한 줄은 이 확장 DLL에서
// 내보낸 별도의 함수에 추가합니다.
// 그런 다음 이 확장 DLL을 사용하는 기본 DLL은
// 해당 함수를 명시적으로 호출하여 이 확장 DLL을 초기화해야 합니다.
if (!AfxSocketInit())
{
return FALSE;
}
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("IOCPNetwork.DLL을 종료하고 있습니다.\n");
// 소멸자가 호출되기 전에 라이브러리를 종료합니다.
AfxTermExtensionModule(IOCPNetworkDLL);
}
return 1; // 확인
}
示例13: DllMain
//導出函數
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason==DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(ServiceCoreDLL, hInstance)) return 0;
new CDynLinkLibrary(ServiceCoreDLL);
}
else if (dwReason==DLL_PROCESS_DETACH)
{
AfxTermExtensionModule(ServiceCoreDLL);
}
return 1;
}
示例14: DllMain
/**
* DLL 入口函數
*/
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(GameClientDLL, hInstance)) return 0;
new CDynLinkLibrary(GameClientDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
AfxTermExtensionModule(GameClientDLL);
}
return 1;
}
示例15: DllMain
BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved )
/***************************************************************************/
{
UNUSED_ALWAYS( lpReserved );
if( dwReason == DLL_PROCESS_ATTACH ) {
// Add the AFX library to the list of modules searched for resources.
AfxInitExtensionModule( _AFXModule, hInstance );
new CDynLinkLibrary( _AFXModule, TRUE );
} else {
// Delete the CDynLinkLibrary object for the AFX library, as well as any
// others that are left.
AfxTermExtensionModule( _AFXModule, TRUE );
}
return( TRUE );
}