在CConferenceDialog对话框建立了派生于CListCtrlEX类的m_olist控件,
然后在CMainFrame.h中声明
CConferenceDialog dlgBar;
在CMainFrame.cpp中的代码是:
void CMainFrame::OnAddMember(WPARAM wParam, LPARAM lParam)
{
CString* pStr = (CString*)wParam;
this->dlgBar.m_olist.SetItemText((short)lParam, pStr->GetBuffer(0), NULL);
pStr->ReleaseBuffer();
}
CMainFrame::OnRemoveMember(WPARAM wParam, LPARAM lParam)
{
CString* pStr = (CString*)wParam;
if(!pStr->CompareNoCase("DUMP"))
this->dlgBar.m_olist.DeleteAllItems();
else
this->dlgBar.m_olist.Remove(pStr->GetBuffer(0));
pStr->ReleaseBuffer();
}
编译出错:
C:\MainFrm.cpp(1273) : warning C4101: 'sz' : unreferenced local variable
C:\MainFrm.cpp(2663) : error C2664: 'SetItemText' : cannot convert parameter 2 from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\MainFrm.cpp(2673) : error C2039: 'Remove' : is not a member of 'CListCtrlEx'
c:\listctrlex.h(13) : see declaration of 'CListCtrlEx'
不知是什么问题,请高手出招,谢谢!!