I added 3 optional boolean parameters to a method found within a VB6 DLL. The class that houses it is MultiUse (public), and the method itself is Private. The class implements a specific interface from a TLB, allowing for public calls to this method.
After adding the 3 optional parameters on the VB6 side, I modified related C# code so that it specified the 3 optional parameters. It built fine... however, when I try to run that code, it fails with the following error message:
Method not found: 'Boolean MyTLBName.IMyClassName.MyMethod(System.Object, System.String, Boolean, Boolean, Int32, Int32 ByRef, System.Object, System.Object, System.Object, Boolean, Boolean, Boolean)'.
Notice how all 3 boolean parameters are shown in the error message? Looks fine to me... I know I specified those 3 booleans when calling the method from C#.
Suspicious, I checked out the MyTLBName.IMyClassName interface in OLEView, and saw this:
[id(0x60030000)]
HRESULT MyMethod(
//Cut out the other parameters - they are working fine.
[in, optional, defaultvalue(-1)] VARIANT_BOOL blnMyFirstOptionalBoolean,
[in, optional, defaultvalue(-1)] VARIANT_BOOL blnMySecondOptionalBoolean,
[in, optional, defaultvalue(-1)] VARIANT_BOOL blnMyThirdOptionalBoolean,
[out, retval] VARIANT_BOOL* __MIDL_0324);
Again, the 3 optional parameters are visible, and look fine.
Seems to me like it should work... but maybe I'm missing something.
Is there any way I can get this working without having to create another version of "MyMethod" in the TLB? (With a different name, and those 3 parameters as required rather than optional)