Re:Variant - TVariant
Quote
Panagiotis L. Staikos wrote in message <378477EB.60B59...@ekt.gr>...
>I want to pass from Client to Server some integers values...
>I am trying to create a Variant (as Array of varInteger values) and pass
>it to Server but some problems occured...These problems are new since i
install the
>C++Builder4. >In C++Builder3 all the above works correctly..
Well, something very similar happened to me - but in BCB 3. I have a suite
of Delphi programs which communicate via COM, and the client passes data to
the server as a variant array of byte, as recommended as the fastest way to
get binary data across the process barrier. I have now being training a
BCB 3 program to offer the same interface as the Delphi program, and tried
to use VarArrayLock() on the variant parameter. Well, it was a reference!
So I extracted the reference variant, which was an array, and successfully
called VarArrayLock(). But when I was finished with the pointer, I was
unable to call VarArrayUnlock() with the _same variant_ without being told
that 'Variant is not an array'. Very curious, since the value didn't
change.
I wonder if this has something to do with the construction/destruction
issues involved with variants? Do note that I am using VARIANT and not
TVariant or Variant.
Steve Donovan,
Mining Technology, CSIR South Africa