求好心人 看看啊 谢谢了

xiaomi90578 xiaomi90578 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
步骤1 新建Win32 Application 工程 名为MFCDemo
步骤2 建Text File 名为MFCDemo.cpp
步骤3 在工程设置里 改 Use MFC in a shared DLL


#include<afxwin.h>
class CMFCDemoApp:public CWinAPP
{
public:
virtual BOOL InitInstance();
};
class CmainFrame:public CFrameWnd
{
public :
CmainFrame();
};
CmainFrame::CmainFrame()
{
Create(NULL,"windows");
}
BOOL CMFCDemoApp::InitInstance()
{
m_pMainWnd = new CmainFrame();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWand->UpdateWindow();
return true;
}
CMFCDemoApp theApp;




编译后 错误

:\access+C++\C++\MFCDemo\MFCDemo.cpp(3) : error C2504: 'CWinAPP' : base class undefined
D:\access+C++\C++\MFCDemo\MFCDemo.cpp(18) : error C2065: 'm_pMainWnd' : undeclared identifier
D:\access+C++\C++\MFCDemo\MFCDemo.cpp(18) : error C2440: '=' : cannot convert from 'class CmainFrame *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\access+C++\C++\MFCDemo\MFCDemo.cpp(19) : error C2227: left of '->ShowWindow' must point to class/struct/union
D:\access+C++\C++\MFCDemo\MFCDemo.cpp(20) : error C2065: 'm_pMainWand' : undeclared identifier
D:\access+C++\C++\MFCDemo\MFCDemo.cpp(20) : error C2227: left of '->UpdateWindow' must point to class/struct/union
执行 cl.exe 时出错. MFCDemo.obj - 1 error(s), 0 warning(s)
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
xiaomi90578
其它技术问题 3,881 成员 9,044 内容