php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10875 In COM Function: Return Var is emty
Submitted: 2001-05-15 07:04 UTC Modified: 2001-05-15 15:14 UTC
From: ws at olapline dot de Assigned:
Status: Closed Package: COM related
PHP Version: 4.0.5 OS: Win2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 18 = ?
Subscribe to this entry?

 
 [2001-05-15 07:04 UTC] ws at olapline dot de
here my problem with COM in PHP.


<?
echo "J-Server in der dynamischen PHP-Web-Site. <br><br>";

$jServer = new COM("jexeserver") or DIE ("Connect zum J Server ist nicht
m?glich");
$jServer->Show(1);
$jServer->Log(1);

$jServer->Do("0!:0 <(1!:40''),'system\extras\config\profile.ijs'");
$jServer->Do("load'd:\\j_tm1dll\\j\\tm1api.ijs'");
$jServer->Do("load'd:\\j_tm1dll\\j\\tm1con.ijs'");
$jServer->Do("load'd:\\j_tm1dll\\j\\tm1prop.ijs'");
$jServer->Do("load'd:\\j_tm1dll\\j\\tm1view.ijs'");

$jServer->Do("Tm1On''");
$jServer->Do("Tm1AdmSet'OLAPLINE01'");
$jServer->Do("SrvCon'zeiterf';'Admin';''");

#$jServer->Do("NN=:'XXX'");

$Var = "xxx";
$jServer->SetB("NN", $Var);      //  In the COM server: NN = $Var
$jServer->Do("NN");                  //  Display NN in the COM server
$jServer->Do("NN=:'yyy'");         //  In the COM server: NN = "yyy"

$jServer->GetB("NN", &$Var);    //  <===============   There is my problem:  (& is a refernce)
                                               //  In the COM server &$Var = NN
echo $Var;                               // echo $Var Output: xxx and not yyy ?!?

$jServer->Quit();

?>

Is there a bug in my code or is this a bug in COM ???


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-15 15:12 UTC] phanto@php.net
> $jServer->GetB("NN", &$Var);

pass by reference is deprecated. you have to pack your value into a VARIANT object and unpack it afterwards.


$vVar = new VARIANT($Var);
/* VARIANT($Var [, VT_BSTR [,CP_ACP]]) */
$jServer->GetB("NN", $vVar);

echo $vVar->value;
echo $vVar->type;
/* one of VT_BSTR, VTUI4, VT_BYREF|VT_*, .... */


btw, in 4.0.5 the com extension is not working properly, maybe you have to wait for 4.0.6 (or use the -dev version)
 [2001-05-15 15:14 UTC] phanto@php.net
closed.j
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 27 08:01:40 2019 UTC