开发者

WS_CPLUSPLUS with WWSAPI

开发者 https://www.devze.com 2023-03-25 15:58 出处:网络
I am implementing a relatively complex object model service using WWSAPI (WCF hosted) and have successfully downloaded the wsdl and code gen\'d the service implementation. My question is, has anyone e

I am implementing a relatively complex object model service using WWSAPI (WCF hosted) and have successfully downloaded the wsdl and code gen'd the service implementation. My question is, has anyone else noticed all of the

#if defined(WS_CPLUSPLUS)

defines littered throughout the generated code? Inside them is a C++ object representation of my service payload that would be 100x easier to use, however开发者_开发百科 when I define WS_CPLUSPLUS all sorts of bad breaks loose on the compiler.

My question is this: Has anyone successfully gotten that define to work, and if so, what resource or example did you use to get it to work?


Ok, answered my own question after digging through the sdk samples.

Once you generate the schema and wsdl files and import them into your project do the following:

  • Select all of the generated .c files, and right click -> properties
  • In the [Precompiled Headers] section: Change [Precompiled Header] to "Not Using Precompiled Headers"
  • In the [Advanced] section: Change [Compile As] to "Compile as C++ Code (/TP)"

Once you do this, you should successfully be able to add the "WS_CPLUSPLUS" preprocessor definition. I hope this can help brighten someones day

0

精彩评论

暂无评论...
验证码 换一张
取 消