From:             tp at synolon dot gr
Operating system: Windows XP Pro
PHP version:      5.1.3
PHP Bug Type:     COM related
Bug description:  Array style COM property access

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

-- 
Edit bug report at http://bugs.php.net/?id=37274&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37274&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=37274&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37274&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37274&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37274&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37274&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37274&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37274&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37274&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37274&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37274&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37274&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37274&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37274&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37274&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37274&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37274&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37274&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37274&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37274&r=mysqlcfg

Reply via email to