quick question on overloading methods

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • barb

    #1

    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


  • Tian Min Huang

    #2
    RE: quick question on overloading methods

    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/cpconexposingne tframeworkcompo nentstocom.asp? frame=true

    COM Interop Part 2: C# Server Tutorial
    http://msdn.microsoft.com/library/de...us/csref/html/
    vcwlkcominterop part2cservertut orial.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.


    Comment

    • barb

      #3
      Re: quick question on overloading methods

      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" <timhuang@onlin e.microsoft.com > wrote in message
      news:mOMU6XfbDH A.1628@cpmsftng xa06.phx.gbl...[color=blue]
      > 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
      >[/color]
      http://msdn.microsoft.com/library/de...us/cpguide/htm[color=blue]
      > l/cpconexposingne tframeworkcompo nentstocom.asp? frame=true
      >
      > COM Interop Part 2: C# Server Tutorial
      >[/color]
      http://msdn.microsoft.com/library/de...us/csref/html/[color=blue]
      > vcwlkcominterop part2cservertut orial.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[/color]
      rights.[color=blue]
      >
      >[/color]


      Comment

      • Tian Min Huang

        #4
        Re: quick question on overloading methods

        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.


        Comment

        Working...