关于AfxBeginThread参数LPVOID pParam的疑点
关于AfxBeginThread参数LPVOID pParam的疑问
AfxBeginThread((AFX_THREADPROC)CcommucationDlg::threadrecv,this);
注释掉的那一行和上面两句怎么理解都是一样的,为啥注释掉的那行编译器会报错?
------解决方案--------------------
写成这样呢:
nRead=((CcommucationDlg*)pParam)->m_socket->Receive(buff,6999);
AfxBeginThread((AFX_THREADPROC)CcommucationDlg::threadrecv,this);
int CcommucationDlg::threadrecv(LPVOID pParam)
{
BYTE buff[70000]={0};
int nRead;
CcommucationDlg* threadDlg=(CcommucationDlg*)pParam;
nRead=threadDlg->m_socket->Receive(buff,6999);
//nRead=(CcommucationDlg*)pParam->m_socket->Receive(buff,6999);
return 0;
}
注释掉的那一行和上面两句怎么理解都是一样的,为啥注释掉的那行编译器会报错?
------解决方案--------------------
写成这样呢:
nRead=((CcommucationDlg*)pParam)->m_socket->Receive(buff,6999);