extension module called wx.activex. Lots of demo and lib updates to go along with it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
		
			
				
	
	
		
			478 lines
		
	
	
		
			37 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			478 lines
		
	
	
		
			37 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 | |
| <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
 | |
| <title>wxactivex.h Source File</title>
 | |
| <link href="doxygen.css" rel="stylesheet" type="text/css">
 | |
| </head><body>
 | |
| <!-- Generated by Doxygen 1.3-rc3 -->
 | |
| <center>
 | |
| <a class="qindex" href="index.html">Main Page</a>   <a class="qindex" href="namespaces.html">Namespace List</a>   <a class="qindex" href="hierarchy.html">Class Hierarchy</a>   <a class="qindex" href="classes.html">Alphabetical List</a>   <a class="qindex" href="annotated.html">Data Structures</a>   <a class="qindex" href="files.html">File List</a>   <a class="qindex" href="functions.html">Data Fields</a>   <a class="qindex" href="globals.html">Globals</a>   </center>
 | |
| <hr><h1>wxactivex.h</h1><a href="wxactivex_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
 | |
| 00005 <span class="preprocessor">#ifndef WX_ACTIVE_X</span>
 | |
| 00006 <span class="preprocessor"></span><span class="preprocessor">#define WX_ACTIVE_X</span>
 | |
| 00007 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4101 4786)</span>
 | |
| 00008 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786)</span>
 | |
| 00009 <span class="preprocessor"></span>
 | |
| 00010 
 | |
| 00011 <span class="preprocessor">#include <wx/setup.h></span>
 | |
| 00012 <span class="preprocessor">#include <wx/wx.h></span>
 | |
| 00013 <span class="preprocessor">#include <wx/variant.h></span>
 | |
| 00014 <span class="preprocessor">#include <wx/datetime.h></span>
 | |
| 00015 <span class="preprocessor">#include <oleidl.h></span>
 | |
| 00016 <span class="preprocessor">#include <exdisp.h></span>
 | |
| 00017 <span class="preprocessor">#include <docobj.h></span>
 | |
| 00018 <span class="preprocessor">#include <iostream></span>
 | |
| 00019 <span class="preprocessor">#include <vector></span>
 | |
| 00020 <span class="preprocessor">#include <map></span>
 | |
| 00021 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
 | |
| 00022 
 | |
| <a name="l00024"></a><a class="code" href="namespaceNS__wxActiveX.html">00024</a> <span class="keyword">namespace </span>NS_wxActiveX
 | |
| 00025 {
 | |
| <a name="l00029"></a><a class="code" href="structNS__wxActiveX_1_1less__wxStringI.html">00029</a>         <span class="keyword">struct </span><a class="code" href="structNS__wxActiveX_1_1less__wxStringI.html">less_wxStringI</a>
 | |
| 00030         {
 | |
| 00031                 <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> wxString& x, <span class="keyword">const</span> wxString& y)<span class="keyword"> const</span>
 | |
| 00032 <span class="keyword">                </span>{
 | |
| 00033                         <span class="keywordflow">return</span> x.CmpNoCase(y) < 0;
 | |
| 00034                 };
 | |
| 00035         };
 | |
| 00036 };
 | |
| 00037 
 | |
| 00038 
 | |
| <a name="l00045"></a><a class="code" href="classwxAutoOleInterface.html">00045</a> <span class="keyword">template</span> <<span class="keyword">class</span> I> <span class="keyword">class </span><a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface</a>
 | |
