Board index » delphi » PChar / String / Varient / dynamic-array through CORBA

PChar / String / Varient / dynamic-array through CORBA

Hi,
i need to transfer a string over CORBA, but i have in the string "#0" chars,
so i can't use PChar (null terminated).
i tried to transfer strings, but delphi have a bug in declaring strings in
the type library editor.
so i might use dynamic array, but how do declare it, and how the other side
will know the size of it.
or i can use varient, but then do i need to wrap it someway ?
if varient - what do i need to do in the client side (C++) - what is varient
in C++ ?

thanks,
shay

 

Re:PChar / String / Varient / dynamic-array through CORBA


<<Shay:
if varient - what do i need to do in the client side (C++)
- what is varient in C++ ?

Quote

SafeArrays, or PSafeArrays. Strictly, if you create a
variant array:
  VA := VarArrayCreate([0, 1], varOleStr);
you can then cast it to a PSafeArray
  PSafeArray(TVarData(VA).VArray)
and you can use that in API safearray calls, e.g.
  SafeArrayCopy(PSafeArray(TVarData(VA).VArray), PSA);

--
Deborah Pate

Re:PChar / String / Varient / dynamic-array through CORBA


is there a different way than Variants ?

shay

Quote
Deborah Pate <d.p...@cableinet.co.not-this-bit.uk> wrote in message

news:VA.000001d6.00b33ea0@cableinet.co.not-this-bit.uk...
Quote
> <<Shay:
> if varient - what do i need to do in the client side (C++)
> - what is varient in C++ ?

> SafeArrays, or PSafeArrays. Strictly, if you create a
> variant array:
>   VA := VarArrayCreate([0, 1], varOleStr);
> you can then cast it to a PSafeArray
>   PSafeArray(TVarData(VA).VArray)
> and you can use that in API safearray calls, e.g.
>   SafeArrayCopy(PSafeArray(TVarData(VA).VArray), PSA);

> --
> Deborah Pate

Other Threads