|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
Description: ------------ I want to make a call to a com function defined in IDL as follows: /* DISPID=37 */ /* VT_I4 [3] */ function Connect( /* VT_VARIANT [12] [in] */ $SecurityToken, /* VT_BSTR [8] [in] */ $Workstation, /* VT_BSTR [8] [in] */ $Context, /* VT_PTR [26] [out] --> VT_PTR [26] */ &$Connection ) { /* method Connect */ } As you can see the fourth parameter is defined as [OUT] only and should return another com object created by the server. If I create an empty object for parameter 4 before the call and then make the call the script executes and the com server does the work properly. However the returned [OUT] &$Connection variable is still pointing to my original (empty) object and has not been replaced by the newly created object. The generated IDL clearly shows that the parameter is to be passed by reference - but PHP does not update/replace the passed in parameter. I have tried forcibly passing the parameter by reference (&) but it makes no difference. I have checked the bug database and other people seem to have reported similar(ish) problems that are supposedly fixed. This code definitely does not function as I would expect in 5.2.5 though. Reproduce code: --------------- // create empty object for call... $connection = new COM("AccServer.SAConnection"); // make call with dummy $connection object - this object should be replaced during the call $failurecode =$server->Connect($p1,$p2,$p3,$connection); Expected result: ---------------- I expect the 4th parameter ($connection) VT_PTR [OUT] to be replaced by the one passed back by the com object. Actual result: -------------- Parameter 4 is unchanged after the call.