| 00046 {
 | |
| 00047         <span class="keyword">protected</span>:
 | |
| 00048     I *m_interface;
 | |
| 00049 
 | |
| 00050         <span class="keyword">public</span>:
 | |
| <a name="l00053"></a><a class="code" href="classwxAutoOleInterface.html#a0">00053</a>     <span class="keyword">explicit</span> <a class="code" href="classwxAutoOleInterface.html#a0">wxAutoOleInterface</a>(I *pInterface = NULL) : m_interface(pInterface) {}
 | |
| 00054 
 | |
| <a name="l00056"></a><a class="code" href="classwxAutoOleInterface.html#a1">00056</a>     <a class="code" href="classwxAutoOleInterface.html#a0">wxAutoOleInterface</a>(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
 | |
| 00057         {
 | |
| 00058                 <a class="code" href="classwxAutoOleInterface.html#a9">QueryInterface</a>(riid, pUnk);
 | |
| 00059         };
 | |
| <a name="l00061"></a><a class="code" href="classwxAutoOleInterface.html#a2">00061</a>     <a class="code" href="classwxAutoOleInterface.html#a0">wxAutoOleInterface</a>(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
 | |
| 00062         {
 | |
| 00063                 <a class="code" href="classwxAutoOleInterface.html#a9">QueryInterface</a>(riid, pDispatch);
 | |
| 00064         };
 | |
| 00065 
 | |
| <a name="l00067"></a><a class="code" href="classwxAutoOleInterface.html#a3">00067</a>         <a class="code" href="classwxAutoOleInterface.html#a0">wxAutoOleInterface</a>(REFCLSID clsid, REFIID riid) : m_interface(NULL)
 | |
| 00068         {
 | |
| 00069                 <a class="code" href="classwxAutoOleInterface.html#a10">CreateInstance</a>(clsid, riid);
 | |
| 00070         };
 | |
| 00071 
 | |
| <a name="l00073"></a><a class="code" href="classwxAutoOleInterface.html#a4">00073</a>     <a class="code" href="classwxAutoOleInterface.html#a0">wxAutoOleInterface</a>(<span class="keyword">const</span> <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<I></a>& ti) : m_interface(NULL)
 | |
| 00074     {
 | |
| 00075                 <a class="code" href="classwxAutoOleInterface.html#a5">operator = </a>(ti);
 | |
| 00076     }
 | |
| 00077 
 | |
| <a name="l00079"></a><a class="code" href="classwxAutoOleInterface.html#a5">00079</a>     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<I></a>& <a class="code" href="classwxAutoOleInterface.html#a5">operator = </a>(<span class="keyword">const</span> <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<I></a>& ti)
 | |
| 00080     {
 | |
| 00081                 <span class="keywordflow">if</span> (ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>)
 | |
| 00082                         ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>->AddRef();
 | |
| 00083         <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>();
 | |
| 00084         m_interface = ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>;
 | |
| 00085         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
 | |
| 00086     }
 | |
| 00087 
 | |
| <a name="l00090"></a><a class="code" href="classwxAutoOleInterface.html#a6">00090</a>     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<I></a>& <a class="code" href="classwxAutoOleInterface.html#a5">operator = </a>(I *&ti)
 | |
| 00091     {
 | |
| 00092         <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>();
 | |
| 00093         m_interface = ti;
 | |
| 00094         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
 | |
| 00095     }
 | |
| 00096 
 | |
| <a name="l00098"></a><a class="code" href="classwxAutoOleInterface.html#a7">00098</a>     <a class="code" href="classwxAutoOleInterface.html#a7">~wxAutoOleInterface</a>()
 | |
| 00099     {
 | |
| 00100         <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>();
 | |
| 00101     };
 | |
| 00102 
 | |
| 00103 
 | |
| <a name="l00105"></a><a class="code" href="classwxAutoOleInterface.html#a8">00105</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>()
 | |
| 00106     {
 | |
| 00107         <span class="keywordflow">if</span> (m_interface)
 | |
| 00108                 m_interface->Release();
 | |
| 00109         m_interface = NULL;
 | |
| 00110     };
 | |
| 00111 
 | |
| <a name="l00113"></a><a class="code" href="classwxAutoOleInterface.html#a9">00113</a>     HRESULT <a class="code" href="classwxAutoOleInterface.html#a9">QueryInterface</a>(REFIID riid, IUnknown *pUnk)
 | |
| 00114         {
 | |
| 00115                 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>();
 | |
| 00116                 wxASSERT(pUnk != NULL);
 | |
| 00117             <span class="keywordflow">return</span> pUnk->QueryInterface(riid, (<span class="keywordtype">void</span> **) &m_interface);
 | |
| 00118         };
 | |
| 00119 
 | |
| <a name="l00121"></a><a class="code" href="classwxAutoOleInterface.html#a10">00121</a>     HRESULT <a class="code" href="classwxAutoOleInterface.html#a10">CreateInstance</a>(REFCLSID clsid, REFIID riid)
 | |
| 00122     {
 | |
| 00123                 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>();
 | |
| 00124             <span class="keywordflow">return</span> CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (<span class="keywordtype">void</span> **) &m_interface);
 | |
| 00125     };
 | |
| 00126 
 | |
| 00127 
 | |
| <a name="l00129"></a><a class="code" href="classwxAutoOleInterface.html#a11">00129</a>     <span class="keyword">inline</span> <a class="code" href="classwxAutoOleInterface.html#a11">operator I *</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_interface;}
 | |
| 00130 
 | |
| <a name="l00132"></a><a class="code" href="classwxAutoOleInterface.html#a12">00132</a>     <span class="keyword">inline</span> I* <a class="code" href="classwxAutoOleInterface.html#a12">operator -></a>() {<span class="keywordflow">return</span> m_interface;}
 | |
| <a name="l00134"></a><a class="code" href="classwxAutoOleInterface.html#a13">00134</a>         <span class="keyword">inline</span> I** <a class="code" href="classwxAutoOleInterface.html#a13">GetRef</a>()     {<span class="keywordflow">return</span> &m_interface;}
 | |
| <a name="l00136"></a><a class="code" href="classwxAutoOleInterface.html#a14">00136</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classwxAutoOleInterface.html#a14">Ok</a>()<span class="keyword"> const  </span>{<span class="keywordflow">return</span> m_interface != NULL;}
 | |
| 00137 };
 | |
| 00138 
 | |
| 00139 
 | |
| 00142 wxString <a class="code" href="wxactivex_8h.html#a13">OLEHResultToString</a>(HRESULT hr);
 | |
| 00145 wxString <a class="code" href="wxactivex_8h.html#a14">GetIIDName</a>(REFIID riid);
 | |
