From 97a7b4c84be6e7f716157bef9b9ef75fb048ea82 Mon Sep 17 00:00:00 2001 From: Dennis Korpel Date: Fri, 28 Jun 2024 12:20:46 +0200 Subject: [PATCH] com.d: Fix named arguments count --- com.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.d b/com.d index 1b3d05b..70bd4f2 100644 --- a/com.d +++ b/com.d @@ -404,7 +404,7 @@ struct ComProperty { /// /// So to call: `Com.f(10, 20, A: 30, B: 40)`, invoke this function as follows: /// --- - /// Com.f().callWithNamedArgs!(["A", "B"])(10, 20, 30, 40); + /// Com.f().callWithNamedArgs(["A", "B"], 10, 20, 30, 40); /// --- /// Argument names are case-insensitive ComResult callWithNamedArgs(Args...)(string[] argNames, Args args) { @@ -433,11 +433,11 @@ struct ComProperty { } DISPID[Args.length + 1] dispIds; innerComObject_.GetIDsOfNames( - &GUID_NULL, namesW.ptr, namesW.length, LOCALE_SYSTEM_DEFAULT, dispIds.ptr + &GUID_NULL, namesW.ptr, cast(uint) (1 + argNames.length), LOCALE_SYSTEM_DEFAULT, dispIds.ptr ).ComCheck("Unknown parameter name"); // Strip Member name at index 0 - disp_params.cNamedArgs = dispIds.length - 1; + disp_params.cNamedArgs = cast(uint) argNames.length; disp_params.rgdispidNamedArgs = &dispIds[1]; } }