a=inet_addr((const char*)strIP.GetBuffer()); a = htonl(a);//to network order struct hostent* host=gethostbyaddr((char*)&a,4,AF_INET);struct hostent* FAR gethostbyaddr( __in const char *addr, __in int len, __in int type ); Parameters addr [in] A pointer to an address in network byte order. len [in] The length, in bytes, of the address.type [in] The type of the address, such as the AF_INET address family type (used with TCP, UDP, and other associated Internet protocols). Possible values for the address family are defined in the Winsock2.h header file. On the Windows SDK released for Windows Vista and later,, the organization of header files has changed and the possible values for the address family are defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly.
1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\Neighbor.exe.embed.manifest". Bpcn上述错误是改变字符集(改变成多字节字符集)之后生成的(我用的是vs2005),直接运行没有问题,可是总是有这个错误产生,很不爽,求解
查看一下WSAGetLastError()函数的返回值是什么?
gethostbyaddr 好像只有 ANSI 。 6楼多半说的对!
难道是我说的不够明白?将工程设置为多字节之后直接运行是可以的,但是编译的时候会出现 1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\Neighbor.exe.embed.manifest". Bpcn错误,求解!!!
a=inet_addr((const char*)strIP.GetBuffer());
a = htonl(a);//to network order
struct hostent* host=gethostbyaddr((char*)&a,4,AF_INET);struct hostent* FAR gethostbyaddr(
__in const char *addr,
__in int len,
__in int type
);
Parameters
addr [in]
A pointer to an address in network byte order.
len [in]
The length, in bytes, of the address.type [in]
The type of the address, such as the AF_INET address family type (used with TCP, UDP, and other associated Internet protocols). Possible values for the address family are defined in the Winsock2.h header file. On the Windows SDK released for Windows Vista and later,, the organization of header files has changed and the possible values for the address family are defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly.
GetDlgItemText(IDC_IP,strIP);取得的字符串是Unicode字符串。需要转换成为多字节字符串。
使用这个函数WideCharToMultiByte进行转换即可。
具体参数用法请查阅MSDN。
6楼多半说的对!
1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\Neighbor.exe.embed.manifest". Bpcn错误,求解!!!