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

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 对于这个复杂问题的解释说明
  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败