Hi,
I'm using PHP 4.3.3 in CLI on Win XP SP1. I use the _experimental_
w32api. It seems to work quite fine yet I cannot pass a string argument
to any of my dll functions :
1) Load the w32api extension :
if (!dl("php_w32api.dll")) {
echo "Erreur : Impossible de chager le module php_w32api
(php_w32api.dll).";
exit;
}
2) Register the dll functions into the win32 class
$api = new win32;
$api->registerfunction("int CIALArtPrixClient(string AR_Ref,string
CT_NUM,int C
atTarif,int AG_NO1,int AG_NO2,double &RESULTAT) From cbodbc32.dll");
3) Call the function
$ar_ref="XVIS";
$ct_num="OPALE";
$ess->api->CIALArtPrixClient($ar_ref, $ct_num,2,0,0,$a);
The CIALArtPrixClient function is meant to retrieve the price of the
article 'AR_Ref' for the client 'CT_NUM' from a database. AG_NO1 and
AG_NO2 are to be ignored as they are numeric constants (I managed to
pass decimal values to some other functions). The last argument,
RESULTAT, is a reference to a double where to store the result (it also
works fine with another function).
When I try to run this code, the PHP script engine crashes (ending up
with a nice winxp 'send report' msgbox).
Does someone have any idea about how to pass a string as argument to a
dll exported function ?
Regards,
Mohamed Rambil