Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use axHost.GetPictureFromIPictureDisp???

Status
Not open for further replies.

mHos

Programmer
Mar 3, 2003
19
US
I am using a com object that was created using vb 6. It returns an IPictureDisp object. I need to get the Image from that object. I cannot just use the Microsoft.VisualBasic.Compatibility runtime because in the Visual Studio 2003 it is not allowed to be added as a reference.

I found that if I inherit the System.Windows.Forms.AxHost class, then I can have access to these two functions.

mybase.GetIPictureDispFromImage(image as Image)as Object and
mybase.GetPictureFromIPictureDisp(image as Object)as Image.

I can get/use the GetIPictureDispFromImage just fine, but when I try to use the GetPictureFromIPictureDisp, all I get is an error. the message is : Run-time exception thrown : System.Runtime.InteropServices.COMException - Unknown name.

If you can help me find what is causing this error or another way to get the image from the IPictureDisp without using the above mentioned reference, It would be greatly appreciated.!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top