ID:               16628
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Assigned
 Bug Type:         Unknown/Other Function
 Operating System: Windows XP Pro
 PHP Version:      4.2.0
-Assigned To:      
+Assigned To:      sander
 New Comment:

Yeah, I see what's wrong. I'll fix it tonight when I can get into CVS
again...


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

[2002-04-16 03:46:58] [EMAIL PROTECTED]

Using the Windows binary build of PHP 4.2.0 RC4, the function
w32api_invoke_function() seems to be broken. With the w32api extension
loaded, I can call other w32api functions such as
w32api_register_function(), but if I call w32api_invoke_function() PHP
spits out this error:

<b>Fatal error</b>:  Call to undefined function: 
w32api_invoke_function() in <b
>C:\source\uptime.php</b> on line <b>13</b>

uptime.php is a test script I downloaded from the w32api CVS directory.
Here it is:

<?php

        dl("php_w32api.dll");

        w32api_register_function("kernel32.dll",
                                 "GetTickCount",
                                 W32_LONG);

        w32api_register_function("User32.dll",
                                 "MessageBoxA",
                                 W32_LONG);

        $ticks = w32api_invoke_function("GetTickCount");

        $secs = floor($ticks / 1000);
        $mins = floor($secs / 60);
        $hours = floor($mins / 60);

        $str = sprintf("You have been using your computer for:".
                        "\r\n %d Milliseconds, or \r\n %d Seconds".
                        "or \r\n %d mins or\r\n %d hours %d mins.",
                        $ticks,
                        $secs,
                        $mins,
                        $hours,
                        $mins - ($hours*60));

        w32api_invoke_function("MessageBoxA",
                                NULL,
                                $str,
                                "Uptime Information",
                                MB_OK);
?>

php_w32api.dll is the only module I'm loading. w32api_invoke_function()
*does* exist in CVS and looks like it should work just fine, but
apparently something broke when the binaries were built. I can't
re-build anything myself since I don't own a copy of Microsoft VC++.

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


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

Reply via email to