| 00146 
 | |
| 00147 <span class="comment">//#define __WXOLEDEBUG</span>
 | |
| 00148 
 | |
| 00149 
 | |
| 00150 <span class="preprocessor">#ifdef __WXOLEDEBUG</span>
 | |
| 00151 <span class="preprocessor"></span><span class="preprocessor">    #define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}</span>
 | |
| 00152 <span class="preprocessor"></span><span class="preprocessor">    #define WXOLE_TRACEOUT(stuff)\</span>
 | |
| 00153 <span class="preprocessor">    {\</span>
 | |
| 00154 <span class="preprocessor">        wxString os;\</span>
 | |
| 00155 <span class="preprocessor">        os << stuff << "\r\n";\</span>
 | |
| 00156 <span class="preprocessor">        WXOLE_TRACE(os.mb_str());\</span>
 | |
| 00157 <span class="preprocessor">    }</span>
 | |
| 00158 <span class="preprocessor"></span>
 | |
| 00159 <span class="preprocessor">    #define WXOLE_WARN(__hr,msg)\</span>
 | |
| 00160 <span class="preprocessor">    {\</span>
 | |
| 00161 <span class="preprocessor">        if (__hr != S_OK)\</span>
 | |
| 00162 <span class="preprocessor">        {\</span>
 | |
| 00163 <span class="preprocessor">            wxString s = "*** ";\</span>
 | |
| 00164 <span class="preprocessor">            s += msg;\</span>
 | |
| 00165 <span class="preprocessor">            s += " : "+ OLEHResultToString(__hr);\</span>
 | |
| 00166 <span class="preprocessor">            WXOLE_TRACE(s.c_str());\</span>
 | |
| 00167 <span class="preprocessor">        }\</span>
 | |
| 00168 <span class="preprocessor">    }</span>
 | |
| 00169 <span class="preprocessor"></span><span class="preprocessor">#else</span>
 | |
| 00170 <span class="preprocessor"></span><span class="preprocessor">    #define WXOLE_TRACE(str)</span>
 | |
| 00171 <span class="preprocessor"></span><span class="preprocessor">    #define WXOLE_TRACEOUT(stuff)</span>
 | |
| 00172 <span class="preprocessor"></span><span class="preprocessor">    #define WXOLE_WARN(_proc,msg) {_proc;}</span>
 | |
| 00173 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
 | |
| 00174 <span class="preprocessor"></span>
 | |
| 00175 <span class="keyword">class </span>wxOleInit
 | |
| 00176 {
 | |
| 00177         <span class="keyword">public</span>:
 | |
| 00178     <span class="keyword">static</span> IMalloc *GetIMalloc();
 | |
| 00179 
 | |
| 00180     wxOleInit();
 | |
| 00181     ~wxOleInit();
 | |
| 00182 };
 | |
| 00183 
 | |
| 00184 <span class="preprocessor">#define DECLARE_OLE_UNKNOWN(cls)\</span>
 | |
| 00185 <span class="preprocessor">        private:\</span>
 | |
| 00186 <span class="preprocessor">    class TAutoInitInt\</span>
 | |
| 00187 <span class="preprocessor">    {\</span>
 | |
| 00188 <span class="preprocessor">        public:\</span>
 | |
| 00189 <span class="preprocessor">        LONG l;\</span>
 | |
| 00190 <span class="preprocessor">        TAutoInitInt() : l(0) {}\</span>
 | |
| 00191 <span class="preprocessor">    };\</span>
 | |
| 00192 <span class="preprocessor">    TAutoInitInt refCount, lockCount;\</span>
 | |
| 00193 <span class="preprocessor">    wxOleInit oleInit;\</span>
 | |
| 00194 <span class="preprocessor">        static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\</span>
 | |
| 00195 <span class="preprocessor">    public:\</span>
 | |
| 00196 <span class="preprocessor">    LONG GetRefCount();\</span>
 | |
| 00197 <span class="preprocessor">        HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\</span>
 | |
| 00198 <span class="preprocessor">        ULONG STDMETHODCALLTYPE AddRef();\</span>
 | |
| 00199 <span class="preprocessor">        ULONG STDMETHODCALLTYPE Release();\</span>
 | |
| 00200 <span class="preprocessor">    ULONG STDMETHODCALLTYPE AddLock();\</span>
 | |
| 00201 <span class="preprocessor">        ULONG STDMETHODCALLTYPE ReleaseLock()</span>
 | |
| 00202 <span class="preprocessor"></span>
 | |
| 00203 <span class="preprocessor">#define DEFINE_OLE_TABLE(cls)\</span>
 | |
| 00204 <span class="preprocessor">        LONG cls::GetRefCount() {return refCount.l;}\</span>
 | |
| 00205 <span class="preprocessor">    HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\</span>
 | |
