如何在一个线程中对ListBox控件进行操作?
我传递了CListBox指针变量,但是编译不通过。
error C2275: 'CListBox' : illegal use of this type as an expression
E:\Microsoft Visual Studio 8\VC\ce\atlmfc\include\afxwin.h(3382) : see declaration of 'CListBox'
BOOL CDlgVCOM::OnInitDialog()
{
...(略)
CListBox *pListBox=static_cast<CListBox*>(GetDlgItem(IDC_LIST1));
HANDLE hThread=CreateThread(NULL,0,ReceiveThread,pListBox,0,NULL);
...(略)
}
DWORD WINAPI ReceiveThread(PVOID pArg)
{
DWORD cBytes;
CListBox p=(*CListBox)pArg;
...(略)
return 0;
}
恳请指点!