本文介绍了在DLL中使用AfxGetInstanceHandle()的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好 有人可以解释一下如何在DLL(基于对话框的MFC应用程序作为DLL)中使用AfxGetInstanceHandle()吗? 它一直都返回NULL值,但是不知何故,它可以在Release模式下工作,我不知道如何正确使用它. 请指教. 谢谢 Sutha
Hi All Can Someone explain me how to use AfxGetInstanceHandle() inside a DLL (Dialog based MFC Application as a DLL)? It returns NULL value all the time, but somehow It works in Release mode, I have no idea how to use this properly. Please advice. Thanks Sutha
推荐答案要成功获取dll文件与DLL的USRDLL版本链接所需的Instance值. 我想您在调试和发行版本中使用了不同的项目设置,从而导致了问题. To sucessfully get the Instance value the dll file needs to linked with USRDLL version of MFC. I guess you are having different project settings for debug and release version and that causing the problem.
更多推荐
在DLL中使用AfxGetInstanceHandle()的正确方法
发布评论