关于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()
不知道为什么,请高人指点迷津。谢谢
...全文
652 23 打赏 收藏 转发到动态 举报
写回复
用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)
湖 南 大 学 信息科学与工程学院 实 验 报 告 "实验名称 "香农编码 " "课程名称 "信息论与编码 " " " " 1、实验目的 (1)进一步熟悉Shannon编码算法; (2)掌握C语言程序设计和调试过程中数值的进制转换、数值与字符串之间的转换等技 术。 2、实验要求 (1)输入:信源符号个数q、信源的概率分布p; (2)输出:每个信源符号对应的Shannon编码的码字。 3、Shannon编码算法 1:procedure SHANNON(q,{}) 2: 降序排列{} 3: for i=1 q do 4: F() 5: 6:将累加概率F()(十进制小数)变换成二进制小数。 7:取小数点后个二进制数字作为第i个消息的码字。 8:end for 9:end procedure ---------------------------------------------------------------------------- -------------------------------------- 调试过程 1、fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory fatal error C1083: Cannot open include file: 'values.h': No such file or directory 原因:unistd.h和values.h是Unix操作系统下所使用的头文件 纠错:删去即可 2、error C2144: syntax error : missing ')' before type 'int' error C2064: term does not evaluate to a function 原因:l_i(int *)calloc(n,sizeof(int)); l_i后缺少赋值符号使之不能通过编译 纠错:添加上赋值符号 error C2018: unknown character '0xa1' 原因:有不能被识别的符号 纠错:在错误处将不能识别的符号改为符合C语言规范的符号 error C2021: expected exponent value, not ' ' 原因:if(fabs(sum-1.0)>DELTA); 这一行中DELTA宏定义不正确 纠错:# define DELTA 0.000001 error C2143: syntax error : missing ';' before '}' 原因:少写了";"号 纠错:在对应位置添加上";"号 参考代码 # include # include # include # include # define DELTA 0.000001/*精度*/ void sort(float*,int);/*排序*/ int main(void) { register int i,j; int n; /*符号个数*/ int temp;/*中间变量*/ float *p_i; /*符号的概率*/ float *P_i; /*累加概率*/ int *l_i; /*码长*/ char * *C; /*码集合*/ /*用sum来检验数据,用p来缓存了中间数据*/ float sum,p; /*输入符号数*/ fscanf(stdin,"%d",&n); /*分配内存地址 */ p_i=(float *)calloc(n,sizeof(float)); P_i=(float *)calloc(n,sizeof(float)); l_i=(int *)calloc(n,sizeof(int)); /* 存储信道传输的概率*/ for(i=0;iDELTA) fprintf(stderr,"Invalid input data \n"); fprintf(stdout,"Starting…\n\n"); /*以降序排列概率*/ sort (p_i,n); /*计算每个符号的码长*/ for(i=0;i

16,470

社区成员

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

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

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