[fpc-pascal] Re: Array of byte from a COM object
md at delfire.net
Thu Jun 9 17:21:18 CEST 2011
On Thu, Jun 9, 2011 at 11:26 AM, Marcos Douglas <md at delfire.net> wrote:
> How I can a return "array of byte" from a COM object and put in a Stream?
> I use a OleVariant variable to get the return. But I can not convert
> in a string (the return is a XML).
I did using this function:
procedure VariantToStream(const V: OleVariant; const Stream: TStream);
Assert(VarType(V) = varByte or varArray);
Assert(VarArrayDimCount(V) = 1);
L := VarArrayHighBound(V, 1) - VarArrayLowBound(V, 1) + 1;
Stream.Size := L;
Stream.Position := 0;
P := VarArrayLock(V);
More information about the fpc-pascal