php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27474 w32api_register_function missed in newer version php?
Submitted: 2004-03-02 22:45 UTC Modified: 2004-03-07 01:03 UTC
From: azsd at hotmail dot com Assigned:
Status: Closed Package: Win32API related
PHP Version: 4.3.4 OS: Windows2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: azsd at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-03-02 22:45 UTC] azsd at hotmail dot com
Description:
------------
Dear developers:
When I try to use w32api_register_function in my php test scripts comes from orginal phpmanel like this:
<?php
w32api_register_function("User32.dll", 
                         "MessageBoxA",
                         "long");
MessageBoxA(NULL,
           "Hello World!", 
           "PHP MessageBox", 
           0); 
?>
It reports a fetal error like this:

Fatal error: Call to undefined function: w32api_register_function() in E:\My Webs\xxxx\apitest.php on line 2

I am using 4.3.4 stable version of PHP.
in php.ini set
extension=php_w32api.dll
and phpinfo() shows
Win32 API
Win32 API Support  enabled  

other extension like gdlib works fine.
My web server is IIS6,Windows 2003,Use ISAPI mode of PHP.
some other guys using these version occoured same errors.
somebody told me this win32api functions only works in older php version like php4.0.0,is that ture?
or how can i get the functions back in PHP Version 4.3.4?
thanks.

Reproduce code:
---------------
<?php
w32api_register_function("User32.dll", 
                         "MessageBoxA",
                         "long");
MessageBoxA(NULL,
           "Hello World!", 
           "PHP MessageBox", 
           0); 
?>

Expected result:
----------------
popup a message box with title:Hello world

Actual result:
--------------
Fatal error: Call to undefined function: w32api_register_function() in E:\My Webs\xxxx\apitest.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-02 23:04 UTC] azsd at hotmail dot com
by the way,I downloaded new CVS version Built On: Mar 03, 2004 01:30 GMT,It always has same error results.
 [2004-03-03 02:52 UTC] irchtml@php.net
The php_w32api.dll extension must be loaded in php.ini:
extension=php_w32api.dll 
(check that extension_dir is correct)
or using dl('php_w32api.dll')
 [2004-03-03 04:02 UTC] azsd at hotmail dot com
thanks your reply,Dear sir
mmm,in ISAPI mode dl() been disabled automaticly.
surely I setted the extension_dir,other extensions like GDlib,Zip,Sockets all works fine.
this condition once comes in 4.2.0 RC2,and fixed on CVS by developers,
Right now it comes back.
Is that mean-es someone who always use some part code earlier(than that fix) version to rewrited the fixed codes??
I am not much know CVS,:P
 [2004-03-06 01:25 UTC] azsd at hotmail dot com
er....

why problemes still exists in newst cvs.

I think the problem occured in php_w32api.dll.
may be it havent contain function strings to getmodual.
strange things other extension dlls are release version,
except php_w32api.dll were debug version,may be some codes are commented using macro in debug compiler environment?

I am a pascal code,I am hardly trying to find where the bugs in code now.
 [2004-03-06 01:35 UTC] azsd at hotmail dot com
I am sure it's php_w32api.dll's error now.
May be win32api.dsp settings mistake.
hope it can fix in next release of PHP.
 [2004-03-07 01:01 UTC] azsd at hotmail dot com
I am sorry,I have wrong point.
In 4.3.4 the win32apu extensions changes to Win32::RegisterFunction,
It's old version in php manual so that confused most new guys like me.
Suggust add this Win32::RegisterFunction description entry to old w32api_register_function page in manual.

thx
 [2004-03-07 01:03 UTC] azsd at hotmail dot com
sorry.
close it and wishes new entry add to manual.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 22:01:28 2021 UTC