473,408 Members | 1,822 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,408 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 2905
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
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...

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.