| 00206 <span class="preprocessor">    {\</span>
 | |
| 00207 <span class="preprocessor">        if (! ppvObject)\</span>
 | |
| 00208 <span class="preprocessor">        {\</span>
 | |
| 00209 <span class="preprocessor">            WXOLE_TRACE("*** NULL POINTER ***");\</span>
 | |
| 00210 <span class="preprocessor">            return E_FAIL;\</span>
 | |
| 00211 <span class="preprocessor">        };\</span>
 | |
| 00212 <span class="preprocessor">        const char *desc = NULL;\</span>
 | |
| 00213 <span class="preprocessor">        cls::_GetInterface(this, iid, ppvObject, desc);\</span>
 | |
| 00214 <span class="preprocessor">        if (! *ppvObject)\</span>
 | |
| 00215 <span class="preprocessor">        {\</span>
 | |
| 00216 <span class="preprocessor">            WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\</span>
 | |
| 00217 <span class="preprocessor">            return E_NOINTERFACE;\</span>
 | |
| 00218 <span class="preprocessor">        };\</span>
 | |
| 00219 <span class="preprocessor">        WXOLE_TRACEOUT("QI : <" << desc <<">");\</span>
 | |
| 00220 <span class="preprocessor">        ((IUnknown * )(*ppvObject))->AddRef();\</span>
 | |
| 00221 <span class="preprocessor">        return S_OK;\</span>
 | |
| 00222 <span class="preprocessor">    };\</span>
 | |
| 00223 <span class="preprocessor">    ULONG STDMETHODCALLTYPE cls::AddRef()\</span>
 | |
| 00224 <span class="preprocessor">    {\</span>
 | |
| 00225 <span class="preprocessor">        WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\</span>
 | |
| 00226 <span class="preprocessor">        InterlockedIncrement(&refCount.l);\</span>
 | |
| 00227 <span class="preprocessor">        return refCount.l;\</span>
 | |
| 00228 <span class="preprocessor">    };\</span>
 | |
| 00229 <span class="preprocessor">    ULONG STDMETHODCALLTYPE cls::Release()\</span>
 | |
| 00230 <span class="preprocessor">    {\</span>
 | |
| 00231 <span class="preprocessor">        if (refCount.l > 0)\</span>
 | |
| 00232 <span class="preprocessor">        {\</span>
 | |
| 00233 <span class="preprocessor">                InterlockedDecrement(&refCount.l);\</span>
 | |
| 00234 <span class="preprocessor">                WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\</span>
 | |
| 00235 <span class="preprocessor">            if (refCount.l == 0)\</span>
 | |
| 00236 <span class="preprocessor">                {\</span>
 | |
| 00237 <span class="preprocessor">                delete this;\</span>
 | |
| 00238 <span class="preprocessor">                    return 0;\</span>
 | |
| 00239 <span class="preprocessor">                };\</span>
 | |
| 00240 <span class="preprocessor">                return refCount.l;\</span>
 | |
| 00241 <span class="preprocessor">        }\</span>
 | |
| 00242 <span class="preprocessor">        else\</span>
 | |
| 00243 <span class="preprocessor">                return 0;\</span>
 | |
| 00244 <span class="preprocessor">    }\</span>
 | |
| 00245 <span class="preprocessor">    ULONG STDMETHODCALLTYPE cls::AddLock()\</span>
 | |
| 00246 <span class="preprocessor">    {\</span>
 | |
| 00247 <span class="preprocessor">        WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\</span>
 | |
| 00248 <span class="preprocessor">        InterlockedIncrement(&lockCount.l);\</span>
 | |
| 00249 <span class="preprocessor">        return lockCount.l;\</span>
 | |
| 00250 <span class="preprocessor">    };\</span>
 | |
| 00251 <span class="preprocessor">    ULONG STDMETHODCALLTYPE cls::ReleaseLock()\</span>
 | |
| 00252 <span class="preprocessor">    {\</span>
 | |
| 00253 <span class="preprocessor">        if (lockCount.l > 0)\</span>
 | |
| 00254 <span class="preprocessor">        {\</span>
 | |
| 00255 <span class="preprocessor">                InterlockedDecrement(&lockCount.l);\</span>
 | |
| 00256 <span class="preprocessor">                WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\</span>
 | |
| 00257 <span class="preprocessor">            return lockCount.l;\</span>
 | |
| 00258 <span class="preprocessor">        }\</span>
 | |
| 00259 <span class="preprocessor">        else\</span>
 | |
| 00260 <span class="preprocessor">                return 0;\</span>
 | |
| 00261 <span class="preprocessor">    }\</span>
 | |
| 00262 <span class="preprocessor">    DEFINE_OLE_BASE(cls)</span>
 | |
| 00263 <span class="preprocessor"></span>
 | |
| 00264 <span class="preprocessor">#define DEFINE_OLE_BASE(cls)\</span>
 | |
| 00265 <span class="preprocessor">        void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\</span>
 | |
