C# and vbscript

  • Thread starter Thread starter Jozsef Bekes
  • Start date Start date
J

Jozsef Bekes

Hello Everyone,

I am trying to access a C# class from vbscript. All is file, except for the
case when I want to use optional parameters or function overloading. As I
found out, optional parameters are not supported by C#, function overloading
is not supported by COM. There is an attribute:

[System.Runtime.InteropServices.OptionalAttribute]

that does not seem to work, I still have to fill the parameter in vbscript,
otherwise the following exception is thrown:

- $exception {System.Runtime.InteropServices.COMException}
System.Runtime.InteropServices.COMException
+ System.SystemException {"Type mismatch: 'getPC'"} System.SystemException
ErrorCode -2146828275 int

Is there anyone who was able to solve this problem?

Thank you & regards,
Jozsef
 
For reference, I got an answer for this question in the interopservices
newsgroup.

For using
[System.Runtime.InteropServices.OptionalAttribute]
the parameter type has to be object.
 
Back
Top