在WTL中调用WebService出现编译错误
VC8
在WTL的项目中(基于windowsMobile),添加WebService后,编译可能会出现
1>C:"Program Files"Microsoft Visual Studio 8"VC"ce"atlmfc"include"atlsocket.inl(59) : error C2589: '(' : illegal token on right side of '::'1>C:"Program Files"Microsoft Visual Studio 8"VC"ce"atlmfc"include"atlsocket.inl(59) : error C2059: syntax error : '::'
1>C:"Program Files"Microsoft Visual Studio 8"VC"ce"atlmfc"include"atlsocket.inl(60) : error C2589: '(' : illegal token on right side of '::'
1>C:"Program Files"Microsoft Visual Studio 8"VC"ce"atlmfc"include"atlsocket.inl(60) : error C2059: syntax error : '::'
类似的错误
解决方法是,在stdafx.h中,在 #include "WebService.h"之前加入
#ifdef lstrlenW
#undef lstrlenW
#endif
重新编译即可通过