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;

[877 byte] By [efratian] at [2007-12-25]
# 1
This has been fixed in Vista RC1.
efratian at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified