add IsOk() (closes #9872)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-25 12:04:25 +00:00
parent 713e92905e
commit bb24f84b70
2 changed files with 13 additions and 2 deletions

View File

@@ -38,8 +38,9 @@ public:
virtual ~wxAutomationObject(); virtual ~wxAutomationObject();
// Set/get dispatch pointer // Set/get dispatch pointer
inline void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; } void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; }
inline WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; } WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; }
bool IsOk() const { return m_dispatchPtr != NULL; }
// Get a dispatch pointer from the current object associated // Get a dispatch pointer from the current object associated
// with a class id, such as "Excel.Application" // with a class id, such as "Excel.Application"

View File

@@ -81,6 +81,16 @@ public:
*/ */
bool CreateInstance(const wxString& classId) const; bool CreateInstance(const wxString& classId) const;
/**
Checks if the object is in a valid state.
Returns @true if the object was successfully initialized or @false if
it has no valid IDispatch pointer.
@see GetDispatchPtr()
*/
bool IsOk() const;
/** /**
Gets the IDispatch pointer. Gets the IDispatch pointer.
*/ */