View Full Version : Setting the value of COM object's Attribute property?

04-26-2004, 05:50 PM

Any one who has experiences in setting the value of COM object's Attribute property
please help...

The COM runs well in ASP:


'The Attribute property specifies and retrieves name-value pairs.
'Header.Attribute(bstrName) = String
'String = Header.Attribute(bstrName)
'Parameters: bstrName [in] ,String containing the attribute name.
'Attribute names are case-sensitive, and both the name and value must be specified in a valid 'XML format. If you duplicate an existing attribute, the earlier attribute is updated.

Dim rid
rid = "0"
Set headobj = Server.CreateObject("Wmrmobjs.WMRMHeader")
headObj.Attribute("RID") = rid


But when I convert it to PHP:

$headObj = new COM("Wmrmobjs.WMRMHeader");
$headObj->Attribute["RID"] = $rid;

There's a Error:

Fatal error: Uncaught exception 'com_exception' with message 'Error Invalid
number of arguments' in D:\server\abc.php:3 Stack trace: #0 {main} thrown in D:\server\abc.php on line 3

I am using PHP 5 RC2.