Jump to content
Sign in to follow this  

COM function returns 2d array

Recommended Posts



I'm trying to write an AutoIt interface to a frame grabber card I have at work. The card grabs an image from a camera and places it in a buffer. There's an ActiveX interface to it, which I've succeeding in getting AutoIt to talk to.

The card generates an event, onFrameComplete, which passes a DTBuffer object to an AutoIt function. This works, since I can access properties like DTBuffer.Width and get the right answer. There is a method GetData which returns a 2d array corresponding to the image in the buffer. But the variable returned by this does not have the correct structure.

i.e. $data = $buffer.GetData()

IsArray ($data) returns 1 - so it is an array

However - UBound ($data, 0) returns 0. This should be 2 - the number of dimensions. But it isn't. What's going on? Is it a pointer to an array or something? Is this a limitation of AutoIt, that it can't handle arrays returned by COM objects? Or am I doing something else wrong?


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.