diff --git a/include/wx/msw/ole/automtn.h b/include/wx/msw/ole/automtn.h index 87f2ff1538..c119874092 100644 --- a/include/wx/msw/ole/automtn.h +++ b/include/wx/msw/ole/automtn.h @@ -38,8 +38,9 @@ public: virtual ~wxAutomationObject(); // Set/get dispatch pointer - inline void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; } - inline WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; } + void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; } + WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; } + bool IsOk() const { return m_dispatchPtr != NULL; } // Get a dispatch pointer from the current object associated // with a class id, such as "Excel.Application" diff --git a/interface/wx/msw/ole/automtn.h b/interface/wx/msw/ole/automtn.h index 818169b0b1..f29b9f86c0 100644 --- a/interface/wx/msw/ole/automtn.h +++ b/interface/wx/msw/ole/automtn.h @@ -81,6 +81,16 @@ public: */ 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. */