AFX_MANAGE_STATE(AfxGetStaticModuleState())做什么 [英] What does AFX_MANAGE_STATE(AfxGetStaticModuleState()) do exactly

查看:482
本文介绍了AFX_MANAGE_STATE(AfxGetStaticModuleState())做什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了很多模式对话框,他们工作正常,不使用 AFX_MANAGE_STATE ,但最近我正在一个不同的项目,其中资源dll是不同的从发射dll。我冲浪网,找到了上面的行,当我插入它之前启动对话框,它的工作。我想,也许,因为我们有不同的dll,我们需要加载主dll的状态,以启动对话框,但我不知道。我没有能够在互联网上的任何地方找到一个很好的解释。任何人都可以用简单的语句解释什么 AFX_MANAGE_STATE ,为什么我突然不得不使用它。

I have used a lot of modal dialogs and they worked fine without the use of AFX_MANAGE_STATE, but recently I was working on a different project in which the resource dlls are different from the launching dll. I surfed the web and found out the above line and when I inserted it before launching the dialog, it worked. I guess that maybe since we have different dlls, we need to load the state of the main dll in order to launch the dialog, but I am not sure. I have not been able to find a good explanation anywhere on the internet. Could anyone please explain in simple terms what AFX_MANAGE_STATE does and why I suddenly had to use it.

谢谢。 / p>

Thanks.

推荐答案

每个.exe和.dll都有一个内部资源句柄,指向你的对话框和其他资源。如果在DLL中调用函数,当前资源句柄指向.exe中的资源,这是错误的,需要更改为DLL的资源。

Every .exe and .dll has an internal resource handle, pointing to your dialogs and other resources. If you call a function in your DLL, the current resource handle is pointing to the resources in the .exe, which is wrong and needs to be changed to the resources of the DLL.

这是 AFX_MANAGE_STATE 的用途。

这篇关于AFX_MANAGE_STATE(AfxGetStaticModuleState())做什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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