bizen99
15th October 2002, 11:11
Hi,

I am trying to call ole functions trought PHP's COM functions, I put this sentence:

$baan = new COM("Baan4.Application.Intermas_gedas") or die("Unable to instantiate Word");

and then this error is shaw in bshell:

Error in CreateInstance(IUnknow*, REFIID, LPVOID*). SendOleEvent timed out

any ideas

Thanks

bizen99
15th October 2002, 11:40
Also show this error:

DispInvoke Failed, error -2345535

Guillaume.G
23rd December 2002, 10:58
Hi,

I very interested by this subject connect Baan and PHP, but i'm no lot of time for try this subject

so it's a small idea, if you have not recolve your pb, but in VB, you must define the Timeout attribut for Baan object com ==>
BaanObj.Timeout = 200


So it's perhaps the pb.

i'm a question, you can send me few information if the connection between PHP and Baan is possible ?

Thank you

Guillaume G

bizen99
13th March 2003, 15:56
Hi,

Sorry by my late post,

The code for connect from php to baan is:

$objConexion = new COM("baanconnection.BaanFactoryCOM");
$iRet = $objConexion->initializeUseCfgFile("D:\bajar\bois\ejemplobois\bcbe.cfg");

$objVenta = new COM("ccmcsmcs0145.ccmcsmcs0145COM");
$bRet = $objVenta->setFactory($objConexion);

$Venta = new COM("ccmcsmcs0145.Seqmcs0145COM");
$sVenta = new COM("ccmcsmcs0145.Structmcs0145COM");

$Error = new COM("ccmcsmcs0145.StructErrorCOM");

$sVenta->set_Zona("014");
$sVenta->set_Descripcion("Prueba 2");
$sVenta->set_RecordStatus("");
$Venta->addElement($sVenta);

$iRet = $objVenta->Create($Venta, "", 100, $Error);

If ($iRet == 0)
{
echo $Error->get_MesgDesc();
}
Else
{
echo $Error->get_MesgDesc();
}

// $sVenta->close();
// $Venta->close();
// $Error->close();

// $objVenta->terminateObject();
// $objConexion->shutdown();

// $objVenta->close();
// $objConexion->close();



but I don't know how can I close the baan session in php, when I run this some times shows, 'Maximum Number of user reached',

Does anybody know how to do that in php?

thanks

bizen99
13th March 2003, 16:08
Hi again,

in ASP the code to close session is:

Set sVenta = Nothing
Set Venta = Nothing
Set Error = Nothing

'Desconexion *****************************************************************
objVenta.terminateObject
objConexion.shutdown

Set objVenta = Nothing
Set objConexion = Nothing
'*****************************************************************************

what it is the code in php?

thanks