vc60 使用mfc extension dll,在该DLL(含有代码)的dllmain中调用::loadlibrary,加载纯资源dll(用于提供资源,无任何代码,用/NOENTRY链接器选项编译出来的)来置换DLL中的资源句柄来达到多国语言支持,例如加载英文资源。疑问来啦,我在DllMain的msdn帮助文档中看到"The entry-point function should perform only simple initialization or termination tasksIt must not call the LoadLibrary or LoadLibraryEx function (or a function that calls these functions), because this may create dependency loops in the DLL load order."我加载纯资源dll来置换原dll的资源句柄(hResource)会不会有问题呢?或者说是会不会有隐患呢?
请大侠们不吝赐教,多谢...

解决方案 »

  1.   

    dllmain是dll的入口函数,里面一般的形式都是switch形式,告诉dll什么时候载入,可以在switch条件符合的情况下,调用函数A,再在函数A里面loadlibrary。。
      

  2.   

    It must not call the LoadLibrary or LoadLibraryEx function (or a function that calls these functions)
    说明在dllmain中间接地调用loadlibrary也不成啊。