X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6636ef8ddf9eda0d0352c29d98cb141676a51a2d..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/msw/ole/automtn.cpp diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index dce44ebc5a..12a46ffcad 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -545,8 +545,15 @@ bool wxAutomationObject::GetInstance(const wxString& progId, int flags) const } else { - wxLogSysError(hr, - _("Cannot get an active instance of \"%s\""), progId); + // Log an error except if we're supposed to fail silently when the + // error is that no current instance exists. + if ( hr != MK_E_UNAVAILABLE || + !(flags & wxAutomationInstance_SilentIfNone) ) + { + wxLogSysError(hr, + _("Cannot get an active instance of \"%s\""), + progId); + } } return false;