Re: [PHP] Calling API on Windows?

2006-02-24 Thread Jochem Maas
HoWang Wang wrote:
 Hi,
 
 How can I use it?
 For example:
 [lib='user32.dll'] int MessageBoxA(int handle, char *text, char
 *caption, int type);
 How can I write this sentence?
 What is the format?
 And I want to use GetComputerNameA, what can I do?
 
 ?php
 $win32_idl = [lib='user32.dll'] int MessageBoxA(int handle, char *text,
 char *caption, int type);
 [lib='kernel32.dll'] int GetComputerNameA (char *lpBuffer, DWORD nSize);;
 
 $ffi = new ffi($win32_idl);
 $compname = '';
 $r = $ffi-GetComputerNameA($compname,255);
 echo $r; //Debug
 echo $ffi-MessageBoxA(0, The Computer Name is  . $compname, Test, 0);
 ?
 
 doesn't work, it give me an error.

could you please move the roof of your house so I
can see your computer monitor? (what's the error?)

did you search for the error on google or yahoo or
insert-favorite-search-engine?


 Please help, thx!
 
 
 Jochem Maas wrote:
 
Hi Ho, (7 dwarfs anyone? ;-)

click this link to download php4.4.2 (not the installer version)
it contains the DLL your looking for:

http://hk.php.net/get/php-4.4.2-Win32.zip/from/a/mirror

in the event that your using php5 then w32api is no longer
available - it has been replaced with fcc:

http://pecl.php.net/package/ffi

you can download a binary ddl (built automatically from cvs) here:
http://pecl4win.php.net/ext.php/php_ffi.dll


HoWang Wang wrote:


Dear all,

I have a question on w32api ( http://hk.php.net/manual/en/ref.w32api.php
). I'm developing a command line program with PHP on windows, and I want
to call some API. But I cannot found the dll required for the w32api
extension. I'm using PHP/5.0.5, does anyone have an idea? Or there is
another extension can call Windows API?

Thanks
Ho Wang

 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling API on Windows?

2006-02-24 Thread HoWang Wang
Okay, here is the error:
http://hwhome.hkto.net:808/apidie.jpg
I'm using CHT version of windows, but I think you should seen this
window before.

I've searched on google, but I find lots of ffi that != Foreign Function
Interface :(

I found this:
http://www.cweiske.de/download/phpgtk/pear/System_WinDrives.phps which
use PHP's w32api on PHP4 and use FFI on PHP5. But it provide a simple
example of using ffi only, and I'm still confused on it.

Please help, Thx!

Ho Wang


Jochem Maas wrote:
 HoWang Wang wrote:
 
Hi,

How can I use it?
For example:
[lib='user32.dll'] int MessageBoxA(int handle, char *text, char
*caption, int type);
How can I write this sentence?
What is the format?
And I want to use GetComputerNameA, what can I do?

?php
$win32_idl = [lib='user32.dll'] int MessageBoxA(int handle, char *text,
char *caption, int type);
[lib='kernel32.dll'] int GetComputerNameA (char *lpBuffer, DWORD nSize);;

$ffi = new ffi($win32_idl);
$compname = '';
$r = $ffi-GetComputerNameA($compname,255);
echo $r; //Debug
echo $ffi-MessageBoxA(0, The Computer Name is  . $compname, Test, 0);
?

doesn't work, it give me an error.
 
 
 could you please move the roof of your house so I
 can see your computer monitor? (what's the error?)
 
 did you search for the error on google or yahoo or
 insert-favorite-search-engine?
 
 
 
Please help, thx!


Jochem Maas wrote:


Hi Ho, (7 dwarfs anyone? ;-)

click this link to download php4.4.2 (not the installer version)
it contains the DLL your looking for:

http://hk.php.net/get/php-4.4.2-Win32.zip/from/a/mirror

in the event that your using php5 then w32api is no longer
available - it has been replaced with fcc:

http://pecl.php.net/package/ffi

you can download a binary ddl (built automatically from cvs) here:
http://pecl4win.php.net/ext.php/php_ffi.dll


HoWang Wang wrote:



Dear all,

I have a question on w32api ( http://hk.php.net/manual/en/ref.w32api.php
). I'm developing a command line program with PHP on windows, and I want
to call some API. But I cannot found the dll required for the w32api
extension. I'm using PHP/5.0.5, does anyone have an idea? Or there is
another extension can call Windows API?

Thanks
Ho Wang




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling API on Windows?

2006-02-24 Thread tg-php
Don't know if it helps much, but maybe there's something buried in WinBinder 
(http://www.winbinder.com) that could help.  It's a much better (IMO) Windows 
GUI for PHP than GTK is... and is windows specific so might have have w32/ffi 
helper functions.

Good luck!

-TG

= = = Original message = = =

Okay, here is the error:
http://hwhome.hkto.net:808/apidie.jpg
I'm using CHT version of windows, but I think you should seen this
window before.

I've searched on google, but I find lots of ffi that != Foreign Function
Interface :(

I found this:
http://www.cweiske.de/download/phpgtk/pear/System_WinDrives.phps which
use PHP's w32api on PHP4 and use FFI on PHP5. But it provide a simple
example of using ffi only, and I'm still confused on it.

Please help, Thx!

Ho Wang



___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling API on Windows?

2006-02-23 Thread Jochem Maas
Hi Ho, (7 dwarfs anyone? ;-)

click this link to download php4.4.2 (not the installer version)
it contains the DLL your looking for:

http://hk.php.net/get/php-4.4.2-Win32.zip/from/a/mirror

in the event that your using php5 then w32api is no longer
available - it has been replaced with fcc:

http://pecl.php.net/package/ffi

you can download a binary ddl (built automatically from cvs) here:
http://pecl4win.php.net/ext.php/php_ffi.dll


HoWang Wang wrote:
 Dear all,
 
 I have a question on w32api ( http://hk.php.net/manual/en/ref.w32api.php
 ). I'm developing a command line program with PHP on windows, and I want
 to call some API. But I cannot found the dll required for the w32api
 extension. I'm using PHP/5.0.5, does anyone have an idea? Or there is
 another extension can call Windows API?
 
 Thanks
 Ho Wang
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling API on Windows?

2006-02-23 Thread HoWang Wang
Hi,

How can I use it?
For example:
[lib='user32.dll'] int MessageBoxA(int handle, char *text, char
*caption, int type);
How can I write this sentence?
What is the format?
And I want to use GetComputerNameA, what can I do?

?php
$win32_idl = [lib='user32.dll'] int MessageBoxA(int handle, char *text,
char *caption, int type);
[lib='kernel32.dll'] int GetComputerNameA (char *lpBuffer, DWORD nSize);;

$ffi = new ffi($win32_idl);
$compname = '';
$r = $ffi-GetComputerNameA($compname,255);
echo $r; //Debug
echo $ffi-MessageBoxA(0, The Computer Name is  . $compname, Test, 0);
?

doesn't work, it give me an error.
Please help, thx!


Jochem Maas wrote:
 Hi Ho, (7 dwarfs anyone? ;-)
 
 click this link to download php4.4.2 (not the installer version)
 it contains the DLL your looking for:
 
 http://hk.php.net/get/php-4.4.2-Win32.zip/from/a/mirror
 
 in the event that your using php5 then w32api is no longer
 available - it has been replaced with fcc:
 
 http://pecl.php.net/package/ffi
 
 you can download a binary ddl (built automatically from cvs) here:
 http://pecl4win.php.net/ext.php/php_ffi.dll
 
 
 HoWang Wang wrote:
 
Dear all,

I have a question on w32api ( http://hk.php.net/manual/en/ref.w32api.php
). I'm developing a command line program with PHP on windows, and I want
to call some API. But I cannot found the dll required for the w32api
extension. I'm using PHP/5.0.5, does anyone have an idea? Or there is
another extension can call Windows API?

Thanks
Ho Wang


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php