Hello!
I have two projects. One is a standard vb.net windows application and the second is a DLL with one function that returns a simple string.
Public Class DLLClass
public function TestDLL () as string
return "Dude, I'm here"
end function
End Class
In my windows app, i late bind this DLL and invoke its method:
Dim assAssembly As Reflection.Assembly = Nothing
Dim typeClassType As Type = Nothing
Dim strReturn As String = ""
assAssembly = Reflection.Assembly.LoadFr
om(strAppl
icationPat
h & strDLLName)
typeClassType = assAssembly.GetType("DLLCl
ass.DLLCla
ss")
objClassInstance = Activator.CreateInstance(t
ypeClassTy
pe)
MessageBox.Show(objClassIn
stance.Tes
tDLL)
This works fine. But what if I want the DLL to access a method from the main application? Can someone please show me an example of how that is done? Again, keep in mind that the dll is late bound.
Thanks
Start Free Trial