代码如下:
CMySocket* sockServer;
CListBox m_lstStatus;
.......
.......sockServer=new CMySocket(this);
if(sockServer->Create(4000))
m_lstStatus.AddString("Creating");
else {
strerr.Format("%i",GetLastError());
m_lstStatus.AddString(strerr);
}
CMySocket* sockServer;
CListBox m_lstStatus;
.......
.......sockServer=new CMySocket(this);
if(sockServer->Create(4000))
m_lstStatus.AddString("Creating");
else {
strerr.Format("%i",GetLastError());
m_lstStatus.AddString(strerr);
}
解决方案 »
- sendmessage postmessage 的问题继续 力求解释~~~~标题要长。。。。。。。。。。。。。。。。。。。。。。
- 如何除去CWnd主窗口边界线!
- Visual Assist X V10.2.1437.0 这个版本的那位大大用过,感觉如何?
- 一个有关制作帮助文件的问题?
- HWND_TOPMOST怎么会失效?
- 新手请教关于VARIANT的数据类型的使用,请给于帮助!
- 刚刚开始学习atl,有点困惑,请过来人指教。
- 高薪招聘逆向调试人员!年薪10万,待遇绝对优厚!
- 一群用户评价多个多属性个体,数据应该采用怎样的格式存储?当加入新的数据时,怎样替换利用率低的信息?
- 请英语高手帮我翻译一下这段话,谢谢先!
- _T是什么
- 请问哪里有《wndows核心编程》的代码?
(10093)
Successful WSAStartup not yet performed.
Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times. 应该是在你的:
...App::InitInstance()
中添加上: if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}因为要使用Winsock需要初始化,楼上兄弟的说法也正确,那是在SDK编程中初始化的方法,用MFC的话,就使用函数AfxSocketInit()就OK了
必须手动添加初始化代码
#include <afxsock.h>
AfxSocketInit();