| 00266 <span class="preprocessor">        {\</span>
 | |
| 00267 <span class="preprocessor">                *_interface = NULL;\</span>
 | |
| 00268 <span class="preprocessor">            desc = NULL;</span>
 | |
| 00269 <span class="preprocessor"></span>
 | |
| 00270 <span class="preprocessor">#define OLE_INTERFACE(_iid, _type)\</span>
 | |
| 00271 <span class="preprocessor">    if (IsEqualIID(iid, _iid))\</span>
 | |
| 00272 <span class="preprocessor">    {\</span>
 | |
| 00273 <span class="preprocessor">        WXOLE_TRACE("Found Interface <" # _type ">");\</span>
 | |
| 00274 <span class="preprocessor">        *_interface = (IUnknown *) (_type *) self;\</span>
 | |
| 00275 <span class="preprocessor">        desc = # _iid;\</span>
 | |
| 00276 <span class="preprocessor">        return;\</span>
 | |
| 00277 <span class="preprocessor">    }</span>
 | |
| 00278 <span class="preprocessor"></span>
 | |
| 00279 <span class="preprocessor">#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)</span>
 | |
| 00280 <span class="preprocessor"></span>
 | |
| 00281 <span class="preprocessor">#define OLE_INTERFACE_CUSTOM(func)\</span>
 | |
| 00282 <span class="preprocessor">    if (func(self, iid, _interface, desc))\</span>
 | |
| 00283 <span class="preprocessor">        {\</span>
 | |
| 00284 <span class="preprocessor">        return;\</span>
 | |
| 00285 <span class="preprocessor">        }</span>
 | |
| 00286 <span class="preprocessor"></span>
 | |
| 00287 <span class="preprocessor">#define END_OLE_TABLE\</span>
 | |
| 00288 <span class="preprocessor">        }</span>
 | |
| 00289 <span class="preprocessor"></span>
 | |
| 00290 
 | |
| 00328 
 | |
| <a name="l00329"></a><a class="code" href="classwxActiveX.html">00329</a> <span class="keyword">class </span><a class="code" href="classwxActiveX.html">wxActiveX</a> : <span class="keyword">public</span> wxWindow {
 | |
| 00330 <span class="keyword">public</span>:
 | |
| <a name="l00333"></a><a class="code" href="classwxActiveX_1_1ParamX.html">00333</a>         <span class="keyword">class </span><a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a> 
 | |
| 00334         {
 | |
| 00335         <span class="keyword">public</span>:
 | |
| 00336                 USHORT      flags;
 | |
| 00337         <span class="keywordtype">bool</span> isPtr, isSafeArray;
 | |
| 00338                 VARTYPE     vt;
 | |
| 00339         wxString    name;
 | |
| 00340 
 | |
| 00341         <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a>() : vt(VT_EMPTY) {}
 | |
| 00342                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsIn()<span class="keyword"> const                </span>{<span class="keywordflow">return</span> (flags & IDLFLAG_FIN) != 0;}
 | |
| 00343                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsOut()<span class="keyword"> const               </span>{<span class="keywordflow">return</span> (flags & IDLFLAG_FOUT) != 0;}
 | |
| 00344                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsRetVal()<span class="keyword"> const    </span>{<span class="keywordflow">return</span> (flags & IDLFLAG_FRETVAL) != 0;}
 | |
| 00345         };
 | |
| 00346         <span class="keyword">typedef</span> vector<ParamX>  ParamXArray;
 | |
| 00347 
 | |
| <a name="l00350"></a><a class="code" href="classwxActiveX_1_1FuncX.html">00350</a>     <span class="keyword">class </span><a class="code" href="classwxActiveX_1_1FuncX.html">FuncX</a> 
 | |
| 00351     {
 | |
| 00352     <span class="keyword">public</span>:
 | |
| 00353         wxString    name;
 | |
| 00354         MEMBERID    memid;
 | |
| 00355                 <span class="keywordtype">bool</span>            hasOut;
 | |
| 00356 
 | |
| 00357         <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a>      retType;
 | |
| 00358                 ParamXArray     params;
 | |
| 00359     };
 | |
| 00360 
 | |
| <a name="l00362"></a><a class="code" href="classwxActiveX_1_1PropX.html">00362</a>         <span class="keyword">class </span><a class="code" href="classwxActiveX_1_1PropX.html">PropX</a>
 | |
| 00363         {
 | |
| 00364         <span class="keyword">public</span>:
 | |
| 00365                 wxString        name;
 | |
| 00366         MEMBERID    memid;
 | |
| 00367         <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a>      type;
 | |
| 00368         <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a>      arg;
 | |
| 00369                 <span class="keywordtype">bool</span>            putByRef;
 | |
| 00370 
 | |
| 00371                 <a class="code" href="classwxActiveX_1_1PropX.html">PropX</a>() : putByRef (<span class="keyword">false</span>) {}
 | |
| 00372                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> CanGet()<span class="keyword"> const </span>{<span class="keywordflow">return</span> type.<a class="code" href="classwxActiveX_1_1ParamX.html#m3">vt</a> != VT_EMPTY;}
 | |
| 00373                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> CanSet()<span class="keyword"> const </span>{<span class="keywordflow">return</span> arg.<a class="code" href="classwxActiveX_1_1ParamX.html#m3">vt</a> != VT_EMPTY;}
 | |
| 00374         };
 | |
| 00375 
 | |
| 00377     <a class="code" href="classwxActiveX.html#a0">wxActiveX</a>(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1,
 | |
| 00378         <span class="keyword">const</span> wxPoint& pos = wxDefaultPosition,
 | |
| 00379         <span class="keyword">const</span> wxSize& size = wxDefaultSize,
 | |
| 00380         <span class="keywordtype">long</span> style = 0,
 | |
| 00381         <span class="keyword">const</span> wxString& name = wxPanelNameStr);
 | |
| 00383     <a class="code" href="classwxActiveX.html#a0">wxActiveX</a>(wxWindow * parent, wxString progId, wxWindowID id = -1,
 | |
| 00384         <span class="keyword">const</span> wxPoint& pos = wxDefaultPosition,
 | |
| 00385         <span class="keyword">const</span> wxSize& size = wxDefaultSize,
 | |
| 00386         <span class="keywordtype">long</span> style = 0,
 | |
| 00387         <span class="keyword">const</span> wxString& name = wxPanelNameStr);
 | |
| 00388         <span class="keyword">virtual</span> ~<a class="code" href="classwxActiveX.html">wxActiveX</a>();
 | |
| 00389 
 | |
| <a name="l00391"></a><a class="code" href="classwxActiveX.html#a3">00391</a>     <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classwxActiveX.html#a3">GetEventCount</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_events.size();}
 | |
| 00394     <span class="keyword">const</span> FuncX& <a class="code" href="classwxActiveX.html#a4">GetEventDesc</a>(<span class="keywordtype">int</span> idx) <span class="keyword">const</span>;
 | |
| 00395 
 | |
| <a name="l00397"></a><a class="code" href="classwxActiveX.html#a5">00397</a>     <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classwxActiveX.html#a5">GetPropCount</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_props.size();}
 | |
| 00400     <span class="keyword">const</span> PropX& <a class="code" href="classwxActiveX.html#a6">GetPropDesc</a>(<span class="keywordtype">int</span> idx) <span class="keyword">const</span>;
 | |
| 00403     <span class="keyword">const</span> PropX& <a class="code" href="classwxActiveX.html#a6">GetPropDesc</a>(wxString name) <span class="keyword">const</span>;
 | |
| 00404 
 | |
| <a name="l00406"></a><a class="code" href="classwxActiveX.html#a8">00406</a>     <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classwxActiveX.html#a8">GetMethodCount</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_methods.size();}
 | |
| 00409     <span class="keyword">const</span> FuncX& <a class="code" href="classwxActiveX.html#a9">GetMethodDesc</a>(<span class="keywordtype">int</span> idx) <span class="keyword">const</span>;
 | |
| 00412     <span class="keyword">const</span> FuncX& <a class="code" href="classwxActiveX.html#a9">GetMethodDesc</a>(wxString name) <span class="keyword">const</span>;
 | |
| 00413 
 | |
| 00415     <span class="keywordtype">void</span> <a class="code" href="classwxActiveX.html#a11">SetProp</a>(MEMBERID name, VARIANTARG& value);
 | |
| 00417     <span class="keywordtype">void</span> <a class="code" href="classwxActiveX.html#a11">SetProp</a>(<span class="keyword">const</span> wxString &name, <span class="keyword">const</span> wxVariant &value);
 | |
| 00418     
 | |
| 00419     <span class="keyword">class </span>wxPropertySetter
 | |
| 00420     {
 | |
| 00421     <span class="keyword">public</span>:
 | |
| 00422         <a class="code" href="classwxActiveX.html">wxActiveX</a> *m_ctl;
 | |
| 00423         wxString m_propName;
 | |
| 00424 
 | |
| 00425         wxPropertySetter(<a class="code" href="classwxActiveX.html">wxActiveX</a> *ctl, wxString propName) : 
 | |
| 00426             m_ctl(ctl), m_propName(propName) {}
 | |
| 00427         
 | |
| 00428         <span class="keyword">inline</span> <span class="keyword">const</span> wxPropertySetter& operator = (wxVariant v)<span class="keyword"> const</span>
 | |
| 00429 <span class="keyword">        </span>{
 | |
| 00430             m_ctl-><a class="code" href="classwxActiveX.html#a11">SetProp</a>(m_propName, v);
 | |
| 00431             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
 | |
| 00432         };
 | |
| 00433 
 | |
| 00434         <span class="keyword">inline</span> operator wxVariant()<span class="keyword"> const   </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a16">GetPropAsWxVariant</a>(m_propName);};
 | |
| 00435         <span class="keyword">inline</span> operator wxString()<span class="keyword"> const    </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a17">GetPropAsString</a>(m_propName);};
 | |
| 00436         <span class="keyword">inline</span> operator char()<span class="keyword"> const        </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a18">GetPropAsChar</a>(m_propName);};
 | |
| 00437         <span class="keyword">inline</span> operator long()<span class="keyword"> const        </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a19">GetPropAsLong</a>(m_propName);};
 | |
| 00438         <span class="keyword">inline</span> operator bool()<span class="keyword"> const        </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a20">GetPropAsBool</a>(m_propName);};
 | |
| 00439         <span class="keyword">inline</span> operator double()<span class="keyword"> const      </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a21">GetPropAsDouble</a>(m_propName);};
 | |
| 00440         <span class="keyword">inline</span> operator wxDateTime()<span class="keyword"> const  </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a22">GetPropAsDateTime</a>(m_propName);};
 | |
| 00441         <span class="keyword">inline</span> operator void *()<span class="keyword"> const      </span>{<span class="keywordflow">return</span> m_ctl-><a class="code" href="classwxActiveX.html#a23">GetPropAsPointer</a>(m_propName);};
 | |
| 00442     };
 | |
| 00443 
 | |
| <a name="l00458"></a><a class="code" href="classwxActiveX.html#a13">00458</a>     <span class="keyword">inline</span> wxPropertySetter <a class="code" href="classwxActiveX.html#a13">Prop</a>(wxString name) {<span class="keywordflow">return</span> wxPropertySetter(<span class="keyword">this</span>, name);}
 | |
| 00459 
 | |
| 00460     VARIANT GetPropAsVariant(MEMBERID name);
 | |
| 00461     VARIANT GetPropAsVariant(<span class="keyword">const</span> wxString& name);
 | |
| 00462     wxVariant GetPropAsWxVariant(<span class="keyword">const</span> wxString& name);
 | |
| 00463     wxString GetPropAsString(<span class="keyword">const</span> wxString& name);
 | |
| 00464     <span class="keywordtype">char</span> GetPropAsChar(<span class="keyword">const</span> wxString& name);
 | |
| 00465     <span class="keywordtype">long</span> GetPropAsLong(<span class="keyword">const</span> wxString& name);
 | |
| 00466     <span class="keywordtype">bool</span> GetPropAsBool(<span class="keyword">const</span> wxString& name);
 | |
| 00467     <span class="keywordtype">double</span> GetPropAsDouble(<span class="keyword">const</span> wxString& name);
 | |
| 00468     wxDateTime GetPropAsDateTime(<span class="keyword">const</span> wxString& name);
 | |
| 00469     <span class="keywordtype">void</span> *GetPropAsPointer(<span class="keyword">const</span> wxString& name);
 | |
| 00470 
 | |
| 00471     <span class="comment">// methods</span>
 | |
| 00472     <span class="comment">// VARIANTARG form is passed straight to Invoke, </span>
 | |
| 00473     <span class="comment">// so args in *REVERSE* order</span>
 | |
| 00474     VARIANT <a class="code" href="classwxActiveX.html#a26">CallMethod</a>(MEMBERID name, VARIANTARG args[], <span class="keywordtype">int</span> argc);
 | |
| 00475     VARIANT <a class="code" href="classwxActiveX.html#a26">CallMethod</a>(wxString name, VARIANTARG args[] = NULL, <span class="keywordtype">int</span> argc = -1);
 | |
| 00476     <span class="comment">// args are in *NORMAL* order</span>
 | |
| 00477     <span class="comment">// args can be a single wxVariant or an array</span>
 | |
| 00493 <span class="comment">    wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);</span>
 | |
| 00494 
 | |
| 00495         HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink);
 | |
