Although it is technically possible, by using the vararg
keyword in the IDL in combination with an argument specified as SAFEARRAY(VARIANT)
, there is no support for specifying such a method in an MFC ActiveX project. You can do it with ATL instead, but I think this would be an enormous inconvenience just to get the functionality you describe.
Some better choices (in my opinion) would be:
- Provide specific methods for each of the use cases of your wrapped function.
- Provide a single method that exposes all arguments and add a UINT to set flags depending on which arguments should be used.
My choice would be 1.