ID:               42551
 User updated by:  csaba at alum dot mit dot edu
 Reported By:      csaba at alum dot mit dot edu
 Status:           Assigned
 Bug Type:         COM related
 Operating System: Win XP Pro
 PHP Version:      5.2.4
 Assigned To:      wharmby
 New Comment:

There is another variant of this which crops up from time to time (I am
using version 5.2.6).  Unfortunately, I cannot detect any pattern in
when it happens.  It only happens with low frequency (around 2 percent
of the time), but when it happens my screen is filled with 31 error
warnings.  The following line

$oFSO = new COM("Scripting.FileSystemObject");

will (sometimes) cause 31 warnings of the following type:

Warning: com::com(): Type library constant BinaryCompare is already
defined in C:\phpScripts\myScript.php on line 32

The specific list of constants it complains about is:
BinaryCompare TextCompare DatabaseCompare ForReading ForWriting
ForAppending TristateTrue TristateFalse TristateUseDefault TristateMixed
Normal ReadOnly Hidden System Volume Directory Archive Alias Compressed
UnknownType Removable Fixed Remote CDRom RamDisk WindowsFolder
SystemFolder TemporaryFolder StdIn StdOut StdErr

This has even happened when the script was the very first thing that I
ran after a reboot.

In any case, I would expect that if the value of the constants is the
same, then I not get the complaint.


Previous Comments:
------------------------------------------------------------------------

[2007-09-05 12:44:45] j...@php.net

Assigned to the maintainer.

------------------------------------------------------------------------

[2007-09-04 21:13:55] csaba at alum dot mit dot edu

Description:
------------
When I attempt to do
$doc = new COM("HTMLFile");
this results in warnings that Type Library constants True and False are
already defined.  Otherwise, the script runs fine.

The equivalent code as a .vbs file runs wihtout complaints

Csaba Gabor from Vienna

Reproduce code:
---------------
<?php
$doc = new COM("HTMLFile");
$win = $doc->parentWindow;
print ($doc->location . "\n");

$win->ExecScript(
  "window.keepLooping=true");
$win->setTimeout (
  "alert('timeout works');
   window.keepLooping=false;", 2000);

while ($win->keepLooping)
  com_message_pump(200);
print ("Done Looping");
?>

Expected result:
----------------
The only thing I expect to see printed is:
about:blank
Done Looping

Actual result:
--------------
Warning: com::com(): Type library constant True is already defined in
C:\test2.php on line 2

Warning: com::com(): Type library constant False is already defined in
C:\test2.php on line 2
about:blank
Done Looping


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42551&edit=1

Reply via email to