OLE Container for .NET

无人久伴 提交于 2019-11-30 09:20:40

问题


I'm working on a project that requires me to load an OLE object and render it in a .NET WinForm app (C#). Unlike VB6 .NET has no built in OLE container, and the recommended approach is to use the WebBrowser control which supports displaying ActiveX content. The issue I have is the provider of the OLE object in question does not have an ActiveX control available.

Simply put is there any way to load an OLE object onto a WinForm? Or will I need to write an ActiveX control that loads the OLE Object? If the latter, does anyone have an example of this, or recommended reading material?

cheers,

Marc.


回答1:


It has a wrapper for ActiveX controls, AxHost. But if you mean OLE Linking and Embedding, no, that's dead technology. It used to be possible with DsoFramer but that has been removed from the MSFT download site due to serious Office compatibility problems. You might be able to dig up a copy somewhere. Long term, you should avoid this, OLE has no future.




回答2:


I made a simple user control that provides a replacement for the VB6 OLE Container control you can download the source code from my blog: http://blogs.artinsoft.net/Mrojas/archive/2012/01/23/Quick-replacement-for-the-VB6-OLE-Container-Control-in-NET.aspx




回答3:


You can use my control OLE Container surrogate for .NET




回答4:


There's an alternative mechanism suggested at Visual Studio 2005 and Visual Studio .NET do not provide an OLE container control for Windows Forms and How to use the WebBrowser control to open Office documents in Visual C# 2005 or in Visual C# .NET.



来源:https://stackoverflow.com/questions/2139765/ole-container-for-net

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