problems marshaling arbitrary sized arrays of structs
- From: "kombat" <ohadpr@xxxxxxxxx>
- Date: 3 Jan 2007 04:17:12 -0800
trying to send back an arbitrary sized array of data from one exe to
another, but only the first item is copied.
here's the idl for the method
HRESULT GetBananas([out] DWORD *numBananas, [out, size_is(,*numTags)]
Banana** bananas);
struct Banana
{
DWORD length;
BSTR favoriteName;
};
In GetBananas I allocate the required memory with CoTaskMemAlloc (or
CoTaskMemRealloc).
Only the first item gets copied, the rest of the items in bananas array
are just garbled stuff...
I assume my IDL declaration is wrong, what's up with it ?
p.s. - just for testing I tried to change the Banana to a DWORD, hence
sending back an array of DWORDs, got the same results, only first item
has meaningful data...
.
- Follow-Ups:
- Re: problems marshaling arbitrary sized arrays of structs
- From: Igor Tandetnik
- Re: problems marshaling arbitrary sized arrays of structs
- Prev by Date: Re: COM object not being released if it created other objects internally...
- Next by Date: Re: COM object not being released if it created other objects internally...
- Previous by thread: Problem in masking a color in HBitmap object
- Next by thread: Re: problems marshaling arbitrary sized arrays of structs
- Index(es):
Relevant Pages
|