Variant to array ??

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top