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
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:
41 - 27 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 19 10:01:28 2024 UTC