ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
[PHP-DOC] cvs: phpdoc /en/faq com.xml
by Wez Furlong other posts by this author
Jan 4 2003 12:18PM messages near this date
[PHP-DOC] cvs: phpdoc /en/faq using.xml | [PHP-DOC] cvs: phpdoc /en/reference/var/functions serialize.xml unserialize.xml
wez		Sat Jan  4 07:18:24 2003 EDT

  Modified files:              
    /phpdoc/en/faq	com.xml 
  Log:
  Added the text from my commit message about how to sink (handle) COM events.
  
  
Index: phpdoc/en/faq/com.xml
diff -u phpdoc/en/faq/com.xml:1.9 phpdoc/en/faq/com.xml:1.10
--- phpdoc/en/faq/com.xml:1.9	Mon Apr 29 08:05:52 2002
+++ phpdoc/en/faq/com.xml	Sat Jan  4 07:18:22 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?> 
-<!-- $Revision: 1.9 $ --> 
+<!-- $Revision: 1.10 $ --> 
  <chapter id="faq.com"> 
   <title> PHP and COM</title>
   <titleabbrev> PHP and COM</titleabbrev>
@@ -201,7 +201,44 @@
     </question> 
     <answer> 
      <para> 
-      Not yet.
+      Starting in PHP 4.3.0, you can define an event sink and bind it as shown
+      in the example below.  You can use <function> com_print_typeinfo</function>
+      to have PHP generate a skeleton for the event sink class.
+
+      <example> 
+       <title> COM event sink example</title>
+       <programlisting role="php"> 
+<![CDATA[
+<?php
+class IEEventSinker {
+  var $terminated = false;
+
+  function ProgressChange($progress, $progressmax) {
+    echo "Download progress: $progress / $progressmax\n";
+  }
+
+  function DocumentComplete(&$dom, $url) {
+    echo "Document $url complete\n";
+  }
+
+  function OnQuit() {
+    echo "Quit!\n";
+    $this-> terminated = true;
+  }
+}
+$ie = new COM("InternetExplorer.Application");
+$sink =& new IEEventSinker();
+com_event_sink($ie, $sink, "DWebBrowserEvents2");
+$ie-> Visible = true;
+$ie-> Navigate("http://www.php.net");
+while(!$sink-> terminated) {
+  com_message_pump(4000);
+}
+$ie = null;
+?> 
+]]> 
+       </programlisting> 
+      </example> 
      </para> 
     </answer> 
    </qandaentry> 



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved