#include "AFXWIN.H"
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
afx_msg int OnCreate(LPCREATESTRUCT);
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT,CPoint); CHtmlView view;
CButton button;
DECLARE_MESSAGE_MAP()
};
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};1>------ 已启动生成: 项目: MFC, 配置: Release Win32 ------
1>正在编译...
1>CMainWindow.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\users\administrator\desktop\win32\mfc\mfc\CMainWindow.h(11) : error C2146: 语法错误 : 缺少“;”(在标识符“view”的前面)
1>c:\users\administrator\desktop\win32\mfc\mfc\CMainWindow.h(11) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\users\administrator\desktop\win32\mfc\mfc\CMainWindow.h(11) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>生成日志保存在“file://c:\Users\Administrator\Desktop\WIN32\MFC\MFC\Release\BuildLog.htm”
1>MFC - 3 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

解决方案 »

  1.   


    #include "AFXWIN.H"
    #include "afxext.h"
    #include "afxhtml.h"
    class CMainWindow : public CFrameWnd
    {
    public:
    CMainWindow();
    afx_msg int OnCreate(LPCREATESTRUCT);
    afx_msg void OnPaint();
    afx_msg void OnLButtonDown(UINT,CPoint);
    public:
    CHtmlView view;
    CButton button; DECLARE_MESSAGE_MAP()
    };
    class CMyApp : public CWinApp
    {
    public:
    virtual BOOL InitInstance();
    };
    1>------ 已启动生成: 项目: MFC, 配置: Release Win32 ------
    1>正在编译...
    1>CMainWindow.cpp
    1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
    1>.\CMainWindow.cpp(24) : error C2248: “CHtmlView::CHtmlView”: 无法访问 protected 成员(在“CHtmlView”类中声明)
    1>        d:\VC++ 2008\VC\atlmfc\include\afxhtml.h(88) : 参见“CHtmlView::CHtmlView”的声明
    1>        d:\VC++ 2008\VC\atlmfc\include\afxhtml.h(85) : 参见“CHtmlView”的声明
    1>生成日志保存在“file://c:\Users\Administrator\Desktop\WIN32\MFC\MFC\Release\BuildLog.htm”
    1>MFC - 1 个错误,0 个警告
    ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========