CanBeDone: unmanaged IntPtr to Delegate?

  • Thread starter Thread starter Alejandro Lapeyre
  • Start date Start date
A

Alejandro Lapeyre

Hello:
I am trying to write a wrapper for the WabApi (wich manages the Windows
Adress Book).
It uses some "kind of" interfaces, like IWABObject. But these interfaces
dont have Guids, and QueryInterface fails.
So I am thinking of getting the VTable and calling its methods.
I allready have the Vtable wich is something like this:

public structure IWABObjectVtbl
QueryInterface as IntPtr
etc.
...
end structure

The question is How can i cast the IntPtr to a delegate so I can call the
method?

Thanks a lot!!
Alejandro Lapeyre
 
Alejandro,
The question is How can i cast the IntPtr to a delegate so I can call the
method?

That's currently not possible, but will be in Whidbey.

In the meantime, I would suggest handling things like this in a VC++
component.



Mattias
 
Thank you for the answer!!!

I have never did any programming in C++ but after spending an hour I dont
find it so difficult (for this kind of small project).

Regards,
Alejandro Lapeyre.
 
Back
Top