I have got an Interface method that takes a void*. Dot Net interprets it as a
System.IntPtr structure. I now want to pass a COM interface reference through
the IntPtr type. How can i achieve this???
If you are trying to pass a interface reference that lies witihn an object,
you can try this, i use this:
//This class implements the interface
MyServerObject SO = new MyServerObject ();
//Get the pointer to our class
IntPtr ObjectPtr = Marshal.GetIUnknownForObject(SO);
Then you can return the ObjectPtr.
> I have got an Interface method that takes a void*. Dot Net interprets it as a
> System.IntPtr structure. I now want to pass a COM interface reference through
> the IntPtr type. How can i achieve this???
Praveen Krishnan - 10 Dec 2004 12:05 GMT
Thank you for providing a solution.
> If you are trying to pass a interface reference that lies witihn an object,
> you can try this, i use this:
[quoted text clipped - 10 lines]
> > System.IntPtr structure. I now want to pass a COM interface reference through
> > the IntPtr type. How can i achieve this???