VC.NET2003版关于RPC的一个问题
我在.net2002版idl产生的.c文件在编译时没有问题,但在2003版编译后产生了以下了代码
#if !(TARGET_IS_NT50_OR_LATER)
#error You need a Windows 2000 or later to run this stub because it uses these features:
#error /robust command line switch.
#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
#error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
#endif
我在RPCNDR.H中查到了TARGET_IS_NT50_OR_LATER的定义
#if (0x500 <= _WIN32_WINNT)
#define TARGET_IS_NT50_OR_LATER 1
#else
#define TARGET_IS_NT50_OR_LATER 0
#endif
由于我一般对IDL产生的c文件不使用预编译头,因而我在stdafx.h中定义的
#define _WIN32_WINNT 0x500不能使用
我只有在idl产生的c文件头部加入这个定义,由于IDL更新导到每次都要重新写一句这个,有没有别的方法可以不让他出这一句,或者是能让IDL的C文件使用预编译头(如果使用则会出现,查到非常文件结尾,如果加入stdafx.h,则会有很多错误出现)