CAsyncSocket does not work on Vista
The following tiny program fails with WSAEAFNOSUPPORT (10047) on Vista Beta 2 (build 5384), when built in Release mode using MFC in a Shared DLL. It works on XP, earlier Vista builds, Debug MFC DLL, and when using MFC in a Static Library. As a result, CAsyncSocket is basically dead, and our app has stopped working. Microsoft, help!!!
#include <afxwin.h>
#include <afxsock.h>
class CMyApp : public CWinApp {
public:
virtual BOOL InitInstance();
};
BOOL CMyApp::InitInstance() {
WSADATA wsaData;
AfxSocketInit(&wsaData);
CAsyncSocket s;
if (!s.Create()) {
char buf[100];
sprintf(buf, "CAsyncSocket::Create() failed, error %u", WSAGetLastError());
MessageBox(NULL, buf, "socket", 0);
return FALSE;
}
return TRUE;
}
CMyApp app;

