473,323 Members | 1,574 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,323 software developers and data experts.

quick question on overloading methods

I'm developing an assembly that will be used from ASP (not ASP.NET). Can I
overload methods? My initial tests suggest that I can't.

Thanks,
Barb
Jul 19 '05 #1
3 2903
Hello Barb,

Thanks for your post. I am not quite sure what exactly you want to do.
According to my understanding, do you want to know how to access .NET
component from ASP? If so, you will need COM Interop to access .NET
component from unmanaged client. I believe the following MSDN articles are
helpful:

Exposing .NET Framework Components to COM
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconexposingnetframeworkcomponentstocom.asp?frame =true

COM Interop Part 2: C# Server Tutorial
http://msdn.microsoft.com/library/de...us/csref/html/
vcwlkcominteroppart2cservertutorial.asp

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Jul 19 '05 #2
Thanks. Here's a little more information:

I am writing a .NET component that is to be used from ASP. It seems to be
working fine in general, using the regasm utility to create a type library
and putting the assemby in the GAC. The only problems I'm having is when I
call a public method that has an overload -- then, when tested from ASP, I
get the error "Invalid Procedure Call or Argument". If I remove the
overload, it works fine from ASP. I wasn't certain whether ASP can deal
with overloaded methods or not, but my first test indicates that maybe it
can't?

Thanks,
Barb

"Tian Min Huang" <ti******@online.microsoft.com> wrote in message
news:mO**************@cpmsftngxa06.phx.gbl...
Hello Barb,

Thanks for your post. I am not quite sure what exactly you want to do.
According to my understanding, do you want to know how to access .NET
component from ASP? If so, you will need COM Interop to access .NET
component from unmanaged client. I believe the following MSDN articles are
helpful:

Exposing .NET Framework Components to COM
http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconexposingnetframeworkcomponentstocom.asp?frame =true

COM Interop Part 2: C# Server Tutorial
http://msdn.microsoft.com/library/de...us/csref/html/ vcwlkcominteroppart2cservertutorial.asp

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Jul 19 '05 #3
Hello Barb,

Thanks for your update. I now share the following information with you:

Based on my experience and research, the TlbExp.exe may desingate a unique
name for each overloaded method. For example, I declare the following
interface in C#:

public interface IMyInterface
{
int Method(string strVal);
int Method(int iVal);
}

If I use OLE View to view the .TLB file generated by TlbExp.exe, the
Method(int) will be changed to Method_2.
interface IMyInterface: IDispatch {
[id(0x60020000)]
HRESULT Method(
[in] BSTR strVal,
[out, retval] long* pRetVal);
[id(0x60020001),
custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9, Method)]
HRESULT Method_2(
[in] long iVal,
[out, retval] long* pRetVal);
};

So I recommend you use OLE View to check the new name for the overloaded
methods and the call them from ASP page.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Jul 19 '05 #4

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

Similar topics

17
by: Terje Slettebø | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP...
7
by: Doran_Dermot | last post by:
Hi All, I've seen lots of code in which the attributes of a class are accessed and modified using two separate methods. For example: class Problems: def __init__( self, refNum ):...
4
by: Dave Theese | last post by:
Hello all, I'm trying to get a grasp of the difference between specializing a function template and overloading it. The example below has a primary template, a specialization and an overload. ...
31
by: | last post by:
Hi, Why can I not overload on just the return type? Say for example. public int blah(int x) { }
3
by: barb | last post by:
I'm developing an assembly that will be used from ASP (not ASP.NET). Can I overload methods? My initial tests suggest that I can't. Thanks, Barb
4
by: Doug | last post by:
Hi I am 'returning' to the learning of C# after a change in jobs and I remember that I used to struggle with the defintion, purpose and function of 'overloading'. When I was beginning with C# I...
0
by: r035198x | last post by:
Overriding therefore allows you to use the same method name to refer to differently implemented methods. Here is an example using the famous shapes example. class Shape { public Shape()...
2
by: Colonel | last post by:
It seems that the problems have something to do with the overloading of istream operator ">>", but I just can't find the exact problem. // the declaration friend std::istream &...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.