1,众所周知使用CAsyncSocket类需要预编译头文件afxsock.h,并且使用函数AfxSocketInit()对Winsock对象进行初始化,请问CAsyncSocket类指定的是什么版本的Winsock?是不是1.1的?
2,如果使用Winsock2则要预编译头文件Winsock2.h,我在参考一些资料的时候发现,程序使用的是CAsyncSocket类,而在成员函数GetIP()中通过WSAStartup()直接指定了Winsock版本为2.0,根本没有预编译头文件Winsock2.h啊,是否存在某种情况使用Winsock2也不必预编译头文件Winsock2.h?3Q
2,如果使用Winsock2则要预编译头文件Winsock2.h,我在参考一些资料的时候发现,程序使用的是CAsyncSocket类,而在成员函数GetIP()中通过WSAStartup()直接指定了Winsock版本为2.0,根本没有预编译头文件Winsock2.h啊,是否存在某种情况使用Winsock2也不必预编译头文件Winsock2.h?3Q
解决方案 »
- http底层是通过socket实现的吗?
- 请教PreTranslateMessage
- 在线等待__我想问写MFC语法的问题
- 本机如何通过以太网打开另一台机器上的应用程序?
- about UNICODE
- 为什么我用send发送字符串会出错
- *** 一段定时开机的代码,有兴趣的赶进来---还请汇编高手讲解***
- 如何像Paritition Magic那样在Windows下访问物理扇区??
- 急呀急呀,这个图像问题怎么解决呀
- 请教:ExcuteSQL("...ADD TABLE MY")不能用,ExcuteSQL("...CREATE TABLE MY(MY CHAR(10));")能用,WHY??
- ==50分小问题:怎么才能确定当前鼠标是在某个程序的菜单上?内详==
- 怎样编程来改变文档的类容和后缀名
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.#ifndef __AFXSOCK_H__
#define __AFXSOCK_H__#pragma once#ifdef _AFX_NO_SOCKET_SUPPORT
#error Windows Sockets classes not supported in this library variant.
#endif#ifndef __AFXWIN_H__
#include <afxwin.h>
#endif#if _WIN32_WINNT >= 0x0502
#include <atlsocket.h>
#else
#include <winsock2.h>
#include <mswsock.h>
#endif // _WIN32_WINNT#ifndef _WINSOCK2API_
#ifdef _WINSOCKAPI_
#error MFC requires use of Winsock2.h
#endif
#endif#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif#ifndef _AFX_NOFORCE_LIBS/////////////////////////////////////////////////////////////////////////////
// Win32 libraries#pragma comment(lib, "wsock32.lib")#endif //!_AFX_NOFORCE_LIBS/////////////////////////////////////////////////////////////////////////////#ifdef _AFX_PACKING
#pragma pack(push, _AFX_PACKING)
#endif