473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# and vbscript

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
Nov 17 '05 #1
2 3675
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.

"Jozsef Bekes" <bj****@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #2
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.

"Jozsef Bekes" <bj****@hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6811
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
29
5985
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
20
5943
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
16
9312
by: Mike Schinkel | last post by:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using VBScript Version 5.6.8515 on Win2003Server w/ASP. Sometimes it returns an object that VarType() says is a vbObject. Other...
5
5180
by: gpence | last post by:
!!! Newbie question warning !!! I am somewhat familiar with javascript's ability to "access" the browser's favorites list -- for example, using window.home() will take you to the default URL --...
4
12653
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
2
2839
by: Frank | last post by:
Can I do this? I add a session var in C# and ultimatly want to pass it into a vbscript client side activeX control. This is what I have so far but get " Object Required:'name2' " error. Can...
7
13423
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
10
4680
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
6
1937
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.