php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15655 Variant type & COM objects
Submitted: 2002-02-21 04:46 UTC Modified: 2002-03-11 12:59 UTC
From: bartek at vemco dot pl Assigned:
Status: Closed Package: COM related
PHP Version: 4.1.1 OS: WinNT SP6
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: bartek at vemco dot pl
New email:
PHP Version: OS:

 

 [2002-02-21 04:46 UTC] bartek at vemco dot pl
I have 2 COM objects and I want to pass 1 of them to another by reference.
Apache 1.3.23

<?
//first object is ADODB.recordset
$recordset= new COM("ADODB.Recordset") or die("recodset down");
//I want this object to be passed by reference so i declare Variant type

$rs=new Variant($recordset);

//below lines are unimportant because I got Internal Server ERROR here

$object2= new COM("object.object") or die ("object down");
$object2->ddw("sterfind",$rs);

?>
when I declare $rs = new Variant() or $rs= new Variant(VT_DISPATCH) then script works but object2 reports type mismatch

error_log raports: Premature end of script headers: c:/php/php.exe



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 12:59 UTC] phanto@php.net
you shouldn't have to encapsulate the $recordset instance into a VARIANT() object as this is done by the com layer implicitely. the VARIANT() class is only necessary if you want multiple indirections (e.g. you want to pass a pointer to the instance instead of the instance itself). so passing $recordset to $object2 should be enough.

harald

ps: if you still have troubles please also test it with the cgi version to check if it is apache related or a general com issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 16:01:29 2024 UTC