MFC套接字连接不成功-记得在app的cpp文件里面初始化套接字
stdafx.h文件中添加:#include "afxsock.h"
BOOL CMFC_TCP_Client_chat1App::InitInstance()代码的下面添加如下代码:
if (!AfxSocketInit()) //new added
{
//AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
MFC套接字连接不成功-记得在app的cpp文件里面初始化套接字
stdafx.h文件中添加:#include "afxsock.h"
BOOL CMFC_TCP_Client_chat1App::InitInstance()代码的下面添加如下代码:
if (!AfxSocketInit()) //new added
{
//AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
转载于:https://www.cnblogs.com/txwtech/p/11072318.html