473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem on calling C# component method from asp page

Hi Everyone,

I created C# COM+ component. It has two overloaded methods - the method names are same and their signatures are different, one takes two parameters and another takes four. I coded this way: the method with 4 parameters is coded first and then the one with 2 parameters.

I created very simple ASP page to call these two methods. Calling the method with 4 params has no problem. However, calling the method with 2 params I get the error saying:

Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'SetReferenceValues'
/suitevoyager/testLmx.asp, line 16

How can I solve this problem?

Thanks in advance!!!
Cindy

Jul 19 '05 #1
3 2199

"Cindy Liu" <Cindy Li*@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hi Everyone,

I created C# COM+ component. It has two overloaded methods - the method names are same

Why?!
and their signatures are different, one takes two parameters and another takes four. I coded this way: the method with 4 parameters is coded first
and then the one with 2 parameters.
I created very simple ASP page to call these two methods. Calling the method with 4 params has no problem. However, calling the method with 2
params I get the error saying:
Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'SetReferenceValues'
/suitevoyager/testLmx.asp, line 16


What is the line of code on line 16? Have you created an instance of the
object at this point?

Ray at work
Jul 19 '05 #2
Yes, I did create an instance of my COM+ object. Line 16 is the line that I call the method with 2 params.

Why I need 2 methods with same name and different signature? Because these methods perform the same functionality, one need to pass in user name and password, the another uses the credential specified in the configuration file.

Do I answer your questions?
Cindy

"Ray at <%=sLocation%> [MVP]" wrote:

"Cindy Liu" <Cindy Li*@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hi Everyone,

I created C# COM+ component. It has two overloaded methods - the method

names are same

Why?!
and their signatures are different, one takes two parameters and another

takes four. I coded this way: the method with 4 parameters is coded first
and then the one with 2 parameters.

I created very simple ASP page to call these two methods. Calling the

method with 4 params has no problem. However, calling the method with 2
params I get the error saying:

Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'SetReferenceValues'
/suitevoyager/testLmx.asp, line 16


What is the line of code on line 16? Have you created an instance of the
object at this point?

Ray at work

Jul 19 '05 #3
VBScript does not support optional parameters. I think that would preclude
the possibility of any support for overloaded functions as well.

You might give jscript a try. If that doesn't work you will have to just use
the 4-parameter version each time or modify the object so that the functions
are no longer overloaded.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Cindy Liu" <Ci******@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
Yes, I did create an instance of my COM+ object. Line 16 is the line that I call the method with 2 params.
Why I need 2 methods with same name and different signature? Because these methods perform the same functionality, one need to pass in user name and
password, the another uses the credential specified in the configuration
file.
Do I answer your questions?
Cindy

"Ray at <%=sLocation%> [MVP]" wrote:

"Cindy Liu" <Cindy Li*@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hi Everyone,

I created C# COM+ component. It has two overloaded methods - the
method names are same

Why?!
and their signatures are different, one takes two parameters and
another takes four. I coded this way: the method with 4 parameters is coded first and then the one with 2 parameters.

I created very simple ASP page to call these two methods. Calling the

method with 4 params has no problem. However, calling the method with 2
params I get the error saying:

Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'SetReferenceValues'
/suitevoyager/testLmx.asp, line 16


What is the line of code on line 16? Have you created an instance of the object at this point?

Ray at work

Jul 19 '05 #4

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

Similar topics

2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
11
by: Ben | last post by:
Hi, I'm just moving to VB.NET and I'm trying to load a recordset intoan XMLReader and loop through the records. When I use the.ReadElementString() method to get the next 'record' if it hasreached...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
12
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to...
3
by: guy | last post by:
I have a problem with a class hierarchy. The inheriting and inherited class are in different solutions. In the base class, (which inherits from System.Windows.Forms.UserControl) i have a method...
10
by: Bryce Calhoun | last post by:
Hello, First of all, this is a .NET 1.1 component I'm creating. SUMMARY ----------------------- This component that I'm creating is, for all intents and purposes, a document parser (I'm...
23
by: Peter | last post by:
I have a problem with a page show_image.asp that returns a jpg image under Windows XP Pro SP2. The page sets content type as: Response.ContentType = "image/jpg" While this works perfectly fine...
0
by: shahiz | last post by:
This the error i get when i try to run my program Error: Unable to realize com.sun.media.amovie.AMController@18b81e3 Basically i have a mediapanel class that initialize and play the media as...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.