Dim Customer As Object
Dim dmsobj As New DmsObjects.Functions
Customer = dmsobj.LoadMeByName("DMSCustomer.dll", "DMSCustomer.Customer", Nothing) <--- this is a wrapper round some reflection code to load up the object
Customer.Customer = dms.data("ActivityLog", 5, RowNo)
customer.displaycustomer
This code works.
However, I want to do :
Dim Customer As Object Dim dmsobj As New DmsObjects.FunctionsCustomer = dmsobj.LoadMeByName("DMSCustomer.dll", "DMSCustomer.Customer",
Nothing)Customer.Customer = dms.data("ActivityLog", 5, RowNo)
Dim t As New Threading.Thread(AddressOf Customer.DisplayCustomer)t.Start()
This doesn't compile, due to latebinding, it complains that "Customer.DisplayCustomer" is not a valid method.
How can I acheive this??
Many thanks in advance.
Simon
"Simon Verona" <ne...@aphroditeuk.com> wrote in message news:uQg7Ymou...@TK2MSFTNGP09.phx.gbl...
"CJ Taylor" <nos...@blowgoats.com> wrote in message news:vsure6t...@corp.supernews.com...
For example (there are many other ways to use 'CreateInstance'):
\\\
Private Function CreateClassByName( _
ByVal PartialAssemblyName As String, _
ByVal QualifiedClassName As String _
) As Object
Return _
Activator.CreateInstance( _
[Assembly].LoadWithPartialName( _
PartialAssemblyName _
).GetType(QualifiedClassName) _
)
End Function
///
Usage:
\\\
Dim c As Control = _
DirectCast( _
CreateClassByName( _
"System.Windows.Forms", _
"System.Windows.Forms.Button" _
), _
Control _
)
With c
.Location = New Point(10, 10)
.Size = New Size(80, 26)
.Text = "Hello World"
End With
Me.Controls.Add(c)
///
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Simon Verona" <ne...@aphroditeuk.com> wrote in message news:ux15Y0xu...@tk2msftngp13.phx.gbl...
"Simon Verona" <ne...@aphroditeuk.com> wrote in message news:ux15Y0xu...@tk2msftngp13.phx.gbl...