Hello,
I have a ToolWindowPane with a toolbar and an embedded Editor (IWpfTextViewHost).
Therefore I had implement IOleCommandTarget.
As a result the toolbar commands also ended in the Exec routine and are routed to the editor.
I think I have to filter them, but I dont know how I have to route them ...
int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { var hr = (int)Microsoft.VisualStudio.OLE.Interop.Constants.OLECMDERR_E_NOTSUPPORTED; if (pguidCmdGroup == GuidList.guidiNEXTCmdSet) // own comands { if (nCmdID == PkgCmdIDList.cmdidSQLEditRefresh) // one of my toolbar commands { // missing the magic here !!!!
} } else if (_ViewAdapter != null) { var cmdTarget = (IOleCommandTarget)_ViewAdapter; hr = cmdTarget.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); } return hr; }
best regards Stephan Hartmann ML-Software GmbH