BUG: Error 14007 When You Create a Socket Using AF_IRDA (266241)



The information in this article applies to:

  • Microsoft Windows CE Platform SDK for Handheld PC 3.0
  • Microsoft Windows CE Platform SDK for Palm-size PC 1.2
  • Microsoft Windows CE Platform Builder 2.11
  • Microsoft Windows CE Platform Builder 2.12

This article was previously published under Q266241

SYMPTOMS

When you call the Socket function and specify AF_IRDA as the address family, the function fails, and the WSAGetLastError function returns 14007 (WSAEAFNOSUPPORT - The specified address family is not supported).

This error occurs only for platforms that are built using Windows CE versions 2.11 and 2.12.

CAUSE

A bug in the Microsoft Foundation Classes (MFC) headers incorrectly defines _WIN32_WINDOWS, which causes AF_IRDA to be defined as the desktop IrDA address family constant.

RESOLUTION

To resolve this problem, do the following:
  1. Locate the Afxv_w32.h file in the Mfc\Include folder for the platform to be targeted.
  2. Locate the following line in the file:
    #define _WIN32_WINDOWS 0x0500
    					
  3. Modify this line to read as follows:
    #if !defined(_WIN32_WCE)
    	#define _WIN32_WINDOWS 0x0500
    #endif
    					

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This error occurs only with Platform Software Development Kits (SDKs) for platforms that are built using Windows CE versions 2.11 and 2.12. The only retail targeted platforms that are affected by this problem are the Handheld PC Professional 3.0, and the Palm-size PC 1.2. In addition, any SDKs that are exported from Windows CE Platform Builder versions 2.11 or 2.12 will exhibit this problem.

Modification Type:MajorLast Reviewed:4/15/2004
Keywords:kbbug kbnofix kbWinsock KB266241