想用Csocket类实现网络通信,但是xtp并没有提供Socket的初始化,哎,困扰了好几天,终于在水木上有哥们提醒了一下!汗啊!!
标 题: Can't create socket successfully ? 发信站: 水木社区 (Sun Jun 29 16:27:04 2008), 站内 I am using xtp pro 11, VC6 I want to create a SOCKET on the MDI window ,when the program running ,it reported socket create error !! In my project, I create a MDI window which is inherited from CXTPMDIFrameWnd, but ,when I wanted created a socket on the child window , although the building is passed , running error displayed !! It was: Can't create socket successfully!The code followed here: CAsyncSocket*pSocket=new CAsyncSocket; int nPort=27; if (pSocket->Create(nPort,SOCK_DGRAM)) { AfxMessageBox("passed"); }else { AfxMessageBox("SOCKET_ERROR"); } Why I can't create socket ? Created socket in the child window ,the error displayed as the same.
标 题: Re: Can't create socket successfully ? 发信站: 水木社区 (Sun Jun 29 17:15:30 2008), 站内 如果项目中没有设置winsock支持,就要手动调用AfxSocketInit来初始化
*************************************************************************
好了,解决了!
xtp还是很强大的!!欢迎来和我讨论!