]>
Commit | Line | Data |
---|---|---|
b7c75283 RD |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> | |
3 | <title>wxactivex.h Source File</title> | |
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> | |
5 | </head><body> | |
6 | <!-- Generated by Doxygen 1.3-rc3 --> | |
7 | <center> | |
8 | <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> | |
9 | <hr><h1>wxactivex.h</h1><a href="wxactivex_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 | |
10 | 00005 <span class="preprocessor">#ifndef WX_ACTIVE_X</span> | |
11 | 00006 <span class="preprocessor"></span><span class="preprocessor">#define WX_ACTIVE_X</span> | |
12 | 00007 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4101 4786)</span> | |
13 | 00008 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786)</span> | |
14 | 00009 <span class="preprocessor"></span> | |
15 | 00010 | |
16 | 00011 <span class="preprocessor">#include <wx/setup.h></span> | |
17 | 00012 <span class="preprocessor">#include <wx/wx.h></span> | |
18 | 00013 <span class="preprocessor">#include <wx/variant.h></span> | |
19 | 00014 <span class="preprocessor">#include <wx/datetime.h></span> | |
20 | 00015 <span class="preprocessor">#include <oleidl.h></span> | |
21 | 00016 <span class="preprocessor">#include <exdisp.h></span> | |
22 | 00017 <span class="preprocessor">#include <docobj.h></span> | |
23 | 00018 <span class="preprocessor">#include <iostream></span> | |
24 | 00019 <span class="preprocessor">#include <vector></span> | |
25 | 00020 <span class="preprocessor">#include <map></span> | |
26 | 00021 <span class="keyword">using</span> <span class="keyword">namespace </span>std; | |
27 | 00022 | |
28 | <a name="l00024"></a><a class="code" href="namespaceNS__wxActiveX.html">00024</a> <span class="keyword">namespace </span>NS_wxActiveX | |
29 | 00025 { | |
30 | <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> | |
31 | 00030 { | |
32 | 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> | |
33 | 00032 <span class="keyword"> </span>{ | |
34 | 00033 <span class="keywordflow">return</span> x.CmpNoCase(y) < 0; | |
35 | 00034 }; | |
36 | 00035 }; | |
37 | 00036 }; | |
38 | 00037 | |
39 | 00038 | |
40 | <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> | |
41 | 00046 { | |
42 | 00047 <span class="keyword">protected</span>: | |
43 | 00048 I *m_interface; | |
44 | 00049 | |
45 | 00050 <span class="keyword">public</span>: | |
46 | <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) {} | |
47 | 00054 | |
48 | <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) | |
49 | 00057 { | |
50 | 00058 <a class="code" href="classwxAutoOleInterface.html#a9">QueryInterface</a>(riid, pUnk); | |
51 | 00059 }; | |
52 | <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) | |
53 | 00062 { | |
54 | 00063 <a class="code" href="classwxAutoOleInterface.html#a9">QueryInterface</a>(riid, pDispatch); | |
55 | 00064 }; | |
56 | 00065 | |
57 | <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) | |
58 | 00068 { | |
59 | 00069 <a class="code" href="classwxAutoOleInterface.html#a10">CreateInstance</a>(clsid, riid); | |
60 | 00070 }; | |
61 | 00071 | |
62 | <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) | |
63 | 00074 { | |
64 | 00075 <a class="code" href="classwxAutoOleInterface.html#a5">operator = </a>(ti); | |
65 | 00076 } | |
66 | 00077 | |
67 | <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) | |
68 | 00080 { | |
69 | 00081 <span class="keywordflow">if</span> (ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>) | |
70 | 00082 ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>->AddRef(); | |
71 | 00083 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>(); | |
72 | 00084 m_interface = ti.<a class="code" href="classwxAutoOleInterface.html#n0">m_interface</a>; | |
73 | 00085 <span class="keywordflow">return</span> *<span class="keyword">this</span>; | |
74 | 00086 } | |
75 | 00087 | |
76 | <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) | |
77 | 00091 { | |
78 | 00092 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>(); | |
79 | 00093 m_interface = ti; | |
80 | 00094 <span class="keywordflow">return</span> *<span class="keyword">this</span>; | |
81 | 00095 } | |
82 | 00096 | |
83 | <a name="l00098"></a><a class="code" href="classwxAutoOleInterface.html#a7">00098</a> <a class="code" href="classwxAutoOleInterface.html#a7">~wxAutoOleInterface</a>() | |
84 | 00099 { | |
85 | 00100 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>(); | |
86 | 00101 }; | |
87 | 00102 | |
88 | 00103 | |
89 | <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>() | |
90 | 00106 { | |
91 | 00107 <span class="keywordflow">if</span> (m_interface) | |
92 | 00108 m_interface->Release(); | |
93 | 00109 m_interface = NULL; | |
94 | 00110 }; | |
95 | 00111 | |
96 | <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) | |
97 | 00114 { | |
98 | 00115 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>(); | |
99 | 00116 wxASSERT(pUnk != NULL); | |
100 | 00117 <span class="keywordflow">return</span> pUnk->QueryInterface(riid, (<span class="keywordtype">void</span> **) &m_interface); | |
101 | 00118 }; | |
102 | 00119 | |
103 | <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) | |
104 | 00122 { | |
105 | 00123 <a class="code" href="classwxAutoOleInterface.html#a8">Free</a>(); | |
106 | 00124 <span class="keywordflow">return</span> CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (<span class="keywordtype">void</span> **) &m_interface); | |
107 | 00125 }; | |
108 | 00126 | |
109 | 00127 | |
110 | <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;} | |
111 | 00130 | |
112 | <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;} | |
113 | <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;} | |
114 | <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;} | |
115 | 00137 }; | |
116 | 00138 | |
117 | 00139 | |
118 | 00142 wxString <a class="code" href="wxactivex_8h.html#a13">OLEHResultToString</a>(HRESULT hr); | |
119 | 00145 wxString <a class="code" href="wxactivex_8h.html#a14">GetIIDName</a>(REFIID riid); | |
120 | 00146 | |
121 | 00147 <span class="comment">//#define __WXOLEDEBUG</span> | |
122 | 00148 | |
123 | 00149 | |
124 | 00150 <span class="preprocessor">#ifdef __WXOLEDEBUG</span> | |
125 | 00151 <span class="preprocessor"></span><span class="preprocessor"> #define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}</span> | |
126 | 00152 <span class="preprocessor"></span><span class="preprocessor"> #define WXOLE_TRACEOUT(stuff)\</span> | |
127 | 00153 <span class="preprocessor"> {\</span> | |
128 | 00154 <span class="preprocessor"> wxString os;\</span> | |
129 | 00155 <span class="preprocessor"> os << stuff << "\r\n";\</span> | |
130 | 00156 <span class="preprocessor"> WXOLE_TRACE(os.mb_str());\</span> | |
131 | 00157 <span class="preprocessor"> }</span> | |
132 | 00158 <span class="preprocessor"></span> | |
133 | 00159 <span class="preprocessor"> #define WXOLE_WARN(__hr,msg)\</span> | |
134 | 00160 <span class="preprocessor"> {\</span> | |
135 | 00161 <span class="preprocessor"> if (__hr != S_OK)\</span> | |
136 | 00162 <span class="preprocessor"> {\</span> | |
137 | 00163 <span class="preprocessor"> wxString s = "*** ";\</span> | |
138 | 00164 <span class="preprocessor"> s += msg;\</span> | |
139 | 00165 <span class="preprocessor"> s += " : "+ OLEHResultToString(__hr);\</span> | |
140 | 00166 <span class="preprocessor"> WXOLE_TRACE(s.c_str());\</span> | |
141 | 00167 <span class="preprocessor"> }\</span> | |
142 | 00168 <span class="preprocessor"> }</span> | |
143 | 00169 <span class="preprocessor"></span><span class="preprocessor">#else</span> | |
144 | 00170 <span class="preprocessor"></span><span class="preprocessor"> #define WXOLE_TRACE(str)</span> | |
145 | 00171 <span class="preprocessor"></span><span class="preprocessor"> #define WXOLE_TRACEOUT(stuff)</span> | |
146 | 00172 <span class="preprocessor"></span><span class="preprocessor"> #define WXOLE_WARN(_proc,msg) {_proc;}</span> | |
147 | 00173 <span class="preprocessor"></span><span class="preprocessor">#endif</span> | |
148 | 00174 <span class="preprocessor"></span> | |
149 | 00175 <span class="keyword">class </span>wxOleInit | |
150 | 00176 { | |
151 | 00177 <span class="keyword">public</span>: | |
152 | 00178 <span class="keyword">static</span> IMalloc *GetIMalloc(); | |
153 | 00179 | |
154 | 00180 wxOleInit(); | |
155 | 00181 ~wxOleInit(); | |
156 | 00182 }; | |
157 | 00183 | |
158 | 00184 <span class="preprocessor">#define DECLARE_OLE_UNKNOWN(cls)\</span> | |
159 | 00185 <span class="preprocessor"> private:\</span> | |
160 | 00186 <span class="preprocessor"> class TAutoInitInt\</span> | |
161 | 00187 <span class="preprocessor"> {\</span> | |
162 | 00188 <span class="preprocessor"> public:\</span> | |
163 | 00189 <span class="preprocessor"> LONG l;\</span> | |
164 | 00190 <span class="preprocessor"> TAutoInitInt() : l(0) {}\</span> | |
165 | 00191 <span class="preprocessor"> };\</span> | |
166 | 00192 <span class="preprocessor"> TAutoInitInt refCount, lockCount;\</span> | |
167 | 00193 <span class="preprocessor"> wxOleInit oleInit;\</span> | |
168 | 00194 <span class="preprocessor"> static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\</span> | |
169 | 00195 <span class="preprocessor"> public:\</span> | |
170 | 00196 <span class="preprocessor"> LONG GetRefCount();\</span> | |
171 | 00197 <span class="preprocessor"> HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\</span> | |
172 | 00198 <span class="preprocessor"> ULONG STDMETHODCALLTYPE AddRef();\</span> | |
173 | 00199 <span class="preprocessor"> ULONG STDMETHODCALLTYPE Release();\</span> | |
174 | 00200 <span class="preprocessor"> ULONG STDMETHODCALLTYPE AddLock();\</span> | |
175 | 00201 <span class="preprocessor"> ULONG STDMETHODCALLTYPE ReleaseLock()</span> | |
176 | 00202 <span class="preprocessor"></span> | |
177 | 00203 <span class="preprocessor">#define DEFINE_OLE_TABLE(cls)\</span> | |
178 | 00204 <span class="preprocessor"> LONG cls::GetRefCount() {return refCount.l;}\</span> | |
179 | 00205 <span class="preprocessor"> HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\</span> | |
180 | 00206 <span class="preprocessor"> {\</span> | |
181 | 00207 <span class="preprocessor"> if (! ppvObject)\</span> | |
182 | 00208 <span class="preprocessor"> {\</span> | |
183 | 00209 <span class="preprocessor"> WXOLE_TRACE("*** NULL POINTER ***");\</span> | |
184 | 00210 <span class="preprocessor"> return E_FAIL;\</span> | |
185 | 00211 <span class="preprocessor"> };\</span> | |
186 | 00212 <span class="preprocessor"> const char *desc = NULL;\</span> | |
187 | 00213 <span class="preprocessor"> cls::_GetInterface(this, iid, ppvObject, desc);\</span> | |
188 | 00214 <span class="preprocessor"> if (! *ppvObject)\</span> | |
189 | 00215 <span class="preprocessor"> {\</span> | |
190 | 00216 <span class="preprocessor"> WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\</span> | |
191 | 00217 <span class="preprocessor"> return E_NOINTERFACE;\</span> | |
192 | 00218 <span class="preprocessor"> };\</span> | |
193 | 00219 <span class="preprocessor"> WXOLE_TRACEOUT("QI : <" << desc <<">");\</span> | |
194 | 00220 <span class="preprocessor"> ((IUnknown * )(*ppvObject))->AddRef();\</span> | |
195 | 00221 <span class="preprocessor"> return S_OK;\</span> | |
196 | 00222 <span class="preprocessor"> };\</span> | |
197 | 00223 <span class="preprocessor"> ULONG STDMETHODCALLTYPE cls::AddRef()\</span> | |
198 | 00224 <span class="preprocessor"> {\</span> | |
199 | 00225 <span class="preprocessor"> WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\</span> | |
200 | 00226 <span class="preprocessor"> InterlockedIncrement(&refCount.l);\</span> | |
201 | 00227 <span class="preprocessor"> return refCount.l;\</span> | |
202 | 00228 <span class="preprocessor"> };\</span> | |
203 | 00229 <span class="preprocessor"> ULONG STDMETHODCALLTYPE cls::Release()\</span> | |
204 | 00230 <span class="preprocessor"> {\</span> | |
205 | 00231 <span class="preprocessor"> if (refCount.l > 0)\</span> | |
206 | 00232 <span class="preprocessor"> {\</span> | |
207 | 00233 <span class="preprocessor"> InterlockedDecrement(&refCount.l);\</span> | |
208 | 00234 <span class="preprocessor"> WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\</span> | |
209 | 00235 <span class="preprocessor"> if (refCount.l == 0)\</span> | |
210 | 00236 <span class="preprocessor"> {\</span> | |
211 | 00237 <span class="preprocessor"> delete this;\</span> | |
212 | 00238 <span class="preprocessor"> return 0;\</span> | |
213 | 00239 <span class="preprocessor"> };\</span> | |
214 | 00240 <span class="preprocessor"> return refCount.l;\</span> | |
215 | 00241 <span class="preprocessor"> }\</span> | |
216 | 00242 <span class="preprocessor"> else\</span> | |
217 | 00243 <span class="preprocessor"> return 0;\</span> | |
218 | 00244 <span class="preprocessor"> }\</span> | |
219 | 00245 <span class="preprocessor"> ULONG STDMETHODCALLTYPE cls::AddLock()\</span> | |
220 | 00246 <span class="preprocessor"> {\</span> | |
221 | 00247 <span class="preprocessor"> WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\</span> | |
222 | 00248 <span class="preprocessor"> InterlockedIncrement(&lockCount.l);\</span> | |
223 | 00249 <span class="preprocessor"> return lockCount.l;\</span> | |
224 | 00250 <span class="preprocessor"> };\</span> | |
225 | 00251 <span class="preprocessor"> ULONG STDMETHODCALLTYPE cls::ReleaseLock()\</span> | |
226 | 00252 <span class="preprocessor"> {\</span> | |
227 | 00253 <span class="preprocessor"> if (lockCount.l > 0)\</span> | |
228 | 00254 <span class="preprocessor"> {\</span> | |
229 | 00255 <span class="preprocessor"> InterlockedDecrement(&lockCount.l);\</span> | |
230 | 00256 <span class="preprocessor"> WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\</span> | |
231 | 00257 <span class="preprocessor"> return lockCount.l;\</span> | |
232 | 00258 <span class="preprocessor"> }\</span> | |
233 | 00259 <span class="preprocessor"> else\</span> | |
234 | 00260 <span class="preprocessor"> return 0;\</span> | |
235 | 00261 <span class="preprocessor"> }\</span> | |
236 | 00262 <span class="preprocessor"> DEFINE_OLE_BASE(cls)</span> | |
237 | 00263 <span class="preprocessor"></span> | |
238 | 00264 <span class="preprocessor">#define DEFINE_OLE_BASE(cls)\</span> | |
239 | 00265 <span class="preprocessor"> void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\</span> | |
240 | 00266 <span class="preprocessor"> {\</span> | |
241 | 00267 <span class="preprocessor"> *_interface = NULL;\</span> | |
242 | 00268 <span class="preprocessor"> desc = NULL;</span> | |
243 | 00269 <span class="preprocessor"></span> | |
244 | 00270 <span class="preprocessor">#define OLE_INTERFACE(_iid, _type)\</span> | |
245 | 00271 <span class="preprocessor"> if (IsEqualIID(iid, _iid))\</span> | |
246 | 00272 <span class="preprocessor"> {\</span> | |
247 | 00273 <span class="preprocessor"> WXOLE_TRACE("Found Interface <" # _type ">");\</span> | |
248 | 00274 <span class="preprocessor"> *_interface = (IUnknown *) (_type *) self;\</span> | |
249 | 00275 <span class="preprocessor"> desc = # _iid;\</span> | |
250 | 00276 <span class="preprocessor"> return;\</span> | |
251 | 00277 <span class="preprocessor"> }</span> | |
252 | 00278 <span class="preprocessor"></span> | |
253 | 00279 <span class="preprocessor">#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)</span> | |
254 | 00280 <span class="preprocessor"></span> | |
255 | 00281 <span class="preprocessor">#define OLE_INTERFACE_CUSTOM(func)\</span> | |
256 | 00282 <span class="preprocessor"> if (func(self, iid, _interface, desc))\</span> | |
257 | 00283 <span class="preprocessor"> {\</span> | |
258 | 00284 <span class="preprocessor"> return;\</span> | |
259 | 00285 <span class="preprocessor"> }</span> | |
260 | 00286 <span class="preprocessor"></span> | |
261 | 00287 <span class="preprocessor">#define END_OLE_TABLE\</span> | |
262 | 00288 <span class="preprocessor"> }</span> | |
263 | 00289 <span class="preprocessor"></span> | |
264 | 00290 | |
265 | 00328 | |
266 | <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 { | |
267 | 00330 <span class="keyword">public</span>: | |
268 | <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> | |
269 | 00334 { | |
270 | 00335 <span class="keyword">public</span>: | |
271 | 00336 USHORT flags; | |
272 | 00337 <span class="keywordtype">bool</span> isPtr, isSafeArray; | |
273 | 00338 VARTYPE vt; | |
274 | 00339 wxString name; | |
275 | 00340 | |
276 | 00341 <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a>() : vt(VT_EMPTY) {} | |
277 | 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;} | |
278 | 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;} | |
279 | 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;} | |
280 | 00345 }; | |
281 | 00346 <span class="keyword">typedef</span> vector<ParamX> ParamXArray; | |
282 | 00347 | |
283 | <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> | |
284 | 00351 { | |
285 | 00352 <span class="keyword">public</span>: | |
286 | 00353 wxString name; | |
287 | 00354 MEMBERID memid; | |
288 | 00355 <span class="keywordtype">bool</span> hasOut; | |
289 | 00356 | |
290 | 00357 <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a> retType; | |
291 | 00358 ParamXArray params; | |
292 | 00359 }; | |
293 | 00360 | |
294 | <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> | |
295 | 00363 { | |
296 | 00364 <span class="keyword">public</span>: | |
297 | 00365 wxString name; | |
298 | 00366 MEMBERID memid; | |
299 | 00367 <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a> type; | |
300 | 00368 <a class="code" href="classwxActiveX_1_1ParamX.html">ParamX</a> arg; | |
301 | 00369 <span class="keywordtype">bool</span> putByRef; | |
302 | 00370 | |
303 | 00371 <a class="code" href="classwxActiveX_1_1PropX.html">PropX</a>() : putByRef (<span class="keyword">false</span>) {} | |
304 | 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;} | |
305 | 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;} | |
306 | 00374 }; | |
307 | 00375 | |
308 | 00377 <a class="code" href="classwxActiveX.html#a0">wxActiveX</a>(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1, | |
309 | 00378 <span class="keyword">const</span> wxPoint& pos = wxDefaultPosition, | |
310 | 00379 <span class="keyword">const</span> wxSize& size = wxDefaultSize, | |
311 | 00380 <span class="keywordtype">long</span> style = 0, | |
312 | 00381 <span class="keyword">const</span> wxString& name = wxPanelNameStr); | |
313 | 00383 <a class="code" href="classwxActiveX.html#a0">wxActiveX</a>(wxWindow * parent, wxString progId, wxWindowID id = -1, | |
314 | 00384 <span class="keyword">const</span> wxPoint& pos = wxDefaultPosition, | |
315 | 00385 <span class="keyword">const</span> wxSize& size = wxDefaultSize, | |
316 | 00386 <span class="keywordtype">long</span> style = 0, | |
317 | 00387 <span class="keyword">const</span> wxString& name = wxPanelNameStr); | |
318 | 00388 <span class="keyword">virtual</span> ~<a class="code" href="classwxActiveX.html">wxActiveX</a>(); | |
319 | 00389 | |
320 | <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();} | |
321 | 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>; | |
322 | 00395 | |
323 | <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();} | |
324 | 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>; | |
325 | 00403 <span class="keyword">const</span> PropX& <a class="code" href="classwxActiveX.html#a6">GetPropDesc</a>(wxString name) <span class="keyword">const</span>; | |
326 | 00404 | |
327 | <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();} | |
328 | 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>; | |
329 | 00412 <span class="keyword">const</span> FuncX& <a class="code" href="classwxActiveX.html#a9">GetMethodDesc</a>(wxString name) <span class="keyword">const</span>; | |
330 | 00413 | |
331 | 00415 <span class="keywordtype">void</span> <a class="code" href="classwxActiveX.html#a11">SetProp</a>(MEMBERID name, VARIANTARG& value); | |
332 | 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); | |
333 | 00418 | |
334 | 00419 <span class="keyword">class </span>wxPropertySetter | |
335 | 00420 { | |
336 | 00421 <span class="keyword">public</span>: | |
337 | 00422 <a class="code" href="classwxActiveX.html">wxActiveX</a> *m_ctl; | |
338 | 00423 wxString m_propName; | |
339 | 00424 | |
340 | 00425 wxPropertySetter(<a class="code" href="classwxActiveX.html">wxActiveX</a> *ctl, wxString propName) : | |
341 | 00426 m_ctl(ctl), m_propName(propName) {} | |
342 | 00427 | |
343 | 00428 <span class="keyword">inline</span> <span class="keyword">const</span> wxPropertySetter& operator = (wxVariant v)<span class="keyword"> const</span> | |
344 | 00429 <span class="keyword"> </span>{ | |
345 | 00430 m_ctl-><a class="code" href="classwxActiveX.html#a11">SetProp</a>(m_propName, v); | |
346 | 00431 <span class="keywordflow">return</span> *<span class="keyword">this</span>; | |
347 | 00432 }; | |
348 | 00433 | |
349 | 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);}; | |
350 | 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);}; | |
351 | 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);}; | |
352 | 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);}; | |
353 | 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);}; | |
354 | 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);}; | |
355 | 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);}; | |
356 | 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);}; | |
357 | 00442 }; | |
358 | 00443 | |
359 | <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);} | |
360 | 00459 | |
361 | 00460 VARIANT GetPropAsVariant(MEMBERID name); | |
362 | 00461 VARIANT GetPropAsVariant(<span class="keyword">const</span> wxString& name); | |
363 | 00462 wxVariant GetPropAsWxVariant(<span class="keyword">const</span> wxString& name); | |
364 | 00463 wxString GetPropAsString(<span class="keyword">const</span> wxString& name); | |
365 | 00464 <span class="keywordtype">char</span> GetPropAsChar(<span class="keyword">const</span> wxString& name); | |
366 | 00465 <span class="keywordtype">long</span> GetPropAsLong(<span class="keyword">const</span> wxString& name); | |
367 | 00466 <span class="keywordtype">bool</span> GetPropAsBool(<span class="keyword">const</span> wxString& name); | |
368 | 00467 <span class="keywordtype">double</span> GetPropAsDouble(<span class="keyword">const</span> wxString& name); | |
369 | 00468 wxDateTime GetPropAsDateTime(<span class="keyword">const</span> wxString& name); | |
370 | 00469 <span class="keywordtype">void</span> *GetPropAsPointer(<span class="keyword">const</span> wxString& name); | |
371 | 00470 | |
372 | 00471 <span class="comment">// methods</span> | |
373 | 00472 <span class="comment">// VARIANTARG form is passed straight to Invoke, </span> | |
374 | 00473 <span class="comment">// so args in *REVERSE* order</span> | |
375 | 00474 VARIANT <a class="code" href="classwxActiveX.html#a26">CallMethod</a>(MEMBERID name, VARIANTARG args[], <span class="keywordtype">int</span> argc); | |
376 | 00475 VARIANT <a class="code" href="classwxActiveX.html#a26">CallMethod</a>(wxString name, VARIANTARG args[] = NULL, <span class="keywordtype">int</span> argc = -1); | |
377 | 00476 <span class="comment">// args are in *NORMAL* order</span> | |
378 | 00477 <span class="comment">// args can be a single wxVariant or an array</span> | |
379 | 00493 <span class="comment"> wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);</span> | |
380 | 00494 | |
381 | 00495 HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink); | |
382 | 00496 | |
383 | 00497 <span class="keywordtype">void</span> OnSize(wxSizeEvent&); | |
384 | 00498 <span class="keywordtype">void</span> OnPaint(wxPaintEvent& event); | |
385 | 00499 <span class="keywordtype">void</span> OnMouse(wxMouseEvent& event); | |
386 | 00500 <span class="keywordtype">void</span> OnSetFocus(wxFocusEvent&); | |
387 | 00501 <span class="keywordtype">void</span> OnKillFocus(wxFocusEvent&); | |
388 | 00502 | |
389 | 00503 DECLARE_EVENT_TABLE(); | |
390 | 00504 | |
391 | 00505 <span class="keyword">protected</span>: | |
392 | 00506 <span class="keyword">friend</span> <span class="keyword">class </span>FrameSite; | |
393 | 00507 <span class="keyword">friend</span> <span class="keyword">class </span>wxActiveXEvents; | |
394 | 00508 | |
395 | 00509 <span class="keyword">typedef</span> map<MEMBERID, FuncX> FuncXMap; | |
396 | 00510 <span class="keyword">typedef</span> map<wxString, FuncX, NS_wxActiveX::less_wxStringI> FuncXStringMap; | |
397 | 00511 <span class="keyword">typedef</span> map<wxString, PropX, NS_wxActiveX::less_wxStringI> PropXMap; | |
398 | 00512 <span class="keyword">typedef</span> <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IConnectionPoint></a> wxOleConnectionPoint; | |
399 | 00513 <span class="keyword">typedef</span> pair<wxOleConnectionPoint, DWORD> wxOleConnection; | |
400 | 00514 <span class="keyword">typedef</span> vector<wxOleConnection> wxOleConnectionArray; | |
401 | 00515 | |
402 | 00516 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IDispatch></a> m_Dispatch; | |
403 | 00517 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleClientSite></a> m_clientSite; | |
404 | 00518 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IUnknown></a> m_ActiveX; | |
405 | 00519 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleObject></a> m_oleObject; | |
406 | 00520 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleInPlaceObject></a> m_oleInPlaceObject; | |
407 | 00521 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleInPlaceActiveObject></a> | |
408 | 00522 | |
409 | 00523 m_oleInPlaceActiveObject; | |
410 | 00524 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IOleDocumentView></a> m_docView; | |
411 | 00525 <a class="code" href="classwxAutoOleInterface.html">wxAutoOleInterface<IViewObject></a> m_viewObject; | |
412 | 00526 HWND m_oleObjectHWND; | |
413 | 00527 <span class="keywordtype">bool</span> m_bAmbientUserMode; | |
414 | 00528 DWORD m_docAdviseCookie; | |
415 | 00529 wxOleConnectionArray m_connections; | |
416 | 00530 | |
417 | 00531 <span class="keywordtype">void</span> CreateActiveX(REFCLSID clsid); | |
418 | 00532 <span class="keywordtype">void</span> CreateActiveX(LPOLESTR progId); | |
419 | 00533 HRESULT AmbientPropertyChanged(DISPID dispid); | |
420 | 00534 | |
421 | 00535 <span class="keywordtype">void</span> GetTypeInfo(); | |
422 | 00536 <span class="keywordtype">void</span> GetTypeInfo(ITypeInfo *ti, <span class="keywordtype">bool</span> defInterface, <span class="keywordtype">bool</span> defEventSink); | |
423 | 00537 | |
424 | 00538 | |
425 | 00539 <span class="comment">// events</span> | |
426 | 00540 FuncXMap m_events; | |
427 | 00541 | |
428 | 00542 <span class="comment">// properties</span> | |
429 | 00543 PropXMap m_props; | |
430 | 00544 | |
431 | 00545 <span class="comment">// Methods</span> | |
432 | 00546 FuncXStringMap m_methods; | |
433 | 00547 | |
434 | 00548 <span class="keywordtype">long</span> MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
435 | 00549 }; | |
436 | 00550 | |
437 | 00551 <span class="comment">// events</span> | |
438 | 00552 <span class="keyword">class </span>wxActiveXEvent : <span class="keyword">public</span> wxCommandEvent | |
439 | 00553 { | |
440 | 00554 <span class="keyword">private</span>: | |
441 | 00555 <span class="keyword">friend</span> <span class="keyword">class </span>wxActiveXEvents; | |
442 | 00556 | |
443 | 00557 wxVariant m_params; | |
444 | 00558 | |
445 | 00559 <span class="keyword">public</span>: | |
446 | 00560 | |
447 | 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>); } | |
448 | 00562 | |
449 | 00563 wxString EventName(); | |
450 | 00564 <span class="keywordtype">int</span> ParamCount() <span class="keyword">const</span>; | |
451 | 00565 wxString ParamType(<span class="keywordtype">int</span> idx); | |
452 | 00566 wxString ParamName(<span class="keywordtype">int</span> idx); | |
453 | 00567 wxVariant& operator[] (<span class="keywordtype">int</span> idx); | |
454 | 00568 wxVariant& operator[] (wxString name); | |
455 | 00569 }; | |
456 | 00570 | |
457 | 00571 <span class="keyword">const</span> wxEventType& RegisterActiveXEvent(<span class="keyword">const</span> wxChar *eventName); | |
458 | 00572 <span class="keyword">const</span> wxEventType& RegisterActiveXEvent(DISPID event); | |
459 | 00573 | |
460 | 00574 <span class="keyword">typedef</span> void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&); | |
461 | 00575 | |
462 | <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> | |
463 | <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> | |
464 | 00582 <span class="preprocessor"></span> | |
465 | 00583 <span class="comment">//util</span> | |
466 | 00584 <span class="keywordtype">bool</span> wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va); | |
467 | 00585 <span class="keywordtype">bool</span> VariantToWxDateTime(VARIANTARG va, wxDateTime& dt); | |
468 | 00596 <span class="keywordtype">bool</span> MSWVariantToVariant(VARIANTARG& va, wxVariant& vx); | |
469 | 00607 <span class="keywordtype">bool</span> VariantToMSWVariant(<span class="keyword">const</span> wxVariant& vx, VARIANTARG& va); | |
470 | 00608 | |
471 | 00609 <span class="preprocessor">#endif </span><span class="comment">/* _IEHTMLWIN_H_ */</span> | |
472 | </pre></div><hr><address style="align: right;"><small>Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by | |
473 | <a href="http://www.doxygen.org/index.html"> | |
474 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 | |
475 | width=110 height=53></a>1.3-rc3 </small></address> | |
476 | </body> | |
477 | </html> |