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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ws at olapline dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jan 14 11:01:28 2025 UTC