Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling a COM-DLL with Matlab - how to pass a pointer to a method?

4 views
Skip to first unread message

Susanne Fiebig

unread,
Apr 30, 2008, 7:27:01 AM4/30/08
to
Hi there!

I'm trying to read data from a ccd camera (Apogee Alta)
using Matlab (R2007b) and a COM(ActiveX)-DLL provided by the
manufacturer. The DLL provides a method "GetImage(long
pImageBuffer)" which according to the camera software
documentation "returns a pointer to a previously-allocated
region of memory (allocated by the calling application) that
will be filled with image data". Matlab recognizes this
method as "GetImage = void GetImage(handle, int32)".
The problem is: I have no idea how to pass the
pointer/int32. I've tried all kinds of stuff to call
GetImage, for example:
* a = zeros(2048); libpointer ('int32Ptr',a); h.GetImage(b);
* a = zeros(2048); h.GetImage(a(1));
but nothing seems to work, and the error messages didn't
help either.
Does anybody have an idea what I have to do here?

Thanks a lot!

Christopher Wilcox

unread,
Nov 16, 2009, 5:28:02 PM11/16/09
to
Hello, I don't know if you've figured this issue out, but I came across the same problem. The best way to get the image off of this camera is to use the line:
a=h.Image
instead of GetImage(*pointer)
Then 'a' has your image data and you can see it with imagesc(a). No pointers needed.

Chris

"Susanne Fiebig" <s-sizar...@vf.uni-konstanz.de> wrote in message <fv9l25$ioo$1...@fred.mathworks.com>...

0 new messages