关于error C2143: syntax error : missing '}' before ';'

baiminsheng 2009-07-13 05:03:19
错误提示:
1>.\adujstrowcoldlg.cpp(42) : error C2143: syntax error : missing '}' before ';'
1>.\adujstrowcoldlg.cpp(44) : error C2143: syntax error : missing ';' before '}'
1>.\adujstrowcoldlg.cpp(44) : error C2653: 'TheBaseClass' : is not a class or namespace name
1>.\adujstrowcoldlg.cpp(44) : error C2065: 'GetThisMessageMap' : undeclared identifier
1>.\adujstrowcoldlg.cpp(44) : error C2065: '_messageEntries' : undeclared identifier
1>.\adujstrowcoldlg.cpp(44) : error C2059: syntax error : 'return'
1>.\adujstrowcoldlg.cpp(44) : error C2059: syntax error : '}'
1>.\adujstrowcoldlg.cpp(44) : error C2143: syntax error : missing ';' before '}'
1>.\adujstrowcoldlg.cpp(44) : error C2059: syntax error : '}'
该错误都指向的是
BEGIN_MESSAGE_MAP(CAdujstRowColDlg, CDialog)
//{{AFX_MSG_MAP(CAdujstRowColDlg)
ON_WM_HELPINFO();
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
不知道为什么,请高人指点迷津。谢谢
...全文
659 23 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
Christ_Day 2011-07-15
  • 打赏
  • 举报
回复
我也遇见了这个问题,求解释
DarkChampion 2009-07-13
  • 打赏
  • 举报
回复
错误在realreportdlg.cpp中吧
TheBaseClass定义可能有误
DavidHsing 2009-07-13
  • 打赏
  • 举报
回复
'TheBaseClass' : is not a class or namespace name

TheBaseClass.h 没有 include (当然需要先添加到工程)
biweilun 2009-07-13
  • 打赏
  • 举报
回复
眼花缭乱...
bw_0927 2009-07-13
  • 打赏
  • 举报
回复
仔细地好好地认真地检查

}

号附近的标识符

编译器不认识
  • 打赏
  • 举报
回复
不是多了;就是少了; 或者 是{ }
wangzecheng 2009-07-13
  • 打赏
  • 举报
回复
多了一个}符号吧。
快乐鹦鹉 2009-07-13
  • 打赏
  • 举报
回复
晕啊。你新的错误已经不是这个类了,你没有看出来吗?
baiminsheng 2009-07-13
  • 打赏
  • 举报
回复
我现在正在做EVC工程升级到VS2005上。工程比较多,代码也很多,所以贴代码也不好弄啊。
baiminsheng 2009-07-13
  • 打赏
  • 举报
回复
// AdujstRowColDlg.cpp : implementation file
//

#include "stdafx.h"
#include "report.h"
#include "AdujstRowColDlg.h"
#include "GridCtrl_src/GridCtrl.h"
#include "RealReportDlg.h"
#include "WinUser.h" //bms
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAdujstRowColDlg dialog


CAdujstRowColDlg::CAdujstRowColDlg(CWnd* pParent /*=NULL*/, BOOL bIsInsert /*=TRUE*/)
: CDialog(CAdujstRowColDlg::IDD, pParent)
{
m_pGridCtrl = (CGridCtrl*)pParent ;
m_bIsInsert = bIsInsert ;
//{{AFX_DATA_INIT(CAdujstRowColDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}


void CAdujstRowColDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAdujstRowColDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAdujstRowColDlg, CDialog)
//{{AFX_MSG_MAP(CAdujstRowColDlg)
ON_WM_HELPINFO()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAdujstRowColDlg message handlers

int CAdujstRowColDlg::DoModal()
{
// TODO: Add your specialized code here and/or call the base class
((CReportApp*)AfxGetApp())->ShowTooBarWindow(SW_HIDE) ;
int nRet = CDialog::DoModal();
((CReportApp*)AfxGetApp())->ShowTooBarWindow(SW_SHOW) ;

return nRet ;
}

