// Get an IDispatch pointer for the IOleCommandTarget interface.
lpDispatch->QueryInterface(IID_IOleCommandTarget, (void**)&lpOleCommandTarget);
ASSERT(lpOleCommandTarget);
lpDispatch->Release();
lpDispatch = NULL;
//OLECMDID_SHOWSCRIPTERROR
// Invoke the given command id for the WebBrowser control
if(lpOleCommandTarget != NULL)
{
HRESULT hr = lpOleCommandTarget->Exec(&CGID_IWebBrowser, HTMLID_VIEWSOURCE, 0,
NULL, NULL);
lpOleCommandTarget->Release();
lpOleCommandTarget = NULL;
return hr;
}
else
return S_OK;
}catch(...){}