PRB: ICustomDoc::SetUIHandler Causes Changes in Save As Dialog

For the description of this problem, see
A workaround is delegating DHTML commands to the origional webbrowser object through its IOleCommandTarget interface. A sample can be found at
/*[in]*/ const GUID *pguidCmdGroup,
/*[in]*/ DWORD nCmdID,
/*[in]*/ DWORD nCmdExecOpt,
/*[in]*/ VARIANTARG *pvaIn,
/*[in,out]*/ VARIANTARG *pvaOut)
// Don’t show the error dialog, but
// continue running scripts on the page.
(*pvaOut).vt = VT_BOOL;
(*pvaOut).boolVal = VARIANT_TRUE;
return S_OK;
return m_spDefaultOleCommandTarget->Exec(pguidCmdGroup, nCmdID,
nCmdExecOpt, pvaIn, pvaOut);
By redirecting the ole commands to the original client site, the save as options are restored.
BTW, the sentence “This means that you must host the Web browser control must be hosted” in the article seems confusing.

One response to “PRB: ICustomDoc::SetUIHandler Causes Changes in Save As Dialog”

  1. I’m trying to restore the save as dialog box in my C# code and I have seen the C++ code but can’t seem to figure out the work around in C#. Can you advice?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.