|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-02 09:59 UTC] tp at synolon dot gr
Description: ------------ This seems to be related with bug #28161 that, as I read, was fixed since version 5.0. I want to access an array style COM property that is actually an object and then get or set a property of that object. I get a COM exception when I do that followed by apache crash. I have tried all binary PHP distributions for Windows that I found from 5.1.2 to 5.1.3 (cvs also) and did not work. My PHP setup is the typical one described in 'install.txt' of the PHP package. The only change that I have made in php.ini (except of the doc_root) is 'com.allow_dcom = true'. I use Apache 1.3.27. Please help! Reproduce code: --------------- public function setField( $fieldname , $fieldvalue , $masterobj = true ) { // kbm & kbmDetail are class member variables // that were previously instanciated like this: // $this->kbm = new COM( "SasClient.kbm" ); // The kbm object has an array style property // 'Field' that returns an object. We want to // set the 'Value' property. // In VB this code looks like this: // kbm.Field( fieldname ).Value = fieldvalue try { if( $masterobj ) $this->kbm->Field[ $fieldname ]->Value = $fieldvalue; else $this->kbmDetail->Field[ fieldname ]->Value = $fieldvalue; } catch( com_exception $e ) { print( $e->__toString( ) ); } } Expected result: ---------------- The property should be set Actual result: -------------- exception 'com_exception' with message 'Error [0x8002000e] Invalid number of parameters. ' in c:\data\www\senapi\CSen.php:259 Stack trace: #0 c:\data\www\senapi\CSen.php(259): CSen::setField() #1 c:\data\www\senapi\sentest.php(206): CSen->setField('docid', -1001) #2 {main}docid = -1001 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
Still the same error using latest CVS snapshot (PHP 5.2.1RC3-dev (cli) (built: Jan 5 2007 16:24:22)) PHP Fatal error: Uncaught exception 'com_exception' with message 'Error [0x8002000e] Invalid number of parameters.' in C:\PHP Files\comobjecttest.php:4 Stack trace: #0 C:\PHP Files\comobjecttest.php(4): unknown() #1 {main} thrown in C:\PHP Files\comobjecttest.php on line 4On current snap of PHP 5.2.2 It still doesn't work, but I get a slightly diff trace than some are reporting. Here's mine: PHP Fatal error: Uncaught exception 'com_exception' with message 'Error [0x8002000f] Parameter not optional. ' in C:\New Folder\prime-sync-itemdb.php:197 Stack trace: #0 C:\New Folder\prime-sync-itemdb.php(197): unknown() #1 {main} thrown in C:\New Folder (3)\prime-sync-itemdb.php on line 197 That is on this test line: $oInfo->CustomField[1] = "bb"; Com property is string CustomField(ByVal Index As Integer) VB.NET Code that works: oCompanyInfo.CustomField(1) = "bb" Note: in php: echo $oInfo->CustomField[1]; works fine. I just can't assign anything with an array