在某个线程里我想为LISTbox添加线程!结果如下
方法一 m_list1.AddString("1");
报错: left of '.AddString' must have class/struct/union type
方法二 (pParlPro->GetDlgItem(IDC_LIST1))->AddString("1");
报错: 'AddString' : is not a member of 'CWnd'
方法三 ((CComboBox *)GetDlgItem(IDC_COMBO_PARITY))->InsertString(0,"1");
报错: 'CWnd::GetDlgItem' : illegal call of non-static member function
left of '->InsertString' must point to class/struct/union
我该怎么添加呢!?本人菜鸟,牛人莫笑!
方法一 m_list1.AddString("1");
报错: left of '.AddString' must have class/struct/union type
方法二 (pParlPro->GetDlgItem(IDC_LIST1))->AddString("1");
报错: 'AddString' : is not a member of 'CWnd'
方法三 ((CComboBox *)GetDlgItem(IDC_COMBO_PARITY))->InsertString(0,"1");
报错: 'CWnd::GetDlgItem' : illegal call of non-static member function
left of '->InsertString' must point to class/struct/union
我该怎么添加呢!?本人菜鸟,牛人莫笑!
static DWORD __stdcall StatusThread( LPVOID lpparam );实现
DWORD CMainFrame::StatusThread( LPVOID lpparam )
{
CMainFrame *pthis = ( CMainFrame * )lpparam;调用
DWORD thread;
threadid = ::CreateThread( NULL, 0, statusthread, this, 0, &thread );
static UINT ProDispThread(LPVOID pParam);//数据显示线程CMyDlg* pParlPro=(CMyDlg*)pParam;
不过我没有类似你调用的代码。
UINT的调用和双字节的一样吗?
((Clistctrl *)pParlPro->GetDlgItem(IDC_LIST1))->AddString("1");
报错: 'CWnd::GetDlgItem' : illegal call of non-static member function
left of '->InsertString' must point to class/struct/union
试试这样:pParlPro->m_list1.InsertItem(0, "1");