|Drill has the plumbering you need, but it does it using C++. You obviously need it using C#.
Let's see the key code, in the driller app, the class which implements and subscribes for the custom (window.)external handler is attached like this :
CCustomOccManager *pMgr = new CCustomOccManager;
m_pDispOM = new CImpIDispatch;
So you need your hosting app implement a control site. Searching the .NET framework for the equivalent stuff, I found this[^] :
protected virtual ISite CreateSite(
The above method must be implemented by your code, and it will be called by the framework when the app is started.
The implementation of this method must do what the C++ code does, ie provide implementation for the IDocHostUIHandler. In this implementation, that's
GetExternal which attaches the site to a class of yours. This class implements IDispatch and implements any number of methods, among which
I know that's hard using C++ already, but trying to do it using C# is just harder. That's questionable.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.