首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

WIN7 VS2012 无法识别DisconnetEx函数解决方法

2013-11-14 
WIN7 VS2012 无法识别DisconnetEx函数我的系统是win7 64位的,VS2012,#include Mswsock.h#include strin

WIN7 VS2012 无法识别DisconnetEx函数
我的系统是win7 64位的,VS2012,

#include <Mswsock.h>
#include <string>

#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib,"mswsock.lib")
.....................................
使用:
DisconnectEx(sendskt,pOverLapEx->m_OLap,TF_REUSE_SOCKET,0);
居然报错:
DisconnectEx:找不到标识符 

弄一个SOCKET池
我想断开SOCKET而不销毁SOCKET,如果DisconnectEx不行,还可以用那个
[解决办法]
这个函数要先加载
MSDN:
Note  The function pointer for the DisconnectEx function must be obtained at run time by making a call to the WSAIoctl function with the SIO_GET_EXTENSION_FUNCTION_POINTER opcode specified. The input buffer passed to the WSAIoctl function must contain WSAID_DISCONNECTEX, a globally unique identifier (GUID) whose value identifies the DisconnectEx extension function. On success, the output returned by the WSAIoctl function contains a pointer to the DisconnectEx function. The WSAID_DISCONNECTEX GUID is defined in the Mswsock.h header file.

热点排行