| 00496 
 | |
| 00497         <span class="keywordtype">void</span> OnSize(wxSizeEvent&);
 | |
| 00498     <span class="keywordtype">void</span> OnPaint(wxPaintEvent& event);
 | |
| 00499     <span class="keywordtype">void</span> OnMouse(wxMouseEvent& event);
 | |
| 00500         <span class="keywordtype">void</span> OnSetFocus(wxFocusEvent&);
 | |
| 00501     <span class="keywordtype">void</span> OnKillFocus(wxFocusEvent&);
 | |
| 00502 
 | |
| 00503         DECLARE_EVENT_TABLE();
 | |
| 00504 
 | |
| 00505 <span class="keyword">protected</span>:
 | |
| 00506     <span class="keyword">friend</span> <span class="keyword">class </span>FrameSite;
 | |
| 00507     <span class="keyword">friend</span> <span class="keyword">class </span>wxActiveXEvents;
 | |
| 00508 
 | |
| 00509         <span class="keyword">typedef</span> map<MEMBERID, FuncX>    FuncXMap;
 | |
| 00510     <span class="keyword">typedef</span> map<wxString, FuncX, NS_wxActiveX::less_wxStringI>  FuncXStringMap;
 | |
| 00511         <span class="keyword">typedef</span> map<wxString, PropX, NS_wxActiveX::less_wxStringI> PropXMap;
 | |
