
各位高手好,我有一VC++6.0程序在调试时总是遇到错误,请各位高手帮忙,非常感谢。
提示的错误如下:G:\c++exercise\CompuInfo1\InfoDlg.cpp(62):errorC2072:'CPUType':initialization...
提示的错误如下:
G:\c++exercise\CompuInfo1\InfoDlg.cpp(62) : error C2072: 'CPUType' : initialization of a function
G:\c++exercise\CompuInfo1\InfoDlg.cpp(71) : error C2509: 'OnInitDialog' : member function not declared in 'CInfoDlg'
g:\c++exercise\compuinfo1\infodlg.h(13) : see declaration of 'CInfoDlg'
G:\c++exercise\CompuInfo1\InfoDlg.cpp(102) : error C2039: 'OnBtnReset' : is not a member of 'CInfoDlg'
g:\c++exercise\compuinfo1\infodlg.h(13) : see declaration of 'CInfoDlg'
G:\c++exercise\CompuInfo1\InfoDlg.cpp(103) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Error executing cl.exe.
CompuInfo1.exe - 4 error(s), 0 warning(s)
其中的部分代码如下,
//预定义列表框的字符串数组
static CString CPUType()=
{
"AMD K5", "Intel Pentium","Cyrix Mll",
"AMD K6", "Intel Pentium Pro","AMD K6-2",
"Intel Celeron","Intel Pentium2","Intel Pentium3",
};
BOOL CInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//为列表框添加选项
for(int i=0;i<=8;i++)
{
m_LstCPU.AddString(CPUType(i));
}
m_LstCPU.SelectString(-1,m_szCPU);
//为组合可添加选项
m_CmbHDD.AddString("1.2G");
m_CmbHDD.AddString("1.7G");
m_CmbHDD.AddString("2.1G");
m_CmbHDD.AddString("3.2G");
m_CmbHDD.AddString("6.4G");
m_CmbHDD.AddString("10G");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
} 展开
G:\c++exercise\CompuInfo1\InfoDlg.cpp(62) : error C2072: 'CPUType' : initialization of a function
G:\c++exercise\CompuInfo1\InfoDlg.cpp(71) : error C2509: 'OnInitDialog' : member function not declared in 'CInfoDlg'
g:\c++exercise\compuinfo1\infodlg.h(13) : see declaration of 'CInfoDlg'
G:\c++exercise\CompuInfo1\InfoDlg.cpp(102) : error C2039: 'OnBtnReset' : is not a member of 'CInfoDlg'
g:\c++exercise\compuinfo1\infodlg.h(13) : see declaration of 'CInfoDlg'
G:\c++exercise\CompuInfo1\InfoDlg.cpp(103) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Error executing cl.exe.
CompuInfo1.exe - 4 error(s), 0 warning(s)
其中的部分代码如下,
//预定义列表框的字符串数组
static CString CPUType()=
{
"AMD K5", "Intel Pentium","Cyrix Mll",
"AMD K6", "Intel Pentium Pro","AMD K6-2",
"Intel Celeron","Intel Pentium2","Intel Pentium3",
};
BOOL CInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//为列表框添加选项
for(int i=0;i<=8;i++)
{
m_LstCPU.AddString(CPUType(i));
}
m_LstCPU.SelectString(-1,m_szCPU);
//为组合可添加选项
m_CmbHDD.AddString("1.2G");
m_CmbHDD.AddString("1.7G");
m_CmbHDD.AddString("2.1G");
m_CmbHDD.AddString("3.2G");
m_CmbHDD.AddString("6.4G");
m_CmbHDD.AddString("10G");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
} 展开
1个回答
展开全部
static LPCSTR CPUType[]=

2025-08-11 广告
正版Hyperworks软件多少钱,购买正版Hyperworks软件,免费咨询Altair Hyperworks软件中国区网站首页,HyperWorks软件提供了完整的CAE有限元分析解决方案,免费试用和咨询官网。...
点击进入详情页
本回答由名片提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询