I want to make my WPF app as an OLE object which can be inserted and launched from an MS-Excel .
When 开发者_StackOverflow社区I open an Excel-2003 and go to Insert->Object a list of OLE object are shown in Create New tab. I want to register my WPF app as an OLE object so that it is also shown in the list. User can able to insert and launch the appliction from an Excel file.
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 'luanch' 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.
精彩评论