I'm using PHP to call an object on server with class COM, at IIS 7.
The object is well created, but when I'm using a method of it, PHP return this error:
PHP Fatal error: Uncaught exception 'com_exception' with message 'Parameter 5: Type mismatch.
The error occurs in the parameter $bd.
My PHP code:
$oem = new COM("LogicControlOEM.OEM_EjecutaOEM") or die("ERROR");
var_dump($oem);
$empresa = 1;
$usuario = 'XXX';
$pass = 'XXX';
$proveedor = '';
$servidor = 'XXXX';
$bd = 'example'; // I tried to putting a (string) and (String) before
$oem->InicializaOEM($empresa,
$usuario,
$pass,
$proveedor,
$servidor,
$bd);
var_dump($oem);
$oem = null;
I got the function that I want to use inside the component:
HRESULT InicializaOEM(
[in, out] short* intEmpresa,
[in, out] BSTR* sUserName,
[in, out] BSTR* sPassword,
[in, out, optional] BSTR* sProvider,
[in, out, optional] BSTR* sDataSource,
[in, out, optional] BSTR* sCatalog);
What type is BSTR and why only has problems with the last parameter? I think is a type of visual basic variable of string...
I tried those same parameters in a file .vbs and works fine.