别弄里面啊笨蛋 2019-09-06 17:44 采纳率: 75%
浏览 472
已采纳

VC++6.0 MFC创建新的dialog报错

在创建完成新的class(默认)后给主界面加入头文件后编译报错:
error C2143: syntax error : missing ';' before 'constant'
fatal error C1004: unexpected end of file found

部分具体代码:
主界面:
主界面头:
#include "stdafx.h"
#include "Happygame.h"
#include "HappygameDlg.h"
#include "DLG.h"
……按钮部分代码:
void CHappygameDlg::OnOK()
{
// TODO: Add extra validation here
DLG dlg;
dlg.DoModal();
CDialog::OnOK();
}
新dialog部分代码:
#if !defined(AFX_DLG_H__E092C23E_0190_4E76_B7EA_34E78B1110E0__INCLUDED_)
#define AFX_DLG_H__E092C23E_0190_4E76_B7EA_34E78B1110E0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DLG.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// DLG dialog

class DLG : public CDialog (此处是报错行!!!!!)
{
// Construction
public:
DLG(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(DLG)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DLG)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:

// Generated message map functions
//{{AFX_MSG(DLG)
    // NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLG_H__E092C23E_0190_4E76_B7EA_34E78B1110E0__INCLUDED_)

其中新的dialog叫DLG
报错:error C2143: syntax error : missing ';' before 'constant'
fatal error C1004: unexpected end of file found

小白大二做MFC求解谢谢大佬

  • 写回答

2条回答 默认 最新

  • zqbnqsdsmd 2019-09-07 23:18
    关注

    报错:error C2143: syntax error : missing ';' before 'constant'
    这不是告诉你了么

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥15 python天天向上类似问题,但没有清零
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?