Allow wxAutomationObject::GetInstance() create new instance if needed.

When getting an instance of an OLE automation object, it is often useful to
connect to the existing instance if any or start a new one otherwise. Make
GetInstance() behave like this by default while still allowing to use the
wxAutomationInstance_UseExistingOnly flag to reestablish the old behaviour.

Also improve the error reporting in wxAutomationObject.

See #12489.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-26 13:30:37 +00:00
parent 27d7687903
commit 6eefca4fb7
5 changed files with 152 additions and 82 deletions

View File

@@ -175,6 +175,11 @@ Changes in behaviour not resulting in compilation errors, please read this!
from the previous versions. Using wxNotebookEvent::GetSelection() instead of
querying the notebook selection avoids the problem and is recommended.
- wxMSW-specific wxAutomationObject::GetInstance() method now creates a new
instance if needed instead of failing if the application providing the
requested ProgID is not running. Pass wxAutomationInstance_UseExistingOnly
flag to it to revert to the old behaviour.
Changes in behaviour which may result in compilation errors
-----------------------------------------------------------
@@ -452,6 +457,7 @@ MSW:
- Allow using wxDC::DrawText() with multiline texts.
- Fix wxBitmapButton best size determination broken in 2.9.1.
- Center task dialog-based wxProgressDialog on the parent (John Roberts).
- wxAutomationObject::GetInstance() creates objects on demand (Kolya Kosenko).