从VC6到VS2005移植代码:warning C4996
来源:互联网 发布:java正则表达式单引号 编辑:程序博客网 时间:2024/04/30 19:12
从VC6到VS2005移植代码问题说明
这个是编译使用了老的向导生成的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作出来的灰灰的界面就觉得土,不过后来就知道MFC做界面也是很漂亮的,比如我做的。。。。,再打住。对于新的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
- 从VC6到VS2005移植代码:warning C4996
- 从VC6到VC9移植代码问题
- vs2005 warning C4996 解决办法
- 从Vc6迁移到Vs2005
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结收藏
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结 收藏
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从 VC6到VC9移植代码问题总结收藏
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- 从VC6到VC9移植代码问题总结
- java面试题3
- java面试题2
- java面试题1
- 冒泡法和选择法排序
- Android电源管理相关应用技巧分享
- 从VC6到VS2005移植代码:warning C4996
- hibernate 原理说明
- ubuntu10.04安装mysql[有很多借鉴他人的地方]
- C语言笔记之一:字符常量integer character constant是int型
- Visual SourceSafe 多项目自动切换工具
- Web的系统测试方法
- asp笔记1----日期格式输出
- 无能者的借口:简答「公司规定」(转自联强EMBA广告邮件)
- PHP安装错误 configure: error: xml2-config not found. Please check your libxml2 installation.