Inherit, hooking into existing 3rd party DLL class

Discussion in 'ASP .Net' started by Mike, Apr 25, 2009.

  1. Mike

    Mike Guest

    Folks, still relatively new to ASP.NET. I need to know if this is
    possible.

    I have a project where I have to to integrate a 3rd party ASP.NET web
    server product with our backend web server. I was provided with the
    3rd party ASP.NET VB source code code and I have worked out the
    necessary integrate logic and requires changes to their code which
    creates DLLs.

    Now I have been cleaning up and reducing the source code changes and
    use possibly class inheritance to accomplish the task.

    In short, the 3rd party code has one VENDOR.DLL with the following
    outline:

    Option Strict On
    Option Explicit On

    Imports System
    Imports System.Collections
    Imports System.Web
    Imports System.Web.Security
    Imports Vendor.Common

    Namespace Vendor.Common.Authentication
    Public Class Login

    Public Shared Function UserExist(ByVal s As String) As Int32
    ' some code
    End Function

    Public Shared Sub Login(ByVal User As Vendor.Common.Components.User,

    ByVal Persist As Boolean)
    ' some code
    End Function
    ....
    ....
    other public and private functions
    End Class
    End NameSpace

    In the project, I had to modify the Login() function by adding some
    extra code.

    My question is there a method where I can overlay this DLL class with
    my own class, with the one Login function override which then call
    back the parent Login function? Something like so in my own helper
    MyApplet.DLL library:

    Namespace Vendor.Common.Authentication
    Public Class Login
    Inherits Vendor.Common.Authentication
    Overrides Public Shared Sub Login(ByVal s As _
    Vendor.Common.Components.User,

    ByVal p As Boolean)
    ' some code
    vendor.common.authentication.authentication.login(s,p)
    End Function
    End Class
    End NameSpace

    I know the above code is invalid. But I think OOPs people know what I
    am trying to accomplish.

    Again, the goal here is to not require source code change. But if
    required, then that is possible. Unfortunately, the vendor did not
    make the code very flexible. What I want do to is just provide a
    helper MyApplet.DLL that if all possible hook or replace this one
    class in the vendor library.

    Possible?

    Thanks
     
    Mike, Apr 25, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VUtQb3N0aWU=?=

    COM Interop problem with 3rd Party DLL using C# under ASP.NET

    =?Utf-8?B?VUtQb3N0aWU=?=, Sep 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    835
    =?Utf-8?B?VUtQb3N0aWU=?=
    Sep 23, 2004
  2. =?Utf-8?B?c3RyYXp6?=
    Replies:
    0
    Views:
    529
    =?Utf-8?B?c3RyYXp6?=
    Jan 27, 2006
  3. dw
    Replies:
    5
    Views:
    224
  4. Replies:
    0
    Views:
    216
  5. jonnytheclown

    Correct way to inherit from 3rd party class

    jonnytheclown, Feb 21, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    152
    Peter Scott
    Feb 22, 2005
Loading...

Share This Page