Variant, VARIANT, TagVariant, TVariant, OleVariant...

I'm completely confused with all these variant types in Borland.
Some of them have different functions and are incompatible with
others... what's up with that?

I'm trying to use the MSComm ActiveX component in my builder
application to do some quick RS-232C communications, but it looks like
I got more than I bargained for.

The premise seems simple enough:

OleVariant V;
... // do something to V
MSComm1->Output = V;

But this is where the simple part ends.  Somehow I have to get an array
of chars into that variant, but every attempt I have made has failed.
I have tried using SAFEARRAYs, and I've tried using V.ArrayLock() and
V.ArrayUnlock(), but it either refuses to compile, or it just starts
spitting out exceptions.

Can anyone send me a simple example that sends an array of chars to the
serial port using MSComm?

Whatever happened to the days when all you needed was the documentation
that came with a software package to use it?

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.