All pastes #36677 Raw Edit

Someone

public text v1 · immutable
#36677 ·published 2006-01-13 11:35 UTC
rendered paste body
' ### LOADING IT
        Private a As [Assembly]
        a = [Assembly].LoadFrom("DP.ModuleHandler.TestModule.dll")

        Dim t As Type = a.GetType("DP.ModuleHandler.TestModule.ModuleTest.TestClass")
        Dim obj1 As Object
        obj1 = Activator.CreateInstance(t)
        obj1.GetType().InvokeMember("CallMeWithNoParams", BindingFlags.Default Or BindingFlags.InvokeMethod, Nothing, obj1, New Object)






' ### THE MODULE


'Namespace DP.ModuleHandler.TestModule
Namespace ModuleTest
    Public Class TestClass
        Implements MyInterface

        ' # THE INTERFACE
        Interface MyInterface
            Function Add(ByVal a As Integer, ByVal b As Integer) As Integer
        End Interface

        Public Function Add(ByVal a As Integer, ByVal b As Integer) As Integer Implements MyInterface.Add
            Return a + b
        End Function

        Public Sub CallMeWithNoParams()
            MsgBox("Successfully called TestClass.CallMeWithNoParams()")
        End Sub
    End Class
End Namespace