X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/557002cf8162a0073dbc7050732cb6d75e184148..333e57d578e9e0fb6555452b5a53698ffd85ee69:/include/wx/msw/ole/activex.h diff --git a/include/wx/msw/ole/activex.h b/include/wx/msw/ole/activex.h index 49bae1ce86..99ef645571 100644 --- a/include/wx/msw/ole/activex.h +++ b/include/wx/msw/ole/activex.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/activex.h +// Name: wx/msw/ole/activex.h // Purpose: wxActiveXContainer class // Author: Ryan Norton // Modified by: @@ -16,31 +16,14 @@ #ifndef _WX_MSW_OLE_ACTIVEXCONTAINER_H_ #define _WX_MSW_OLE_ACTIVEXCONTAINER_H_ -//--------------------------------------------------------------------------- -// COM includes -//--------------------------------------------------------------------------- -#include "wx/msw/ole/oleutils.h" //wxBasicString, IID etc. -#include "wx/msw/ole/uuid.h" //IID etc.. +#if wxUSE_ACTIVEX //--------------------------------------------------------------------------- -// COM compatability definitions +// wx includes //--------------------------------------------------------------------------- -#ifndef STDMETHODCALLTYPE -#define STDMETHODCALLTYPE __stdcall -#endif -#ifndef STDMETHOD -#define STDMETHOD(funcname) virtual HRESULT STDMETHODCALLTYPE funcname -#endif -#ifndef PURE -#define PURE = 0 -#endif -#ifndef __RPC_FAR -#define __RPC_FAR FAR -#endif -//--------------------------------------------------------------------------- -// WX includes -//--------------------------------------------------------------------------- +#include "wx/msw/ole/oleutils.h" // wxBasicString &c +#include "wx/msw/ole/uuid.h" #include "wx/window.h" #include "wx/variant.h" @@ -56,23 +39,27 @@ #include +#ifndef STDMETHOD + #define STDMETHOD(funcname) virtual HRESULT wxSTDCALL funcname +#endif + // // These defines are from another ole header - but its not in the // latest sdk. Also the ifndef DISPID_READYSTATE is here because at // least on my machine with the latest sdk olectl.h defines these 3 // #ifndef DISPID_READYSTATE - #define DISPID_READYSTATE -525 - #define DISPID_READYSTATECHANGE -609 - #define DISPID_AMBIENT_TRANSFERPRIORITY -728 + #define DISPID_READYSTATE (-525) + #define DISPID_READYSTATECHANGE (-609) + #define DISPID_AMBIENT_TRANSFERPRIORITY (-728) #endif -#define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED -5501 -#define DISPID_AMBIENT_SILENT -5502 +#define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED (-5501) +#define DISPID_AMBIENT_SILENT (-5502) #ifndef DISPID_AMBIENT_CODEPAGE -# define DISPID_AMBIENT_CODEPAGE -725 -# define DISPID_AMBIENT_CHARSET -727 + #define DISPID_AMBIENT_CODEPAGE (-725) + #define DISPID_AMBIENT_CHARSET (-727) #endif @@ -140,7 +127,8 @@ class wxAutoOleInterface \ inline operator I *() const {return m_interface;}\ inline I* operator ->() {return m_interface;}\ inline I** GetRef() {return &m_interface;}\ - inline bool Ok() const {return m_interface != NULL;}\ + inline bool Ok() const { return IsOk(); }\ + inline bool IsOk() const {return m_interface != NULL;}\ }; WX_DECLARE_AUTOOLE(wxAutoIDispatch, IDispatch) @@ -196,24 +184,24 @@ public: virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); } - int ParamCount() const + size_t ParamCount() const { return m_params.GetCount(); } - wxString ParamType(int idx) const + wxString ParamType(size_t idx) const { - wxASSERT(idx >= 0 && idx < m_params.GetCount()); + wxASSERT(idx < m_params.GetCount()); return m_params[idx].GetType(); } - wxString ParamName(int idx) const + wxString ParamName(size_t idx) const { - wxASSERT(idx >= 0 && idx < m_params.GetCount()); + wxASSERT(idx < m_params.GetCount()); return m_params[idx].GetName(); } - wxVariant& operator[] (int idx) + wxVariant& operator[] (size_t idx) { - wxASSERT(idx >= 0 && idx < ParamCount()); + wxASSERT(idx < ParamCount()); return m_params[idx]; } @@ -228,5 +216,6 @@ typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&); #define wxActiveXEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func) -#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_ +#endif // wxUSE_ACTIVEX +#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_