BOOL CAdujstRowColDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
CButton* pRadioButton = (CButton*)GetDlgItem(IDC_RADIO_ROW) ;
if( pRadioButton )
{
pRadioButton->SetCheck(TRUE) ;
}
if( !m_bIsInsert )//delete cells
{
CString str ;
str.LoadString(IDS_DELETE) ;
SetWindowText(str) ;

CStatic* pStatic = (CStatic*)GetDlgItem(IDC_STATIC_INSERT) ;
if( pStatic != NULL)
{
pStatic->SetWindowText(str) ;
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

void CAdujstRowColDlg::OnOK()
{
// TODO: Add extra validation here
CWaitCursor wait ;
if( m_pGridCtrl != NULL )
{
CCellID cell = m_pGridCtrl->GetFocusCell() ;

BOOL bIsRow = FALSE ;
BOOL bIsCol = FALSE ;
CButton* pRadioButton = (CButton*)GetDlgItem(IDC_RADIO_ROW) ;
if( pRadioButton )
{
bIsRow = pRadioButton->GetCheck() ;
}
pRadioButton = (CButton*)GetDlgItem(IDC_RADIO_COL) ;
if( pRadioButton )
{
bIsCol = pRadioButton->GetCheck() ;
}
CDialog::OnOK();

if( bIsRow == TRUE && bIsCol == FALSE ||
bIsRow == FALSE && bIsCol == TRUE )
{
if( m_bIsInsert )
{
if( bIsRow )
m_pGridCtrl->InsertRow(_T(""), cell.row) ;
if( bIsCol )
m_pGridCtrl->InsertColumn(_T(""), 0, cell.col) ;
}
else
{
if( bIsRow )
m_pGridCtrl->DeleteRow(cell.row) ;
if( bIsCol )
m_pGridCtrl->DeleteColumn(cell.col) ;
}
}
}
else
CDialog::OnOK();
}

BOOL CAdujstRowColDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
// TODO: Add your message handler code here and/or call default
///////////////// Begin of _FEATURE_USE_ ///////////////////////////
#ifdef _FEATURE_USE_
UINT dwText = CRealReportDlg::GetHelpStringID( pHelpInfo->iCtrlId ) ;
if( dwText == 0 )
return FALSE ;
CRealReportDlg::ShowHtmlHelpMessage(m_hWnd, dwText, pHelpInfo->MousePos) ;
return CDialog::OnHelpInfo(pHelpInfo);
#endif
///////////////// End of _FEATURE_USE_ ///////////////////////////
return FALSE; //2004-2-3 WangYH Add;
}
marrco2005 2009-07-13
  • 打赏
  • 举报
回复
无源码,无真相
oyljerry 2009-07-13
  • 打赏
  • 举报
回复
对话框头文件中是否添加 DECLARE_MESSAGE_MAP()
快乐鹦鹉 2009-07-13
  • 打赏
  • 举报
回复
你把CPP都贴出来,问题不在你贴的这个地方
baiminsheng 2009-07-13
  • 打赏
  • 举报
回复
我去掉了 错误反而还多了一条。还是不行的 我都弄过了 还有一处有类似的错误:
1>.\realreportdlg.cpp(61) : error C2143: syntax error : missing '}' before '{'
1>.\realreportdlg.cpp(61) : error C2143: syntax error : missing ';' before '{'
1>.\realreportdlg.cpp(61) : error C2143: syntax error : missing ';' before '}'
1>.\realreportdlg.cpp(61) : error C2653: 'TheBaseClass' : is not a class or namespace name
1>.\realreportdlg.cpp(61) : error C2065: 'GetThisMessageMap' : undeclared identifier
1>.\realreportdlg.cpp(61) : error C2065: '_messageEntries' : undeclared identifier
1>.\realreportdlg.cpp(61) : error C2059: syntax error : 'return'
1>.\realreportdlg.cpp(61) : error C2059: syntax error : '}'
1>.\realreportdlg.cpp(61) : error C2143: syntax error : missing ';' before '}'
1>.\realreportdlg.cpp(61) : error C2059: syntax error : '}'
指向的位置:

BEGIN_MESSAGE_MAP(CRealReportDlg, CDialog)
//{{AFX_MSG_MAP(CRealReportDlg)
ON_BN_CLICKED(IDC_WINDOW_RADIO, OnWindowRadio)
ON_BN_CLICKED(IDC_CONTENT_RADIO, OnContentRadio)
ON_BN_CLICKED(IDC_WIDTH_RADIO, OnWidthRadio)
ON_BN_CLICKED(IDC_REPORT_STYLE_BUTTON, OnReportStyleButton)
ON_EN_CHANGE(IDC_COLUMN_WIDTH_EDIT, OnChangeColumnWidthEdit)
ON_WM_HELPINFO()
#ifndef _WIN32_WCE //2004-2-3 WangYH add case for WCE;
ON_WM_CONTEXTMENU()
#endif
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
fffanpei 2009-07-13
  • 打赏
  • 举报
回复
哈哈
fengrx 2009-07-13
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 biweilun 的回复:]
引用 5 楼 happyparrot 的回复:
大家都来捡粪阿。

太恶了~~~
[/Quote]


哈哈,,
biweilun 2009-07-13
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 happyparrot 的回复:]
大家都来捡粪阿。
[/Quote]
太恶了~~~
oyljerry 2009-07-13
  • 打赏
  • 举报
回复
ON_WM_HELPINFO() 去掉分号
快乐鹦鹉 2009-07-13
  • 打赏
  • 举报
回复
大家都来捡粪阿。
fangchao918628 2009-07-13
  • 打赏
  • 举报
回复
1楼up
ON_WM_HELPINFO();
分号不要!
加载更多回复(3)

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