犯了一个低级的错误,唉,老了吗?

想用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还是很强大的!!欢迎来和我讨论!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值