| 00512         <span class="keyword">typedef</span> <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IConnectionPoint></a>    wxOleConnectionPoint;
 | |
| 00513         <span class="keyword">typedef</span> pair<wxOleConnectionPoint, DWORD>               wxOleConnection;
 | |
| 00514         <span class="keyword">typedef</span> vector<wxOleConnection>                                 wxOleConnectionArray;
 | |
| 00515 
 | |
| 00516         <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IDispatch></a>                   m_Dispatch;
 | |
| 00517     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleClientSite></a>      m_clientSite;
 | |
| 00518     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IUnknown></a>            m_ActiveX;
 | |
| 00519         <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleObject></a>                  m_oleObject;
 | |
| 00520         <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleInPlaceObject></a>   m_oleInPlaceObject;
 | |
| 00521     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleInPlaceActiveObject></a>
 | |
| 00522 
 | |
| 00523                                             m_oleInPlaceActiveObject;
 | |
| 00524     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleDocumentView></a>        m_docView;
 | |
| 00525     <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IViewObject></a>             m_viewObject;
 | |
| 00526         HWND m_oleObjectHWND;
 | |
| 00527     <span class="keywordtype">bool</span> m_bAmbientUserMode;
 | |
| 00528     DWORD m_docAdviseCookie;
 | |
