服务器端运行时,老是说不能把ReceiveFrom()的第一个参数转换成Void*,但我试着转化了,还是不行,求指导。。。。。。
坏坏11 2013-03-25 08:49:54 void CSocSvrDlg::OnBTNReceive()
{
// TODO: Add your control notification handler code here
SOCKADDR_IN addrClient;
int len=sizeof(SOCKADDR);
CString strReceive;
m_pCSocReceive->ReceiveFrom(strReceive,strReceive.GetLength()+1,(SOCKADDR*)&addrClient,sizeof(SOCKADDR),0);//获得客户端传来的消息
m_edt_Receive.GetWindowText(strReceive);//添加到编辑框
m_edt_Receive.SetWindowText(strReceive);//显示出来
}
F:\bb\SocSvr\SocSvrDlg.cpp(200) : error C2664: 'int __thiscall CAsyncSocket::ReceiveFrom(void *,int,class CString &,unsigned int &,int)' : cannot convert parameter 1 from 'class CString' to 'void *'