Board index » cppbuilder » Arrays in DCOM

Arrays in DCOM


2003-09-09 01:32:44 AM
cppbuilder26
Help!!
I'm a beginner COM developer with a big problem:
I need to paste an array of n widestrings from a COM client to my COM
server, using a function like this:
interface IStocks : ...
HRESULT GetStocks ([out] long *nElems, [out] BSTR *pElems)
Where "pElems" is a pointer to an array of widestrings, which have n
elements. The number of elements is defined in "nElems". Both values are
defined from the client application.
How I can make sure all elements points at pElems are marshaled from client
to server when I call this function? In some books, I find the "size_is"
property, but isn't recognized for Borland's compilers (neither Delphi nor
CBuilder).
Thanks a lot!!
 
 

Re:Arrays in DCOM

"Pablo Pedro" < XXXX@XXXXX.COM >wrote in message
Quote
interface IStocks : ...
HRESULT GetStocks ([out] long *nElems, [out] BSTR *pElems)

Where "pElems" is a pointer to an array of widestrings, which have n
elements. The number of elements is defined in "nElems". Both values are
defined from the client application.
pElems is a pointer to a BSTR (WideString) not an array.
So, you can append all your strings into one WideString (delimiting them
somehow), and send that to your server.
Stew