Expose a WinForms UserControl as an ActiveX control

白昼怎懂夜的黑 提交于 2019-12-11 03:33:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!