问题
How do you expose an WinForms UserControl written in C# as an ActiveX control? My goal is to then use this UserControl from other languages such as VB6 or Delphi.
回答1:
The solution is to use the Interop Toolkit, see http://msdn.microsoft.com/en-us/vbasic/bb419144 and http://www.codeproject.com/KB/vb-interop/VB6InteropToolkit2.aspx.
回答2:
You will need to create a Runnable Callable Wrapper or COM Callable Wrapper depending on your direction.
来源:https://stackoverflow.com/questions/7409433/expose-a-winforms-usercontrol-as-an-activex-control