Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3298933
  • 博文数量: 754
  • 博客积分: 10132
  • 博客等级: 上将
  • 技术积分: 7780
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-14 23:36
文章分类

全部博文(754)

文章存档

2012年(3)

2011年(39)

2010年(66)

2009年(167)

2008年(479)

我的朋友

分类: C/C++

2010-12-02 13:32:00

用vs2005打开vc6下实现的项目(深入浅出MFC随书光盘的文件),打开编译后会出现以下warming:

CWinApp::Enable3dControls was declared deprecated

结合网上资料,以Text(chapter 13)项目为例:

  1. /* 
  2. #ifdef _AFXDLL 
  3.         Enable3dControls();                     // Call this when using MFC in a shared DLL 
  4. #else 
  5.         Enable3dControlsStatic();       // Call this when linking to MFC statically 
  6. #endif 
  7. */  
  8. INITCOMMONCONTROLSEX InitCtrls;  
  9. InitCtrls.dwSize = sizeof(InitCtrls);  
  10. InitCtrls.dwICC = ICC_WIN95_CLASSES;  
  11. InitCommonControlsEx(&InitCtrls);  
  12. CWinApp::InitInstance();  
  13. if (!AfxOleInit())  
  14. {           AfxMessageBox("IDP_OLE_INIT_FAILED");  
  15.     return FALSE;  
  16. }  
  17. AfxEnableControlContainer();  

编译,出现AfxOleInit identifier not found error

在该文件中加入头文件

#include "afxdisp.h"

编译,通过

但是运行时,出现“未找到MFC80d.DLL”的错误

结合网上资料,此问题可能是Manifest引起的,因此我们可以通过修改项目:属性->清单工具(Manifest Tool)->输入输出(Input and Output),把“嵌入清单(Embed Manifest)”选“否(No)”

再次编译,运行,正常

另外,如果出现提示:
This application has failed to start because MSVCR80D.dll was not found. Re-installing the application may fix the problem.
可以做如下修改:
属 性->清单工具(Manifest Tool)->常规(General)->使用FAT32解决办法(Use FAT32 Work-around),选择“是(Yes)”

阅读(2484) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~