我用VC6.0做个简单的对话框程序,提示错误must have class/struct/union type
我在同一个对话框中加入的几个按钮,添加成员后,写单击相应函数voidCMy9_1Dlg::OnButton1(){//TODO:Addyourcontrolnotific...
我在同一个对话框中加入的几个按钮,添加成员后,写单击相应函数
void CMy9_1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
m_btn1.SetWindowText("你已按下了按钮!");
}
void CMy9_1Dlg::OnButton2()
{
// TODO: Add your control notification handler code here
m_btn2.SetWindowText("按钮已被按下!");
}
void CMy9_1Dlg::OnRadio1()
{
// TODO: Add your control notification handler code here
m_rad1.SetCheck(1);
}
void CMy9_1Dlg::OnCheck1()
{
// TODO: Add your control notification handler code here
if(m_chk1.GetCheck()>0)
m_chk1.SetCheck(0);
else
m_chk1.SetCheck(1);
}
编译错误是:D:\编程\9_1\9_1Dlg.cpp(198) : error C2228: left of '.SetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(205) : error C2228: left of '.GetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(206) : error C2228: left of '.SetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(208) : error C2228: left of '.SetCheck' must have class/struct/union type
执行 cl.exe 时出错. 展开
void CMy9_1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
m_btn1.SetWindowText("你已按下了按钮!");
}
void CMy9_1Dlg::OnButton2()
{
// TODO: Add your control notification handler code here
m_btn2.SetWindowText("按钮已被按下!");
}
void CMy9_1Dlg::OnRadio1()
{
// TODO: Add your control notification handler code here
m_rad1.SetCheck(1);
}
void CMy9_1Dlg::OnCheck1()
{
// TODO: Add your control notification handler code here
if(m_chk1.GetCheck()>0)
m_chk1.SetCheck(0);
else
m_chk1.SetCheck(1);
}
编译错误是:D:\编程\9_1\9_1Dlg.cpp(198) : error C2228: left of '.SetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(205) : error C2228: left of '.GetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(206) : error C2228: left of '.SetCheck' must have class/struct/union type
D:\编程\9_1\9_1Dlg.cpp(208) : error C2228: left of '.SetCheck' must have class/struct/union type
执行 cl.exe 时出错. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询