[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Howto return a specific HRESULT value from an interop assembly?

little wizzard

8/2/2007 8:56:00 AM

Hello,

I have created an interop assembly in C#.
But I couldn't find any way to return an specific HRESULT value, e.g.
E_NOTIMPL, for a com visible interface method which I haven't impemented.
Which ways have I to do this?

Thanks for your time and any suggestions.

Best regards
Detlev

2 Answers

(Mattias Sjögren)

8/2/2007 12:45:00 PM

0

>I have created an interop assembly in C#.
>But I couldn't find any way to return an specific HRESULT value, e.g.
>E_NOTIMPL, for a com visible interface method which I haven't impemented.
>Which ways have I to do this?

Throw a NotImplementedException, and the runtime will handle
translating that to the corresponding HRESULT.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.n... | http://www.dotneti...
Please reply only to the newsgroup.

little wizzard

8/2/2007 4:16:00 PM

0

Hello Mattias,

many thanks for your fast and qualified advice, it solve my problem :-)

Best regards
Detlev

"Mattias Sjögren" wrote:

> >I have created an interop assembly in C#.
> >But I couldn't find any way to return an specific HRESULT value, e.g.
> >E_NOTIMPL, for a com visible interface method which I haven't impemented.
> >Which ways have I to do this?
>
> Throw a NotImplementedException, and the runtime will handle
> translating that to the corresponding HRESULT.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP] mattias @ mvps.org
> http://www.msjogren.n... | http://www.dotneti...
> Please reply only to the newsgroup.
>