当前位置: 代码迷 >> VC >> ——模仿别人的代码都出错
  详细解决方案

——模仿别人的代码都出错

热度:3057   发布时间:2013-02-25 00:00:00.0
求助——模仿别人的代码都出错啊
小弟菜鸟,刚刚学vc。看了段关于vc控件——单选按钮radio 的视频,于是自己尝试着写写,可就是按照视频中的流程傻瓜式的走下来都竟然能出错,一时半或也不知道自己是哪里错了,还望多多指教,

void CNewchioceDlg::OnOK() 
{
// TODO: Add extra validation here

CDialog::OnOK();
CString str;
CButtom* Radiobuttom=(CButtom*)GetDlgItem(IDC_RADIO1+m_Radio-1);////这难道是申明指针?
Radiobuttom->GetwindowText(str);
MessageBox(str);
}


D:\vc project\newchioce\newchioceDlg.cpp(178) : error C2065: 'CButtom' : undeclared identifier
D:\vc project\newchioce\newchioceDlg.cpp(178) : error C2065: 'Radiobuttom' : undeclared identifier
D:\vc project\newchioce\newchioceDlg.cpp(178) : error C2059: syntax error : ')'
D:\vc project\newchioce\newchioceDlg.cpp(179) : error C2227: left of '->GetwindowText' must point to class/struct/union
Generating Code...
执行 cl.exe 时出错.

问题:
1 代码看懂了个大概,可局部有些地方看不懂语法 :如 如果“ CButtom*”是在申明一个指针的话,那“(CButtom*)”又是在做什么呢? 学c的时候能够区分指针函数,函数指针,可现在这玩意就完全一头雾水了
2 编译时,为什么会出错

------解决方案--------------------------------------------------------
探讨

不知道啊,不是有CString 的用法来定义 字符串变量吗? CButtom难道是用来定义按钮变量的?
  相关解决方案