afcambientactctx在visual studio 2015中的未声明标识符 [英] afxambientactctx' undeclared identifier in visual studio 2015

查看:697
本文介绍了afcambientactctx在visual studio 2015中的未声明标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个MFC项目,它在visual studio 2010中正常运行,当它迁移到visual studio2015时它给了我错误

Hi i have a MFC project which is building fine in visual studio 2010 and when it got migrated to the visual studio2015 it is giving me the error



严重性代码描述项目文件行错误C2065 'afxAmbientActCtx':未声明的标识符

Severity Code Description Project File Line Error C2065 'afxAmbientActCtx': undeclared identifier


如果这个被弃用了,那我可以通过另一种编码方式实现它吗?

If that got deprecated then can i achieve it with another way of coding?



请帮助并告诉我们

please help and let me know

推荐答案


siddhartha madapakula

感谢您在此处发布。

>>严重性代码说明项目文件行错误C2065 'afxAmbientActCtx':未声明的标识符

如果已弃用,那么我可以通过其他编码方式实现吗?

在MFC中不再支持或实现AfxSetAmbientActCtx。 这是设计使然。 所有与Fusion相关的机制(包括与激活上下文相关的所有代码)都已从MFC 11.0中删除。

AfxSetAmbientActCtx is no longer supported or implemented in MFC.  This is by design.  All the Fusion-related machinery (including all the code related to activation contexts) was removed from MFC 11.0.

通过调用AfxSetModuleState来切换当前模块状态。在大多数情况下,你永远不会直接处理API。在很多情况下,MFC会为你调用它(在W中) inMain,OLE入口点,AfxWndProc等。) 这是通过在特殊的WndProc中静态链接写入的任何组件
以及知道哪个模块状态应该是的特殊WinMain(或DllMain)来完成的。当前。您可以通过查看MFC\SRC目录中的DLLMODUL.CPP或APPMODUL.CPP来查看此代码。

The current module state is switched by calling AfxSetModuleState. For the most part, you will never deal directly with the API. MFC, in many cases, will call it for you (at WinMain, OLE entry-points, AfxWndProc, etc.). This is done in any component you write by statically linking in a special WndProc, and a special WinMain (or DllMain) that knows which module state should be current. You can see this code by looking at DLLMODUL.CPP or APPMODUL.CPP in the MFC\SRC directory.

有关详细信息,请参阅以下文档。

For more information, please refer to this document below.

https://msdn.microsoft.com/en -us / library / ft1t4bbc.aspx?f = 255& MSPPError = -2147217396

希望这可以帮助你。

最好的问候,

Sera Yu


这篇关于afcambientactctx在visual studio 2015中的未声明标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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