For windows - lose #define _WINSOCKAPI_ and instead do #define WIN32_LEAN_AND_MEAN 1
and maybe simpler and more generic solution. And hope this makes working with atl/vs2k3 easier.