简体   繁体   English

WS_CPLUSPLUS与WWSAPI

[英]WS_CPLUSPLUS with WWSAPI

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. 我正在使用WWSAPI(WCF托管)实现相对复杂的对象模型服务,并已成功下载了wsdl和代码生成的服务实现。 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. 在它们内部是我的服务有效负载的C ++对象表示,它将更容易使用,但是当我定义WS_CPLUSPLUS时,编译器上的所有类型的中断都会松散。

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. 好的,在挖掘了sdk样本后回答了我自己的问题。

Once you generate the schema and wsdl files and import them into your project do the following: 生成模式和wsdl文件并将其导入项目后,请执行以下操作:

  • Select all of the generated .c files, and right click -> properties 选择所有生成的.c文件,然后右键单击 - >属性
  • 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)" 在[高级]部分:将[编译为]更改为“编译为C ++代码(/ TP)”

Once you do this, you should successfully be able to add the "WS_CPLUSPLUS" preprocessor definition. 完成此操作后,您应该能够成功添加“WS_CPLUSPLUS”预处理器定义。 I hope this can help brighten someones day 我希望这可以帮助照亮某人的一天

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM