Add wxAutomationInstance_SilentIfNone flag for wxMSW OLE code.

This flag allows to suppress the error message in case there are no currently
running instances of this object and can be useful if the caller doesn't know
in advance whether it's available or not.

Closes #12734.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-02-19 12:33:08 +00:00
parent d65e9d5707
commit 1244d2e07f
4 changed files with 30 additions and 5 deletions

View File

@@ -31,7 +31,15 @@ enum wxAutomationInstanceFlags
instance failed, we should call wxAutomationObject::CreateInstance() to
create a new one.
*/
wxAutomationInstance_CreateIfNeeded = 1
wxAutomationInstance_CreateIfNeeded = 1,
/**
Do not show an error message if no existing instance is currently
running.
All other errors will still be reported as usual.
*/
wxAutomationInstance_SilentIfNone = 2
};
@@ -134,6 +142,10 @@ public:
If attaching to an existing object failed and @a flags includes
wxAutomationInstance_CreateIfNeeded flag, a new object will be created.
Otherwise this function will normally log an error message which may be
undesirable if the object may or may not exist. The
wxAutomationInstance_SilentIfNone flag can be used to prevent the error
from being logged in this case.
Returns @true if a pointer was successfully retrieved, @false
otherwise.