Hi, Using Debug symbols I was able to determine that (in IE7) before Edit menu is displayed CDoc::QueryStatus is invoked for Copy, Paste and few other commands in order to Enable/Disable menu items. I am trying to provide my own implementation of IOleCommandTarget using SetClientSite (I have tried also SetUIHandler). Whatever I am using it is not being invoked. Strangely enough my Exec method is being invoked when I click on Edit's Copy menu item. I have a feeling that I am setting IOleCommandTarget/UIHandler at wrong place of the objects hierarchy. The question what is the right place? Thank you.
On Aug 18, 3:27 pm, john55...@gmail.com wrote: > Hi, > > Using Debug symbols I was able to determine that (in IE7) before Edit > menu is displayed CDoc::QueryStatus is invoked for Copy, Paste and few > other commands in order to Enable/Disable menu items. I am trying to > provide my own implementation of IOleCommandTarget using SetClientSite > (I have tried also SetUIHandler). Whatever I am using it is not being > invoked. Strangely enough my Exec method is being invoked when I click > on Edit's Copy menu item. > > I have a feeling that I am setting IOleCommandTarget/UIHandler at > wrong place of the objects hierarchy. The question what is the right > place? > > Thank you. I have debugged little bit more. It looks like Document's IOleCommandTarget::QueryStatus is invoked directly and there are no extensibility hooks (like ClientSite) are invoked. It is a pitty. No wonder that CodeProject's "Extended .NET 2.0 WebBrowser Control" is using .NET's AxHost AttachInterfaces to wrap around Doc object. Oh, well I have to hack again (probably replace an entry in vtable)