Hi Erich,
On 1/15/11 12:14 AM, Erich Hoover wrote:
Real Name: Erich Hoover Description: Adds support for the IWebBrowser(2)_ExecWB function by passing the requested operations through to IOleCommandTarget_Exec. With this patch (and patch 1) the print button in hhctrl.ocx operates properly. ChangeLog: shdocvw: Implement IWebBrowser_ExecWB.
+ IOleCommandTarget* target; + HRESULT hres; + + TRACE("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt, debugstr_variant(pvaIn), pvaOut); + + hres = IUnknown_QueryInterface(This->doc_host.document,&IID_IOleCommandTarget, (LPVOID*)&target);
document may be NULL here.
+ if(FAILED(hres)) + return hres; + hres = IOleCommandTarget_Exec(target, NULL, cmdID, cmdexecopt, pvaIn, pvaOut); + IOleCommandTarget_Release(target);
Please write a test case for this. MSDN seems wrong in this case. It indicates in one place that we should use CGID_MSHTML as group GUID, and NULL in the other. The test should make it clean, which version is true.
Jacek