|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32170 com_event_sink does not take default event interface
Submitted: 2005-03-03 12:14 UTC Modified: 2005-03-17 01:00 UTC
Avg. Score:4.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: jeanpierre dot vincent at gmail dot com Assigned:
Status: No Feedback Package: COM related
PHP Version: 5.0.1 OS: windows 2000, xp
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-03-03 12:14 UTC] jeanpierre dot vincent at gmail dot com
the function com_event_sink is documented like this:
bool com_event_sink ( variant comobject, object sinkobject [, mixed sinkinterface] ).
but the sinkinterface  does not take value of the default com object event interface so optional is useless because the developper must know all default object event sink interface.

Reproduce code:
class IEEventSinker {
  var $terminated = false;

// when all objects of page are loaded
	function DocumentComplete(&$dom, $url) {
		GLOBAL $ie;
		if ($GLOBALS['elem']!=null)
			com_event_sink($GLOBALS['elem'],$this /*,'HTMLAnchorEvents'*/);
// when closing browser
	function OnQuit() {
		echo "Quit!\n";
		$this->terminated = true;
// when clicking in url
	function onclick() {
		echo "click!\n";
$ie = new COM("InternetExplorer.Application");
// note that you don't need the & for PHP 5!
$sink = new IEEventSinker();
com_event_sink($ie, $sink, "DWebBrowserEvents2");
$ie->Visible = true;

while(!$sink->terminated) {
$ie = null;

<body >
<A id='test' href='#'>test</A>

Expected result:
browser is launching, navigate on test.html file.
when we click to url test the message is to be written in the console :

Actual result:
no message written.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 10:00 UTC]
Please try using this CVS snapshot:
For Windows:
 [2005-03-09 11:48 UTC] jeanpierre dot vincent at gmail dot com
with this version we have a big regression,it does not solve the bug and a simple example of catching DocumentComplete event of WebBrowser does not work as before : it's not even called.
 [2005-03-09 21:40 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-03-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 14:01:29 2024 UTC