问问大家怎么理解: If this DLL is dynamically linked against the MFC DLLs,

MOOD 2021-02-08 03:37:23
Note!

If this DLL is dynamically linked against the MFC DLLs, any functions exported from this DLL which call into MFC must have the AFX_MANAGE_STATE macro added at the very beginning of the function.
For example:

extern "C" BOOL PASCAL EXPORT ExportedFunction()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
normal function body here
}

It is very important that this macro appear in each function, prior to any calls into MFC. This means that it must appear as the first statement within the function, even before any object variable declarations as their constructors may generate calls into the MFC DLL.

Please see MFC Technical Notes 33 and 58 for additional details.

机器翻译很啥B,看不太懂,所以想问问大家怎么理解。
If this DLL is dynamically linked against the MFC DLLs,
百度说:如果此DLL与MFC DLL动态链接,
GG说:如果此DLL是与MFC DLL动态链接的,
它本身是个DLL了,怎么又与MFC DLL们搞什么动态链接呢?看不明白
...全文
250 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eleven 2021-02-16
  • 打赏
  • 举报
回复
如果此DLL是与MFC DLL动态链接的,则MFC调用此DLL导出的任何函数都必须在函数的开头添加AFX_MANAGE_STATE宏。
schlafenhamster 2021-02-15
  • 打赏
  • 举报
回复
If this DLL is dynamically linked against the MFC DLLs, 这里 against 是 “针对”即 “要使用 ”的意思、 即 如果此 DLL 要使用 MFC DLL动态链接,
zgl7903 2021-02-14
  • 打赏
  • 举报
回复
an_bachelor 2021-02-08
  • 打赏
  • 举报
回复
自身是个DLL,也可以调用其他DLL的功能,这句话是说: 如果你这个DLL设置了“在共享DLL中使用MFC”,那么你的导出函数就需要加这个。
MOOD 2021-02-08
  • 打赏
  • 举报
回复
我的翻译: If this DLL is dynamically linked against the MFC DLLs, any functions exported from this DLL which call into MFC must have the AFX_MANAGE_STATE macro added at the very beginning of the function. 如果此DLL是与MFC DLL们动态链接(真看不懂逻辑),则在MFC程序里调用此DLL导出的任何函数时,必须在函数开头添加 AFX_MANAGE_STATE宏。

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