Bypassing the CCW

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a DLL that exposes COM interfaces.

One of the COM Object receives an IDispatch pointer. I know that this
IDispatch pointer is in fact a COM Callable Wrapper for a
System::Drawing::Bitmap object. How can I get a reference to the .NET Bitmap,
bypassing the CCW?

ex:
HRESULT MyMethod( IDispatch* _CCWOfBitmap )
{
System::Drawing::Bitmap* dotnetBitmap = MagicMethod( _CCWOfBitmap );

System::Drawing::Color myColor = dotnetBitmap->GetPixel(1,1);
// ... continuing enjoying .NET here...
}

Question: MagicMethod should do what to make this code working?

Thanks
Eric
 
Hi,

Thanks for quick reply...

How's this solve my problem since I receive a COM interface and want a .NET
Object? This API is actually the other way around from my understanding (it
returns an IntPtr).

In the sample bellow I need a replacement for MagicMethod with return a
reference to a .NET object...

Eric
 
Back
Top