在DLL中使用AfxGetInstanceHandle()的正确方法 [英] Proper way of Using AfxGetInstanceHandle() in DLL

查看:144
本文介绍了在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()的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