| 00529         wxOleConnectionArray                                    m_connections;
 | |
| 00530 
 | |
| 00531         <span class="keywordtype">void</span> CreateActiveX(REFCLSID clsid);
 | |
| 00532     <span class="keywordtype">void</span> CreateActiveX(LPOLESTR progId);
 | |
| 00533     HRESULT AmbientPropertyChanged(DISPID dispid);
 | |
| 00534 
 | |
| 00535         <span class="keywordtype">void</span> GetTypeInfo();
 | |
| 00536         <span class="keywordtype">void</span> GetTypeInfo(ITypeInfo *ti, <span class="keywordtype">bool</span> defInterface, <span class="keywordtype">bool</span> defEventSink);
 | |
| 00537 
 | |
| 00538 
 | |
| 00539     <span class="comment">// events</span>
 | |
| 00540     FuncXMap            m_events;
 | |
| 00541 
 | |
| 00542         <span class="comment">// properties</span>
 | |
| 00543         PropXMap                m_props;
 | |
| 00544 
 | |
| 00545     <span class="comment">// Methods</span>
 | |
| 00546     FuncXStringMap  m_methods;
 | |
| 00547 
 | |
| 00548     <span class="keywordtype">long</span> MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
 | |
| 00549 };
 | |
| 00550 
 | |
| 00551 <span class="comment">// events</span>
 | |
| 00552 <span class="keyword">class </span>wxActiveXEvent : <span class="keyword">public</span> wxCommandEvent
 | |
| 00553 {
 | |
| 00554 <span class="keyword">private</span>:
 | |
| 00555     <span class="keyword">friend</span> <span class="keyword">class </span>wxActiveXEvents;
 | |
| 00556 
 | |
| 00557     wxVariant m_params;
 | |
| 00558 
 | |
| 00559 <span class="keyword">public</span>:
 | |
| 00560 
 | |
| 00561     <span class="keyword">virtual</span> wxEvent *Clone()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">new</span> wxActiveXEvent(*<span class="keyword">this</span>); }
 | |
| 00562 
 | |
| 00563     wxString EventName();
 | |
| 00564     <span class="keywordtype">int</span> ParamCount() <span class="keyword">const</span>;
 | |
| 00565     wxString ParamType(<span class="keywordtype">int</span> idx);
 | |
| 00566     wxString ParamName(<span class="keywordtype">int</span> idx);
 | |
| 00567     wxVariant& operator[] (<span class="keywordtype">int</span> idx);
 | |
| 00568     wxVariant& operator[] (wxString name);
 | |
| 00569 };
 | |
| 00570 
 | |
| 00571 <span class="keyword">const</span> wxEventType& RegisterActiveXEvent(<span class="keyword">const</span> wxChar *eventName);
 | |
| 00572 <span class="keyword">const</span> wxEventType& RegisterActiveXEvent(DISPID event);
 | |
| 00573 
 | |
| 00574 <span class="keyword">typedef</span> void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
 | |
| 00575 
 | |
| <a name="l00578"></a><a class="code" href="wxactivex_8h.html#a10">00578</a> <span class="preprocessor">#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),</span>
 | |
| <a name="l00581"></a><a class="code" href="wxactivex_8h.html#a11">00581</a> <span class="preprocessor">#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),</span>
 | |
| 00582 <span class="preprocessor"></span>
 | |
| 00583 <span class="comment">//util</span>
 | |
| 00584 <span class="keywordtype">bool</span> wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va);
 | |
| 00585 <span class="keywordtype">bool</span> VariantToWxDateTime(VARIANTARG va, wxDateTime& dt);
 | |
| 00596 <span class="keywordtype">bool</span> MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
 | |
| 00607 <span class="keywordtype">bool</span> VariantToMSWVariant(<span class="keyword">const</span> wxVariant& vx, VARIANTARG& va);
 | |
| 00608 
 | |
| 00609 <span class="preprocessor">#endif </span><span class="comment">/* _IEHTMLWIN_H_ */</span>
 | |
| </pre></div><hr><address style="align: right;"><small>Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by
 | |
| <a href="http://www.doxygen.org/index.html">
 | |
| <img src="doxygen.png" alt="doxygen" align="middle" border=0 
 | |
| width=110 height=53></a>1.3-rc3 </small></address>
 | |
| </body>
 | |
| </html>
 |