Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to cast a .NET class into a COM library class?

I am using the MathInputControl class in C# through the micautLib COM library.

Example:

    MathInputControl mic = new MathInputControlClass();
    mic.EnableExtendedButtons(true);
    mic.Show();

I am using Microsoft.Ink and I would like to be able to send an Ink object to the MathInputControl object through the MathInputControl.LoadInk(IInkDisp ink); method. However, the IInkDisp interface is an unmanaged interface and none of the managed Microsoft.Ink classes implement it.

How can I send it a managed Ink object?

like image 974
zfedoran Avatar asked Nov 06 '22 19:11

zfedoran


1 Answers

I'd build a ComVisible wrapper that implements IInkDisp and delegates to whatever Microsoft.Ink facilities you need.

like image 187
Kim Gräsman Avatar answered Nov 14 '22 21:11

Kim Gräsman