Jump to content
Sign in to follow this  
tatane

How to store Objects in an array ?

Recommended Posts

tatane

Hi,

I am using a COM Object from a dll (vncx.dll) and would like to store about 20 objects ($var = ObjCreate("VNCX.VNCViewer"))  in a 2 dimensional array.

It seems the return value of ObjCreate stored in the array is empty. Is it normal ?

Should I use another way ? I don't know how to keep track of this generated objects...

 

Thanks.

Share this post


Link to post
Share on other sites
Danp2

It should work just like it does with a normal variable. You just have to indicate which position in the array you want to store the object, ie -

$var = ObjCreate("VNCX.VNCViewer"))

becomes

$myarray[0] = ObjCreate("VNCX.VNCViewer"))
$myarray[1] = ObjCreate("VNCX.VNCViewer"))

If you still have questions, show us your code so that we can see what you have tried thus far.

Share this post


Link to post
Share on other sites
tatane
Posted (edited)

EDIT : My bad, it works !

I was fooled by a COM error "Variable must be of type 'Object'" after reading an empty row of my array...

And _ArrayDisplay() is not able to show the value of this object (empty cell).

Thank you for your help !

Edited by tatane

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×