Commit Graph

4 Commits

Author SHA1 Message Date
Wez Furlong
e04d6ca9f7 - Make sure that COM and VARIANT resources are returned as resources
rather than longs.
- Make the IDispatch implementation a bit more generic (and
  fix my mess of pointers).
- Add new com_message_pump() function that acts like an interruptible
  usleep() that processes COM calls/events.
- Add new com_print_typeinfo() function for "decompiling" the typeinfo
  for an interface into PHP script.  This is useful for generating a
  skeleton for use as an event sink.
- Add new com_event_sink() function for sinking events from COM
  objects.  Usage is like this:

<?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;
?>
2002-05-21 18:58:11 +00:00
Harald Radi
9a6fe9631e com_*() functions returned an oo-resource instead of an resource id,
thus subsequent com_*() calls to com-returnvalues failed.
2001-09-08 20:40:56 +00:00
Harald Radi
9c6b9eb76b merged from EXPERIMENTAL
lots of cleanup work
2001-08-13 23:39:11 +00:00
Harald Radi
3949658942 cleanup
added some macros
2001-06-24 21:09:17 +00:00