ID: 7116
Updated by: phanto
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: COM related
Assigned To: 
Comments:

this is fixed in cvs now.

short example:
--------------------

$foo = new COM("object");
$bar = new VARIANT(); // or VARINAT($var);
                      // or VARINAT("blah", "VT_BSTR");

$foo->function($bar);

echo $bar->value;

Previous Comments:
---------------------------------------------------------------------------

[2001-01-29 17:08:13] [EMAIL PROTECTED]
this is fixed in cvs now.

short example:
--------------------

$foo = new COM("object");
$bar = new VARIANT(); // or VARINAT($var);
                      // or VARINAT("blah", "VT_BSTR");

$foo->function($bar);

echo $bar->value;

---------------------------------------------------------------------------

[2000-10-10 07:20:16] [EMAIL PROTECTED]
A function exists in my Visual Basic 6 DLL.

This function supports ByRef (by reference) parameters.  This enables me to modify the 
parameters that are coming in.

When I try to do a standard call on my function from PHP, the function works but my 
variables do not come back modified like they should do.

Therefore, I tried calling the function from PHP by prefixing the parameter argument 
with a "&".  This worked fine, bringing back my modified parameters.  However, I got 
warnings from the PHP compiler to the effect of...

***************************************************
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; 
If you would like to pass it by reference, modify the declaration of [runtime function 
name](). If you would like to enable call-time pass-by-reference, you can set 
allow_call_time_pass_reference to true in your INI file. However, future versions may 
not support this any longer. 
***************************************************

The warning stated that my argument had been passed "By Value", even though it worked.

To summarize...

a) I cannot pass an argument By Reference to a VB DLL and make it work unless I prefix 
the argument with an "&" in the PHP call.

b) The warning states that the message was passed By Value, when in fact it WAS passed 
By Reference because my function changed the value of the variable.

It seems that you either need to keep the call-time "By Refence" passing in operation, 
or correct the "By Reference" passing when the COM object has declared the argument of 
the function to be "ByRef".

If you have any further questions, please contact me.

---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=7116


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to