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


C++ AfxInitExtensionModule函数代码示例

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


在下文中一共展示了AfxInitExtensionModule函数的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;
}
开发者ID:Luomu,项目名称:workspacewhiz,代码行数:27,代码来源:WWhizReg.cpp

示例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
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:25,代码来源:valvelib.cpp

示例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
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:35,代码来源:StateMachineEditor.cpp

示例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;
}
开发者ID:lonyzone,项目名称:six_beauty,代码行数:26,代码来源:KernelEngine.cpp

示例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
}
开发者ID:abcweizhuo,项目名称:Test3,代码行数:35,代码来源:FlwLib.CPP

示例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;
}
开发者ID:ste6an,项目名称:v7ui,代码行数:30,代码来源:v7ui.cpp

示例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;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:28,代码来源:DesignCtrSample.cpp

示例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
}
开发者ID:abcweizhuo,项目名称:Test3,代码行数:27,代码来源:AlcoaSpMdl.cpp

示例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
}
开发者ID:Ferrere,项目名称:busmaster,代码行数:58,代码来源:NodeSimEx.cpp

示例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;
}
开发者ID:hackshields,项目名称:antivirus,代码行数:47,代码来源:common.cpp

示例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
}
开发者ID:DeegC,项目名称:ZeidonTools,代码行数:53,代码来源:ZdCtl.cpp

示例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;   // 확인
}
开发者ID:hyundo32,项目名称:WS_MicroScoper,代码行数:51,代码来源:dllmain.cpp

示例13: 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;
}
开发者ID:lincoln56,项目名称:robinerp,代码行数:17,代码来源:JQClient.cpp

示例14: 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;
}
开发者ID:Michael-Z,项目名称:qipai-game,代码行数:15,代码来源:ServiceCore.cpp

示例15: DllMain

BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) {
	//- Remove this if you use lpReserved
	UNREFERENCED_PARAMETER(lpReserved) ;

	if ( dwReason == DLL_PROCESS_ATTACH ) {
        _hdllInstance =hInstance ;
		// Extension DLL one-time initialization
		if ( !AfxInitExtensionModule (ArxTestEntitlementDLL, hInstance) )
			return (FALSE);
	} else if ( dwReason == DLL_PROCESS_DETACH ) {
		// Terminate the library before destructors are called
		AfxTermExtensionModule (ArxTestEntitlementDLL) ;
	}
	return (TRUE) ;
}
开发者ID:ADN-DevTech,项目名称:EntitlementAPI,代码行数:15,代码来源:ArxTestEntitlement.cpp


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