Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / embedding / browser / activex / src / common / CPMozillaControl.h
blob14283f177b6b8aac1b62995ced761828271457d5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
37 #ifndef CPMOZILLACONTROL_H
38 #define CPMOZILLACONTROL_H
40 //////////////////////////////////////////////////////////////////////////////
41 // CProxyDWebBrowserEvents
42 template <class T>
43 class CProxyDWebBrowserEvents : public IConnectionPointImpl<T, &DIID_DWebBrowserEvents, CComDynamicUnkArray>
45 public:
46 //methods:
47 //DWebBrowserEvents : IDispatch
48 public:
49 void Fire_BeforeNavigate(
50 BSTR URL,
51 long Flags,
52 BSTR TargetFrameName,
53 VARIANT * PostData,
54 BSTR Headers,
55 VARIANT_BOOL * Cancel)
57 VARIANTARG* pvars = new VARIANTARG[6];
58 for (int i = 0; i < 6; i++)
59 VariantInit(&pvars[i]);
60 T* pT = (T*)this;
61 pT->Lock();
62 IUnknown** pp = m_vec.begin();
63 while (pp < m_vec.end())
65 if (*pp != NULL)
67 pvars[5].vt = VT_BSTR;
68 pvars[5].bstrVal= URL;
69 pvars[4].vt = VT_I4;
70 pvars[4].lVal= Flags;
71 pvars[3].vt = VT_BSTR;
72 pvars[3].bstrVal= TargetFrameName;
73 pvars[2].vt = VT_VARIANT | VT_BYREF;
74 pvars[2].byref= PostData;
75 pvars[1].vt = VT_BSTR;
76 pvars[1].bstrVal= Headers;
77 pvars[0].vt = VT_BOOL | VT_BYREF;
78 pvars[0].byref= Cancel;
79 DISPPARAMS disp = { pvars, NULL, 6, 0 };
80 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
81 pDispatch->Invoke(0x64, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
83 pp++;
85 pT->Unlock();
86 delete[] pvars;
88 void Fire_NavigateComplete(
89 BSTR URL)
91 VARIANTARG* pvars = new VARIANTARG[1];
92 for (int i = 0; i < 1; i++)
93 VariantInit(&pvars[i]);
94 T* pT = (T*)this;
95 pT->Lock();
96 IUnknown** pp = m_vec.begin();
97 while (pp < m_vec.end())
99 if (*pp != NULL)
101 pvars[0].vt = VT_BSTR;
102 pvars[0].bstrVal= URL;
103 DISPPARAMS disp = { pvars, NULL, 1, 0 };
104 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
105 pDispatch->Invoke(0x65, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
107 pp++;
109 pT->Unlock();
110 delete[] pvars;
112 void Fire_StatusTextChange(
113 BSTR Text)
115 VARIANTARG* pvars = new VARIANTARG[1];
116 for (int i = 0; i < 1; i++)
117 VariantInit(&pvars[i]);
118 T* pT = (T*)this;
119 pT->Lock();
120 IUnknown** pp = m_vec.begin();
121 while (pp < m_vec.end())
123 if (*pp != NULL)
125 pvars[0].vt = VT_BSTR;
126 pvars[0].bstrVal= Text;
127 DISPPARAMS disp = { pvars, NULL, 1, 0 };
128 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
129 pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
131 pp++;
133 pT->Unlock();
134 delete[] pvars;
136 void Fire_ProgressChange(
137 long Progress,
138 long ProgressMax)
140 VARIANTARG* pvars = new VARIANTARG[2];
141 for (int i = 0; i < 2; i++)
142 VariantInit(&pvars[i]);
143 T* pT = (T*)this;
144 pT->Lock();
145 IUnknown** pp = m_vec.begin();
146 while (pp < m_vec.end())
148 if (*pp != NULL)
150 pvars[1].vt = VT_I4;
151 pvars[1].lVal= Progress;
152 pvars[0].vt = VT_I4;
153 pvars[0].lVal= ProgressMax;
154 DISPPARAMS disp = { pvars, NULL, 2, 0 };
155 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
156 pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
158 pp++;
160 pT->Unlock();
161 delete[] pvars;
163 void Fire_DownloadComplete()
165 T* pT = (T*)this;
166 pT->Lock();
167 IUnknown** pp = m_vec.begin();
168 while (pp < m_vec.end())
170 if (*pp != NULL)
172 DISPPARAMS disp = { NULL, NULL, 0, 0 };
173 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
174 pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
176 pp++;
178 pT->Unlock();
180 void Fire_CommandStateChange(
181 long Command,
182 VARIANT_BOOL Enable)
184 VARIANTARG* pvars = new VARIANTARG[2];
185 for (int i = 0; i < 2; i++)
186 VariantInit(&pvars[i]);
187 T* pT = (T*)this;
188 pT->Lock();
189 IUnknown** pp = m_vec.begin();
190 while (pp < m_vec.end())
192 if (*pp != NULL)
194 pvars[1].vt = VT_I4;
195 pvars[1].lVal= Command;
196 pvars[0].vt = VT_BOOL;
197 pvars[0].boolVal= Enable;
198 DISPPARAMS disp = { pvars, NULL, 2, 0 };
199 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
200 pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
202 pp++;
204 pT->Unlock();
205 delete[] pvars;
207 void Fire_DownloadBegin()
209 T* pT = (T*)this;
210 pT->Lock();
211 IUnknown** pp = m_vec.begin();
212 while (pp < m_vec.end())
214 if (*pp != NULL)
216 DISPPARAMS disp = { NULL, NULL, 0, 0 };
217 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
218 pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
220 pp++;
222 pT->Unlock();
224 void Fire_NewWindow(
225 BSTR URL,
226 long Flags,
227 BSTR TargetFrameName,
228 VARIANT * PostData,
229 BSTR Headers,
230 VARIANT_BOOL * Processed)
232 VARIANTARG* pvars = new VARIANTARG[6];
233 for (int i = 0; i < 6; i++)
234 VariantInit(&pvars[i]);
235 T* pT = (T*)this;
236 pT->Lock();
237 IUnknown** pp = m_vec.begin();
238 while (pp < m_vec.end())
240 if (*pp != NULL)
242 pvars[5].vt = VT_BSTR;
243 pvars[5].bstrVal= URL;
244 pvars[4].vt = VT_I4;
245 pvars[4].lVal= Flags;
246 pvars[3].vt = VT_BSTR;
247 pvars[3].bstrVal= TargetFrameName;
248 pvars[2].vt = VT_VARIANT | VT_BYREF;
249 pvars[2].byref= PostData;
250 pvars[1].vt = VT_BSTR;
251 pvars[1].bstrVal= Headers;
252 pvars[0].vt = VT_BOOL | VT_BYREF;
253 pvars[0].byref= Processed;
254 DISPPARAMS disp = { pvars, NULL, 6, 0 };
255 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
256 pDispatch->Invoke(0x6b, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
258 pp++;
260 pT->Unlock();
261 delete[] pvars;
263 void Fire_TitleChange(
264 BSTR Text)
266 VARIANTARG* pvars = new VARIANTARG[1];
267 for (int i = 0; i < 1; i++)
268 VariantInit(&pvars[i]);
269 T* pT = (T*)this;
270 pT->Lock();
271 IUnknown** pp = m_vec.begin();
272 while (pp < m_vec.end())
274 if (*pp != NULL)
276 pvars[0].vt = VT_BSTR;
277 pvars[0].bstrVal= Text;
278 DISPPARAMS disp = { pvars, NULL, 1, 0 };
279 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
280 pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
282 pp++;
284 pT->Unlock();
285 delete[] pvars;
287 void Fire_FrameBeforeNavigate(
288 BSTR URL,
289 long Flags,
290 BSTR TargetFrameName,
291 VARIANT * PostData,
292 BSTR Headers,
293 VARIANT_BOOL * Cancel)
295 VARIANTARG* pvars = new VARIANTARG[6];
296 for (int i = 0; i < 6; i++)
297 VariantInit(&pvars[i]);
298 T* pT = (T*)this;
299 pT->Lock();
300 IUnknown** pp = m_vec.begin();
301 while (pp < m_vec.end())
303 if (*pp != NULL)
305 pvars[5].vt = VT_BSTR;
306 pvars[5].bstrVal= URL;
307 pvars[4].vt = VT_I4;
308 pvars[4].lVal= Flags;
309 pvars[3].vt = VT_BSTR;
310 pvars[3].bstrVal= TargetFrameName;
311 pvars[2].vt = VT_VARIANT | VT_BYREF;
312 pvars[2].byref= PostData;
313 pvars[1].vt = VT_BSTR;
314 pvars[1].bstrVal= Headers;
315 pvars[0].vt = VT_BOOL | VT_BYREF;
316 pvars[0].byref= Cancel;
317 DISPPARAMS disp = { pvars, NULL, 6, 0 };
318 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
319 pDispatch->Invoke(0xc8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
321 pp++;
323 pT->Unlock();
324 delete[] pvars;
326 void Fire_FrameNavigateComplete(
327 BSTR URL)
329 VARIANTARG* pvars = new VARIANTARG[1];
330 for (int i = 0; i < 1; i++)
331 VariantInit(&pvars[i]);
332 T* pT = (T*)this;
333 pT->Lock();
334 IUnknown** pp = m_vec.begin();
335 while (pp < m_vec.end())
337 if (*pp != NULL)
339 pvars[0].vt = VT_BSTR;
340 pvars[0].bstrVal= URL;
341 DISPPARAMS disp = { pvars, NULL, 1, 0 };
342 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
343 pDispatch->Invoke(0xc9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
345 pp++;
347 pT->Unlock();
348 delete[] pvars;
350 void Fire_FrameNewWindow(
351 BSTR URL,
352 long Flags,
353 BSTR TargetFrameName,
354 VARIANT * PostData,
355 BSTR Headers,
356 VARIANT_BOOL * Processed)
358 VARIANTARG* pvars = new VARIANTARG[6];
359 for (int i = 0; i < 6; i++)
360 VariantInit(&pvars[i]);
361 T* pT = (T*)this;
362 pT->Lock();
363 IUnknown** pp = m_vec.begin();
364 while (pp < m_vec.end())
366 if (*pp != NULL)
368 pvars[5].vt = VT_BSTR;
369 pvars[5].bstrVal= URL;
370 pvars[4].vt = VT_I4;
371 pvars[4].lVal= Flags;
372 pvars[3].vt = VT_BSTR;
373 pvars[3].bstrVal= TargetFrameName;
374 pvars[2].vt = VT_VARIANT | VT_BYREF;
375 pvars[2].byref= PostData;
376 pvars[1].vt = VT_BSTR;
377 pvars[1].bstrVal= Headers;
378 pvars[0].vt = VT_BOOL | VT_BYREF;
379 pvars[0].byref= Processed;
380 DISPPARAMS disp = { pvars, NULL, 6, 0 };
381 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
382 pDispatch->Invoke(0xcc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
384 pp++;
386 pT->Unlock();
387 delete[] pvars;
389 void Fire_Quit(
390 VARIANT_BOOL * Cancel)
392 VARIANTARG* pvars = new VARIANTARG[1];
393 for (int i = 0; i < 1; i++)
394 VariantInit(&pvars[i]);
395 T* pT = (T*)this;
396 pT->Lock();
397 IUnknown** pp = m_vec.begin();
398 while (pp < m_vec.end())
400 if (*pp != NULL)
402 pvars[0].vt = VT_BOOL | VT_BYREF;
403 pvars[0].byref= Cancel;
404 DISPPARAMS disp = { pvars, NULL, 1, 0 };
405 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
406 pDispatch->Invoke(0x67, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
408 pp++;
410 pT->Unlock();
411 delete[] pvars;
413 void Fire_WindowMove()
415 T* pT = (T*)this;
416 pT->Lock();
417 IUnknown** pp = m_vec.begin();
418 while (pp < m_vec.end())
420 if (*pp != NULL)
422 DISPPARAMS disp = { NULL, NULL, 0, 0 };
423 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
424 pDispatch->Invoke(0x6d, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
426 pp++;
428 pT->Unlock();
430 void Fire_WindowResize()
432 T* pT = (T*)this;
433 pT->Lock();
434 IUnknown** pp = m_vec.begin();
435 while (pp < m_vec.end())
437 if (*pp != NULL)
439 DISPPARAMS disp = { NULL, NULL, 0, 0 };
440 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
441 pDispatch->Invoke(0x6e, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
443 pp++;
445 pT->Unlock();
447 void Fire_WindowActivate()
449 T* pT = (T*)this;
450 pT->Lock();
451 IUnknown** pp = m_vec.begin();
452 while (pp < m_vec.end())
454 if (*pp != NULL)
456 DISPPARAMS disp = { NULL, NULL, 0, 0 };
457 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
458 pDispatch->Invoke(0x6f, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
460 pp++;
462 pT->Unlock();
464 void Fire_PropertyChange(
465 BSTR Property)
467 VARIANTARG* pvars = new VARIANTARG[1];
468 for (int i = 0; i < 1; i++)
469 VariantInit(&pvars[i]);
470 T* pT = (T*)this;
471 pT->Lock();
472 IUnknown** pp = m_vec.begin();
473 while (pp < m_vec.end())
475 if (*pp != NULL)
477 pvars[0].vt = VT_BSTR;
478 pvars[0].bstrVal= Property;
479 DISPPARAMS disp = { pvars, NULL, 1, 0 };
480 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
481 pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
483 pp++;
485 pT->Unlock();
486 delete[] pvars;
492 //////////////////////////////////////////////////////////////////////////////
493 // CProxyDWebBrowserEvents2
494 template <class T>
495 class CProxyDWebBrowserEvents2 : public IConnectionPointImpl<T, &DIID_DWebBrowserEvents2, CComDynamicUnkArray>
497 public:
498 //methods:
499 //DWebBrowserEvents2 : IDispatch
500 public:
501 void Fire_StatusTextChange(
502 BSTR Text)
504 VARIANTARG* pvars = new VARIANTARG[1];
505 for (int i = 0; i < 1; i++)
506 VariantInit(&pvars[i]);
507 T* pT = (T*)this;
508 pT->Lock();
509 IUnknown** pp = m_vec.begin();
510 while (pp < m_vec.end())
512 if (*pp != NULL)
514 pvars[0].vt = VT_BSTR;
515 pvars[0].bstrVal= Text;
516 DISPPARAMS disp = { pvars, NULL, 1, 0 };
517 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
518 pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
520 pp++;
522 pT->Unlock();
523 delete[] pvars;
525 void Fire_ProgressChange(
526 long Progress,
527 long ProgressMax)
529 VARIANTARG* pvars = new VARIANTARG[2];
530 for (int i = 0; i < 2; i++)
531 VariantInit(&pvars[i]);
532 T* pT = (T*)this;
533 pT->Lock();
534 IUnknown** pp = m_vec.begin();
535 while (pp < m_vec.end())
537 if (*pp != NULL)
539 pvars[1].vt = VT_I4;
540 pvars[1].lVal= Progress;
541 pvars[0].vt = VT_I4;
542 pvars[0].lVal= ProgressMax;
543 DISPPARAMS disp = { pvars, NULL, 2, 0 };
544 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
545 pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
547 pp++;
549 pT->Unlock();
550 delete[] pvars;
552 void Fire_CommandStateChange(
553 long Command,
554 VARIANT_BOOL Enable)
556 VARIANTARG* pvars = new VARIANTARG[2];
557 for (int i = 0; i < 2; i++)
558 VariantInit(&pvars[i]);
559 T* pT = (T*)this;
560 pT->Lock();
561 IUnknown** pp = m_vec.begin();
562 while (pp < m_vec.end())
564 if (*pp != NULL)
566 pvars[1].vt = VT_I4;
567 pvars[1].lVal= Command;
568 pvars[0].vt = VT_BOOL;
569 pvars[0].boolVal= Enable;
570 DISPPARAMS disp = { pvars, NULL, 2, 0 };
571 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
572 pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
574 pp++;
576 pT->Unlock();
577 delete[] pvars;
579 void Fire_DownloadBegin()
581 T* pT = (T*)this;
582 pT->Lock();
583 IUnknown** pp = m_vec.begin();
584 while (pp < m_vec.end())
586 if (*pp != NULL)
588 DISPPARAMS disp = { NULL, NULL, 0, 0 };
589 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
590 pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
592 pp++;
594 pT->Unlock();
596 void Fire_DownloadComplete()
598 T* pT = (T*)this;
599 pT->Lock();
600 IUnknown** pp = m_vec.begin();
601 while (pp < m_vec.end())
603 if (*pp != NULL)
605 DISPPARAMS disp = { NULL, NULL, 0, 0 };
606 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
607 pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
609 pp++;
611 pT->Unlock();
613 void Fire_TitleChange(
614 BSTR Text)
616 VARIANTARG* pvars = new VARIANTARG[1];
617 for (int i = 0; i < 1; i++)
618 VariantInit(&pvars[i]);
619 T* pT = (T*)this;
620 pT->Lock();
621 IUnknown** pp = m_vec.begin();
622 while (pp < m_vec.end())
624 if (*pp != NULL)
626 pvars[0].vt = VT_BSTR;
627 pvars[0].bstrVal= Text;
628 DISPPARAMS disp = { pvars, NULL, 1, 0 };
629 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
630 pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
632 pp++;
634 pT->Unlock();
635 delete[] pvars;
637 void Fire_PropertyChange(
638 BSTR szProperty)
640 VARIANTARG* pvars = new VARIANTARG[1];
641 for (int i = 0; i < 1; i++)
642 VariantInit(&pvars[i]);
643 T* pT = (T*)this;
644 pT->Lock();
645 IUnknown** pp = m_vec.begin();
646 while (pp < m_vec.end())
648 if (*pp != NULL)
650 pvars[0].vt = VT_BSTR;
651 pvars[0].bstrVal= szProperty;
652 DISPPARAMS disp = { pvars, NULL, 1, 0 };
653 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
654 pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
656 pp++;
658 pT->Unlock();
659 delete[] pvars;
661 void Fire_BeforeNavigate2(
662 IDispatch * pDisp,
663 VARIANT * URL,
664 VARIANT * Flags,
665 VARIANT * TargetFrameName,
666 VARIANT * PostData,
667 VARIANT * Headers,
668 VARIANT_BOOL * Cancel)
670 VARIANTARG* pvars = new VARIANTARG[7];
671 for (int i = 0; i < 7; i++)
672 VariantInit(&pvars[i]);
673 T* pT = (T*)this;
674 pT->Lock();
675 IUnknown** pp = m_vec.begin();
676 while (pp < m_vec.end())
678 if (*pp != NULL)
680 pvars[6].vt = VT_DISPATCH;
681 pvars[6].pdispVal= pDisp;
682 pvars[5].vt = VT_VARIANT | VT_BYREF;
683 pvars[5].byref= URL;
684 pvars[4].vt = VT_VARIANT | VT_BYREF;
685 pvars[4].byref= Flags;
686 pvars[3].vt = VT_VARIANT | VT_BYREF;
687 pvars[3].byref= TargetFrameName;
688 pvars[2].vt = VT_VARIANT | VT_BYREF;
689 pvars[2].byref= PostData;
690 pvars[1].vt = VT_VARIANT | VT_BYREF;
691 pvars[1].byref= Headers;
692 pvars[0].vt = VT_BOOL | VT_BYREF;
693 pvars[0].byref= Cancel;
694 DISPPARAMS disp = { pvars, NULL, 7, 0 };
695 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
696 pDispatch->Invoke(0xfa, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
698 pp++;
700 pT->Unlock();
701 delete[] pvars;
703 void Fire_NewWindow2(
704 IDispatch * * ppDisp,
705 VARIANT_BOOL * Cancel)
707 VARIANTARG* pvars = new VARIANTARG[2];
708 for (int i = 0; i < 2; i++)
709 VariantInit(&pvars[i]);
710 T* pT = (T*)this;
711 pT->Lock();
712 IUnknown** pp = m_vec.begin();
713 while (pp < m_vec.end())
715 if (*pp != NULL)
717 pvars[1].vt = VT_DISPATCH | VT_BYREF;
718 pvars[1].byref= ppDisp;
719 pvars[0].vt = VT_BOOL | VT_BYREF;
720 pvars[0].byref= Cancel;
721 DISPPARAMS disp = { pvars, NULL, 2, 0 };
722 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
723 pDispatch->Invoke(0xfb, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
725 pp++;
727 pT->Unlock();
728 delete[] pvars;
730 void Fire_NavigateComplete2(
731 IDispatch * pDisp,
732 VARIANT * URL)
734 VARIANTARG* pvars = new VARIANTARG[2];
735 for (int i = 0; i < 2; i++)
736 VariantInit(&pvars[i]);
737 T* pT = (T*)this;
738 pT->Lock();
739 IUnknown** pp = m_vec.begin();
740 while (pp < m_vec.end())
742 if (*pp != NULL)
744 pvars[1].vt = VT_DISPATCH;
745 pvars[1].pdispVal= pDisp;
746 pvars[0].vt = VT_VARIANT | VT_BYREF;
747 pvars[0].byref= URL;
748 DISPPARAMS disp = { pvars, NULL, 2, 0 };
749 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
750 pDispatch->Invoke(0xfc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
752 pp++;
754 pT->Unlock();
755 delete[] pvars;
757 void Fire_DocumentComplete(
758 IDispatch * pDisp,
759 VARIANT * URL)
761 VARIANTARG* pvars = new VARIANTARG[2];
762 for (int i = 0; i < 2; i++)
763 VariantInit(&pvars[i]);
764 T* pT = (T*)this;
765 pT->Lock();
766 IUnknown** pp = m_vec.begin();
767 while (pp < m_vec.end())
769 if (*pp != NULL)
771 pvars[1].vt = VT_DISPATCH;
772 pvars[1].pdispVal= pDisp;
773 pvars[0].vt = VT_VARIANT | VT_BYREF;
774 pvars[0].byref= URL;
775 DISPPARAMS disp = { pvars, NULL, 2, 0 };
776 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
777 pDispatch->Invoke(0x103, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
779 pp++;
781 pT->Unlock();
782 delete[] pvars;
784 void Fire_OnQuit()
786 T* pT = (T*)this;
787 pT->Lock();
788 IUnknown** pp = m_vec.begin();
789 while (pp < m_vec.end())
791 if (*pp != NULL)
793 DISPPARAMS disp = { NULL, NULL, 0, 0 };
794 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
795 pDispatch->Invoke(0xfd, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
797 pp++;
799 pT->Unlock();
801 void Fire_OnVisible(
802 VARIANT_BOOL Visible)
804 VARIANTARG* pvars = new VARIANTARG[1];
805 for (int i = 0; i < 1; i++)
806 VariantInit(&pvars[i]);
807 T* pT = (T*)this;
808 pT->Lock();
809 IUnknown** pp = m_vec.begin();
810 while (pp < m_vec.end())
812 if (*pp != NULL)
814 pvars[0].vt = VT_BOOL;
815 pvars[0].boolVal= Visible;
816 DISPPARAMS disp = { pvars, NULL, 1, 0 };
817 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
818 pDispatch->Invoke(0xfe, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
820 pp++;
822 pT->Unlock();
823 delete[] pvars;
825 void Fire_OnToolBar(
826 VARIANT_BOOL ToolBar)
828 VARIANTARG* pvars = new VARIANTARG[1];
829 for (int i = 0; i < 1; i++)
830 VariantInit(&pvars[i]);
831 T* pT = (T*)this;
832 pT->Lock();
833 IUnknown** pp = m_vec.begin();
834 while (pp < m_vec.end())
836 if (*pp != NULL)
838 pvars[0].vt = VT_BOOL;
839 pvars[0].boolVal= ToolBar;
840 DISPPARAMS disp = { pvars, NULL, 1, 0 };
841 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
842 pDispatch->Invoke(0xff, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
844 pp++;
846 pT->Unlock();
847 delete[] pvars;
849 void Fire_OnMenuBar(
850 VARIANT_BOOL MenuBar)
852 VARIANTARG* pvars = new VARIANTARG[1];
853 for (int i = 0; i < 1; i++)
854 VariantInit(&pvars[i]);
855 T* pT = (T*)this;
856 pT->Lock();
857 IUnknown** pp = m_vec.begin();
858 while (pp < m_vec.end())
860 if (*pp != NULL)
862 pvars[0].vt = VT_BOOL;
863 pvars[0].boolVal= MenuBar;
864 DISPPARAMS disp = { pvars, NULL, 1, 0 };
865 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
866 pDispatch->Invoke(0x100, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
868 pp++;
870 pT->Unlock();
871 delete[] pvars;
873 void Fire_OnStatusBar(
874 VARIANT_BOOL StatusBar)
876 VARIANTARG* pvars = new VARIANTARG[1];
877 for (int i = 0; i < 1; i++)
878 VariantInit(&pvars[i]);
879 T* pT = (T*)this;
880 pT->Lock();
881 IUnknown** pp = m_vec.begin();
882 while (pp < m_vec.end())
884 if (*pp != NULL)
886 pvars[0].vt = VT_BOOL;
887 pvars[0].boolVal= StatusBar;
888 DISPPARAMS disp = { pvars, NULL, 1, 0 };
889 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
890 pDispatch->Invoke(0x101, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
892 pp++;
894 pT->Unlock();
895 delete[] pvars;
897 void Fire_OnFullScreen(
898 VARIANT_BOOL FullScreen)
900 VARIANTARG* pvars = new VARIANTARG[1];
901 for (int i = 0; i < 1; i++)
902 VariantInit(&pvars[i]);
903 T* pT = (T*)this;
904 pT->Lock();
905 IUnknown** pp = m_vec.begin();
906 while (pp < m_vec.end())
908 if (*pp != NULL)
910 pvars[0].vt = VT_BOOL;
911 pvars[0].boolVal= FullScreen;
912 DISPPARAMS disp = { pvars, NULL, 1, 0 };
913 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
914 pDispatch->Invoke(0x102, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
916 pp++;
918 pT->Unlock();
919 delete[] pvars;
921 void Fire_OnTheaterMode(
922 VARIANT_BOOL TheaterMode)
924 VARIANTARG* pvars = new VARIANTARG[1];
925 for (int i = 0; i < 1; i++)
926 VariantInit(&pvars[i]);
927 T* pT = (T*)this;
928 pT->Lock();
929 IUnknown** pp = m_vec.begin();
930 while (pp < m_vec.end())
932 if (*pp != NULL)
934 pvars[0].vt = VT_BOOL;
935 pvars[0].boolVal= TheaterMode;
936 DISPPARAMS disp = { pvars, NULL, 1, 0 };
937 IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
938 pDispatch->Invoke(0x104, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
940 pp++;
942 pT->Unlock();
943 delete[] pvars;
949 #endif