Bitmap in VB -> ATL COM object 
Author Message
 Bitmap in VB -> ATL COM object

How can I pass a handle to a bitmap from VB to a COM object?  I've set
up a COM interface with the method Analyze(HBITMAP hImage).  When I call
this method from VB, I get the error "Automation type not supported in
Visual Basic."  I try calling it with the line

Call MyObject.Analyze(MyPictureBox.Image)

Any idea what I could be doing wrong?  Or maybe there is a better way to
attack this.  I'm trying to do some image processing on .bmp files, and
I need to modify the image and redraw it while processing.  My thought
was to load the file in VB, and pass a bitmap object to my Analyze
function, where I can use CBitmap to gain access to the pixel data.
Then while I process the image, I can (hopefully) easily redraw the
image.

Any help would be greatly appreciated.

Pat Noffke



Fri, 21 Sep 2001 03:00:00 GMT  
 Bitmap in VB -> ATL COM object
Patrick,

The typelib must use LONG as the data type, otherwise VB won't be able to
use it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s) so
that everyone can benefit from the discussion.

Regards,

Klaus H. Probst, MCP

       ICQ: 22454937
      The VB Box: http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Quote:
> How can I pass a handle to a bitmap from VB to a COM object?  I've set
> up a COM interface with the method Analyze(HBITMAP hImage).  When I call
> this method from VB, I get the error "Automation type not supported in
> Visual Basic."  I try calling it with the line

> Call MyObject.Analyze(MyPictureBox.Image)

> Any idea what I could be doing wrong?  Or maybe there is a better way to
> attack this.  I'm trying to do some image processing on .bmp files, and
> I need to modify the image and redraw it while processing.  My thought
> was to load the file in VB, and pass a bitmap object to my Analyze
> function, where I can use CBitmap to gain access to the pixel data.
> Then while I process the image, I can (hopefully) easily redraw the
> image.

> Any help would be greatly appreciated.

> Pat Noffke



Fri, 21 Sep 2001 03:00:00 GMT  
 Bitmap in VB -> ATL COM object
Patrick,

    What you probably want to do is to take a picture object from VB, and
work on that.  If that is the case, then have the parameter take a pointer
to IPictureDisp, which is the interface that is implemented for Picture
objects in VB.  From that, you can QueryInterface for the IPicture
interface.  Everything you need is there.  You can call get_Handle to get
the actual Bitmap (or cursor, or metafile) and work on it from there.

- Nicholas Paldino



Fri, 21 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Bitmap in VB -> ATL COM object

2. passing com/atl object in vb

3. ATL COM object in VB w/DAO runs out of Stack Space

4. Accessing ATL COM object from V.S. 2003 Embedded VB.NET app

5. Call VB DLL or COM object from within VB COM object or EXE

6. Using ATL COM objects with scripting languages

7. Handling events fired from an ATL COM object in VBScript

8. ATL COM Object

9. RFH (Newbie): Objects with ATL COM-server / VBE-client (EXCEL97)

10. Arrays from ATL COM object

11. com object will not read registry when com object called from asp (vb works fine)

12. ATL COM and VB.NET

 

 
Powered by phpBB® Forum Software