MFC Sockets and VISTA Beta2
Dear Newsgroup,
I've got the problem, that CSocket::Create gets the error 0000273F (german
error text: "Es wurde eine Adresse verwendet, die mit dem angeforderten
Protokoll nicht kompatibel ist.")
if the program uses MFC DLL in a shared library with Vista Beta2 (Build
5384).
To reproduce the behaviour:
- create MFC project (I've done it with VC6)
- use MFC in a shared library (_AFXDLL defined!)
- activate Windows Sockets
Put the following code into a function:
-----------------------------------------------------------------
CSocket *s = new CSocket ();
if ( 0 == s->Create ( ))
{
LPVOID lpMsgBuf;
DWORD dwErrorNo = GetLastError();
if ( 0 == dwErrorNo)
return;
FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dwErrorNo,
MAKELANGID ( LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL);
CString szMessage;
szMessage.Format ( "%s (%.8X)", (LPCTSTR)lpMsgBuf, dwErrorNo);
MessageBox ( szMessage, "huhu", MB_ICONSTOP);
LocalFree ( lpMsgBuf);
return;
}
-----------------------------------------------------------------
Is it a bug in MFC rundll for Vista? I don't want to give up the shared MFC
library (it works, if I do static linking).
Thanks,
Axel.