用下面的代码试试:
m_listctrl 声明成CListCtrl* m_pListCtrl;
void CPingThread::StartPing(UINT nRetries,CString strHost, CListCtrl listctrl)
{
m_nRetries = nRetries;
m_strHost = strHost;
m_pListCtrl = &listctrl;
SetEvent(m_hSignalEvent);
}
C++中不可直接付对象,要通过指针(或地址)。
m_listctrl 声明成CListCtrl* m_pListCtrl;
void CPingThread::StartPing(UINT nRetries,CString strHost, CListCtrl listctrl)
{
m_nRetries = nRetries;
m_strHost = strHost;
m_pListCtrl = &listctrl;
SetEvent(m_hSignalEvent);
}
C++中不可直接付对象,要通过指针(或地址)。
函数中:
要么直接用listctrl,要么
CListCtrl &m_listctrl = listctrl;都是一样操纵该listctrl