用vs2005打开vc6下实现的项目(深入浅出MFC随书光盘的文件),打开编译后会出现以下warming:
CWinApp::Enable3dControls was declared deprecated
结合网上资料,以Text(chapter 13)项目为例:
- /*
- #ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
- #else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
- #endif
- */
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
- CWinApp::InitInstance();
- if (!AfxOleInit())
- { AfxMessageBox("IDP_OLE_INIT_FAILED");
- return FALSE;
- }
- 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)”