COM Interop Guidance #4219
Description
I am considering using CoreRT with my .NET Core compatible GUI framework. However, to fully implement the GUI feature support I require, I will need to do some COM interop. Having studied the CoreRT source code, I can tell that COM support is not currently implemented. To make this usable, here is what I would do:
- Redirect creation of
ComImportAttribute
-decorated types toCoCreateInstance
. Wrap the return value of that P/Invoke into something like this. - Redirect calls to methods of
ComImportAttribute
-decorated interfaces to code that takes the slot number of the method called, gets the corresponding vtable entry and performs acalli
.
The problem is, though, this is not compatible in the slightest with the extensive but nonfunctional COM interop code already in the CoreRT repo. This COM interop code is only partially open-source (it references .NET Native functionality, as well as the MCG tool which is still proprietary), and is entirely WinRT-specific on top of that. Modifying the existing COM interop code to be compatible with desktop-style COM is currently far above my pay grade. Could anyone please give some pointers on how I or others might start working on implementing this? Thanks so much!