注册 登录
编程论坛 VC++/MFC

为什么该程序在VS2005运行时出现以下错误(错误在最后红字)?

kxfei5555w 发布于 2010-10-07 15:25, 843 次点击
BOOL CDlgall::OnInitDialog()
{
    CDialog::OnInitDialog();

    // TODO:  Add extra initialization here

    LV_COLUMN lvc;
        char*display[7]={ "检查号","姓名","日期","性别"};
        lvc.mask=LVCF_FMT|LVCF_TEXT|LVCF_SUBITEM|LVCF_WIDTH;
    lvc.fmt=LVCFMT_LEFT;
    lvc.cx=80;
    for(int i=0;i<7;i++)
    {
        lvc.iSubItem=i;
        lvc.pszText=display[i];
        m_List.InsertColumn(i,&lvc);
    }
m_List.SetExtendedStyle(m_List.GetExtendedStyle()|LVS_EX_FULLROWSELECT)    ;
    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
1>e:\14\14\dlgall.cpp(53) : error C2039: 'InsertColumn' : is not a member of 'CListBox'
1>        c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(3033) : see declaration of 'CListBox'
1>e:\14\14\dlgall.cpp(55) : error C2039: 'SetExtendedStyle' : is not a member of 'CListBox'
1>        c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(3033) : see declaration of 'CListBox'
1>e:\14\14\dlgall.cpp(55) : error C2039: 'GetExtendedStyle' : is not a member of 'CListBox'
1>        c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(3033) : see declaration of 'CListBox'
1>Build log was saved at "file://e:\14\14\Debug\BuildLog.htm"
2 回复
#2
cnfarer2010-10-08 10:30
在VS2005中输入m_list.看看提示有哪些...
#3
kxfei5555w2010-10-09 10:21
回复 2楼 cnfarer
哦,这个关键是我选错控件了。谢谢!
1