如何使wpf应用程序作为ole服务器
我想将我的 wpf 应用程序插入到 Excel 工作表中,就像 OLE 对象一样。是否可以?如果是的话,我们该如何做到这一点。
在 Excel 2003 中,当我们单击“插入”->“对象”菜单项时,我们会看到“对象”对话框。该对话框的“新建”选项卡包含各种 OLE 对象。我想在此列表中显示我的 DotNet exe 应用程序,以便当我选择并单击此对话框的“确定”按钮时,EXE 应该像此列表中的其他 OLE 对象一样执行。
谢谢,阿米特
I would like to insert my wpf application in excel sheet just like an OLE object. Is it possible? If yes, how we can do this.
In Excel 2003 when we click Insert->Object menu item, we get the 'Object' diloag. The 'Create New' tab of this dilaog contains varios OLE objects. I would like to display my DotNet exe application in this list so that when I select and click the 'Ok' button of this dialog, EXE should execute like others OLE object of this list.
Thanks, Amit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,自从您提出这个问题以来已经很长时间了,但我认为没有合理的方法可以实现您的目标,即使 WPF 应用程序成为直接嵌入的 OLE 对象。这些技术非常不同,虽然通过 COM 可能存在一些模糊的互操作路径,但采用不同的方法可能会节省大量时间。
例如,如果您只是尝试从 Excel“启动”应用程序,请创建一个“启动”WPF 应用程序的 OLE 对象,而不是尝试使它们成为同一对象。
就互操作性而言,这里还有一些阅读内容。
http://en.wikipedia.org/wiki/Object_Linking_and_Embedding#Interoperability
http://en.wikipedia.org/wiki/Component_Object_Model
http://en.wikipedia.org/wiki/COM_Interop
附带说明,这是一个有趣的问题/技术挑战,但最终可能不值得您花时间。
Well, its been a long time since you asked, but I don't think that there is a reasonable way to achieve your goal in terms of making the WPF application an OLE object for direct embedding. The technologies are very different, and while there may be some obscure interop path through COM, you'd probably save a lot of time by taking a different approach.
For example, if you are just trying to 'launch' the application from Excel, make an OLE object that 'launches' your WPF application instead of trying to make them both the same thing.
As far as the interop is concerned, here is some more reading.
http://en.wikipedia.org/wiki/Object_Linking_and_Embedding#Interoperability
http://en.wikipedia.org/wiki/Component_Object_Model
http://en.wikipedia.org/wiki/COM_Interop
On a side note, this is an interesting question / technical challenge, but may not be worth your time at the end of the day.