Exposing [vararg] COM method -
11-14-2005
, 03:35 AM
Hello,
I would like to expose an analogue of the WScript.Echo method to scripts
hosted in my .NET application. According to MSDN, the method should accept a
variable number of arguments:
Echo [Arg1] [,Arg2] [,Arg3] ...
Unfortunately I had no success so far with declaring this in C#. Aurigma's
COM to .NET says that it should go like this:
void Echo ([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
VarEnum.VT_VARIANT)] object[] pArgs);
However, it does not work. I guess I have to somehow declare that the method
is 'vararg'. Any ideas?
Thanks,
LP |