By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

quick question on overloading methods

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.