warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed
来源:互联网 发布:阿里云系统盘用ssd 编辑:程序博客网 时间:2024/05/05 03:34
warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed.
“CWinApp::Enable3dControls”引起的C4996告警
这个是编译使用了老的向导生成的MFC代码时遇到的问题,一个典型的告警信息输出如下所示:
CrpFileCrack.cpp
f:\project\.....\crpfilecrack.cpp(52) : warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed. You should remove this call.
e:\software\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h(4818) : see declaration of 'CWinApp::Enable3dControls'
通常向导生成的代码是:
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
这两个函数的调用是旧的MFC版本对新版本的操作系统特性的支持,在新的(那个时候是新的)Windows 95平台上要这样调用一下才能使用新的Windows 3D样式的控件,否则就是老的Win 3.2样子的控件。想当初喜欢OWL就是因为感觉它的控件比较“酷”,比如那个带底纹的对话框,菱形的checkbox,还有带图标的“OK”按钮。对于新的MFC版本来说已经不需要再调用这两个函数了,参考前面的方法,用_MSC_VER对其隔离就行了:
添加红色部分代码即可, 其他不用修改
#if _MSC_VER <= 1200 // MFC 6.0 or earlier
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
- warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed.
- warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed.
- warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed
- warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed. You
- warning: CWinApp:: Enable3dControls() is no long need.
- warning C4996: 'CWinApp::Enable3dControlsStatic': CWinApp::Enable3dControlsStatic is no longer neede
- "CWinApp::Enable3dControls”引起的C4996告警
- CWinApp::Enable3dControls”引起的C4996告警
- CWinApp::Enable3dControls 在VS2005中也不支持了
- Enable3dControls
- CWinApp
- CWinApp
- CWinApp
- CWinApp
- CWinApp
- CWinApp
- CWinApp
- CWinApp
- Android---->Allapps加载流程详解【AndroidICS4.0——>Launcher系列五】
- zencart限制购买数量
- Chapter 8 Accessing the Entities and View Entities
- 部署windows服务
- java第九课_包,jar包
- warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed
- Div+Css 居中
- GCD介绍(一): 基本概念和Dispatch Queue
- USEREVN()+vize(x)+sys_context()
- 【问题】宏定义
- 在FormView中的CEdit不能复制粘贴(转)
- GCD介绍(二): 多核心的性能
- PHP数据类型
- block 简介