summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_com.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-04-28 08:23:22 (GMT)
committerWez Furlong <wez@php.net>2004-04-28 08:23:22 (GMT)
commit027d45016653db83d1d61a94cba885b3d5e08304 (patch)
treeef6a6fabfc9a0391855ce751e1f85ef1943a0fea /ext/com_dotnet/com_com.c
parentb97ecc182092e2f6893a69e8a5c621532394ca2c (diff)
downloadphp-027d45016653db83d1d61a94cba885b3d5e08304.tar.gz
Fix for Bug #28161 (and probably others that I can't find in the bug db;
the search interface sucks). Expand the proxy object so it can handle psuedo array style properties. ASP/VB code like this: headObj.Attribute("RID") = rid can be expressed like this in PHP: $headObj->Attribute['RID'] = $rid; In theory, this feature can be used for "multi dimensional" properties: headObj.Attribute("RID", "Foo") = rid; like this: $headObj->Attribute['RID']['Foo'] = $rid;
Diffstat (limited to 'ext/com_dotnet/com_com.c')
-rw-r--r--ext/com_dotnet/com_com.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index cfce3b9..09b2bea 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -333,6 +333,17 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
spprintf(&msg, 0, "Parameter %d: %s", arg_err, desc);
LocalFree(desc);
break;
+
+ case DISP_E_BADPARAMCOUNT:
+ if ((disp_params->cArgs + disp_params->cNamedArgs == 0) && (flags == DISPATCH_PROPERTYGET)) {
+ /* if getting a property and they are missing all parameters,
+ * we want to create a proxy object for them; so lets not create an
+ * exception here */
+ msg = NULL;
+ break;
+ }
+ /* else fall through */
+
default:
desc = php_win_err(hr);
spprintf(&msg, 0, "Error %s", desc);
@@ -557,6 +568,10 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
efree(vargs);
}
+ /* a bit strange this, but... */
+ if (hr == DISP_E_BADPARAMCOUNT)
+ return hr;
+
return SUCCEEDED(hr) ? SUCCESS : FAILURE;
}