all groups > dotnet interop > october 2006 >
You're in the

dotnet interop

group:

IPictureDisp to Image in C#.Net


IPictureDisp to Image in C#.Net vamsiram NO[at]SPAM gmail.com
10/26/2006 6:10:32 PM
dotnet interop: I have a COM dll which exposes the function as shown below
DisplayPic([out] LPPICTUREDISP* pVal, [out] BSTR* text);

When i use the object browser in Visual Studio 2005 this function shows
up as
Sub DisplayPic(pVal As stdole.IPictureDisp, text As String)

I need to convert pVal given as stdole.IPictureDisp to an Image and
save it.

stdole.IPictureDisp disp;
string dispstr;
System.Drawing.Image img = null;
object.DisplayPic(out disp,out dispstr);


The problem i am facing is when i call object.DisplayPic i get an
exception.
I get 1 or 2 below every time i call this function.

1. An event was unable to invoke any of the subscribers (Exception from
HRESULT: 0x80040201)
2. Cannot modify or delete an object that was added using the COM+
Admin SDK (Exception from HRESULT: 0x8004020E)

Any help on this ??

Thanks
Re: IPictureDisp to Image in C#.Net jiangsheng[MVP]
10/28/2006 9:32:26 AM
IPicture::SaveAsFile?

--
Regards
Sheng Jiang

Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net
http://blog.joycode.com/jiangsheng/
<vamsiram@gmail.com> ????
news:1161911432.309968.128100@e3g2000cwe.googlegroups.com...
[quoted text, click to view]

AddThis Social Bookmark Button