Variant to array ??

  • Thread starter Thread starter Adi Lazar
  • Start date Start date
A

Adi Lazar

Hi,

I'm using an ActiveX control that has a read/write property named
InsertionPoint (type = object). In the ActiveX documentation : Variant
(three-element array of doubles);

I can write to it :
double[] insertPoint = new double[]{2, 5, 1};
myObj.InsertionPoint = insertPoint; => works fine !!!

BUT, I didn't figure out how to read it in a array of doubles
object result = myObj.InsertionPoint;

How can be cast to a double[] ?

I need a solution in Csharp or, at least, in VB.NET.


Thanks for any advice.
 
Adi,

Assuming that it will return an array of doubles, you should be able to
just cast, like so:

double[] results = (double[]) myObj.InsertionPoint;

Hope this helps.
 
Back
Top