Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Passing arrays of structs from C# web service to raw C++?

Thread Tools

Passing arrays of structs from C# web service to raw C++?

Posts: n/a
I have a C# webservice that returns an array of struct data back to a
calling client.

It works fine when tested via the ASMX page; however, I don't know how to
make the call to this particular method from C++.

If my web method is declared as:

public MyStruct[] GetData()

and returns back a web service allocated array of structs, how do I call
this from C++?

Intellisense tells me that the signature (to C++) is:

GetData( MyService::MyStruct** GetDataResult, int* GetDataResult_nSizeIs )

How am I supposed to be declaring the C++ local variable I want the results
returned in?

Am I supposed to pre-allocate an array of structs to receive the data?
Am I supposed to supply an array of struct pointers and then I'm responsible
for releasing them?

I am having a hard time finding documentation on this...


Reply With Quote
Posts: n/a
This is weird.

The auto-generated SOAP code in my C++ ATL project acts like it expects a
pre-allocated array and then proceeds to act like it does not...

I can get the values if I just declare

MyService::MyStruct* l_pStruct;

and then iterate it via:


Is that how I'm supposed to be going through these values?
Seems like a great way to leak memory.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions, arrays, structs and passing by reference S. C Programming 7 05-12-2008 07:41 AM
Array of structs instead of an array with pointers to structs? Paminu C Programming 5 10-11-2005 07:18 PM
passing structs (setializable) object in web service Stacy Meir ASP .Net Web Services 3 01-03-2005 06:57 PM
const structs in other structs Chris Hauxwell C Programming 6 04-27-2004 07:03 PM
structs with fields that are structs Patricia Van Hise C Programming 5 04-05-2004 01:37 AM