C# and vbscript

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
 
J

Jozsef Bekes

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top