Re: Com Interop QueryInterface
- From: Mattias Sjögren <mattias.dont.want.spam@xxxxxxxx>
- Date: Wed, 14 Sep 2005 17:47:40 +0200
>--IntPtr unknownIntPtr = Marshal.GetIUnknownForObject(cnt); //cnt is
>the com component
If cnt is a control derived from AxHost, you should use cnt.GetOcx()
to get to the real ActiveX object.
But why are you using GetIUnknownForObejct and explicit
QueryInterface? What are you going to do with the returned interface
poitner? Why not just cast to the interface?
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.
- Follow-Ups:
- Re: Com Interop QueryInterface
- From: va_acharya
- Re: Com Interop QueryInterface
- References:
- Com Interop QueryInterface
- From: va_acharya
- Com Interop QueryInterface
- Prev by Date: Re: Marshaling a pointer type
- Next by Date: Re: Service hangs when accessing ActiveX control
- Previous by thread: Re: Com Interop QueryInterface
- Next by thread: Re: Com Interop QueryInterface
- Index(es):