A
Arsen V.
Hi,
I have the following declaration for my IE browser band:
typedef IDispEventImpl<0, CToolBand, &DIID_DWebBrowserEvents2,
&LIBID_SHDocVw, 1, 0> SinkWebBrowserImpl;
class ATL_NO_VTABLE CToolBand :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CToolBand, &CLSID_ToolBand>,
public IOleCommandTarget,
public IDeskBand,
public IObjectWithSiteImpl<CToolBand>,
public IPersistStream,
public IInputObject,
public IDispatchImpl<IToolBand, &IID_IToolBand, &LIBID_TOOLBANDLib>,
public SinkWebBrowserImpl
{
....
}
I implement the IOleCommandTarget interface as follows:
STDMETHOD(QueryStatus)(
/*[in]*/ const GUID *pguidCmdGroup,
/*[in]*/ ULONG cCmds,
/*[in,out][size_is(cCmds)]*/ OLECMD prgCmds[],
/*[in,out]*/ OLECMDTEXT *pCmdText)
{
return S_OK;
}
STDMETHOD(Exec)(
/*[in]*/ const GUID *pguidCmdGroup,
/*[in]*/ DWORD nCmdID,
/*[in]*/ DWORD nCmdExecOpt,
/*[in]*/ VARIANTARG *pvaIn,
/*[in,out]*/ VARIANTARG *pvaOut)
{
if (nCmdID == OLECMDID_SHOWSCRIPTERROR)
{
// Cancel the error dialog from popuping up when there are javascript
errors
(*pvaOut).vt = VT_BOOL;
(*pvaOut).boolVal = VARIANT_TRUE;
}
return S_OK;
}
For some reason I never get into the Exec method ( I tried breakpoints and
tracing it). All the javascript errors are still displaying the popup. Why
is my Exec not being used? Do I need to set something to make sure that
Exec gets called?
Thanks in advance,
Arsen
I have the following declaration for my IE browser band:
typedef IDispEventImpl<0, CToolBand, &DIID_DWebBrowserEvents2,
&LIBID_SHDocVw, 1, 0> SinkWebBrowserImpl;
class ATL_NO_VTABLE CToolBand :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CToolBand, &CLSID_ToolBand>,
public IOleCommandTarget,
public IDeskBand,
public IObjectWithSiteImpl<CToolBand>,
public IPersistStream,
public IInputObject,
public IDispatchImpl<IToolBand, &IID_IToolBand, &LIBID_TOOLBANDLib>,
public SinkWebBrowserImpl
{
....
}
I implement the IOleCommandTarget interface as follows:
STDMETHOD(QueryStatus)(
/*[in]*/ const GUID *pguidCmdGroup,
/*[in]*/ ULONG cCmds,
/*[in,out][size_is(cCmds)]*/ OLECMD prgCmds[],
/*[in,out]*/ OLECMDTEXT *pCmdText)
{
return S_OK;
}
STDMETHOD(Exec)(
/*[in]*/ const GUID *pguidCmdGroup,
/*[in]*/ DWORD nCmdID,
/*[in]*/ DWORD nCmdExecOpt,
/*[in]*/ VARIANTARG *pvaIn,
/*[in,out]*/ VARIANTARG *pvaOut)
{
if (nCmdID == OLECMDID_SHOWSCRIPTERROR)
{
// Cancel the error dialog from popuping up when there are javascript
errors
(*pvaOut).vt = VT_BOOL;
(*pvaOut).boolVal = VARIANT_TRUE;
}
return S_OK;
}
For some reason I never get into the Exec method ( I tried breakpoints and
tracing it). All the javascript errors are still displaying the popup. Why
is my Exec not being used? Do I need to set something to make sure that
Exec gets called?
Thanks in advance,
Arsen