Expose a WinForms UserControl as an ActiveX control
How do you expose an WinForms UserControl written in C# as an ActiveX control? My goal is to then use this UserControl from other langua开发者_运维百科ges such as VB6 or Delphi.
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.
You will need to create a Runnable Callable Wrapper or COM Callable Wrapper depending on your direction.
精彩评论