Late Binding Solution for CF.NET

  • Thread starter Thread starter J.R. Brown
  • Start date Start date
J

J.R. Brown

Anyone know of a late binding solution for CF.NET, or any ideas how to
implement this? I already know that it is not natively supported in
the CF.NET.

Thanks a bunch for your comments.

J.R.
 
Maybe this will help...

I am trying to do something like this: I know you can't actually do
the following in CF.NET. I'm looking for a similar dynamic
alternative...

----------------------------------------------------------
Dim myObj As Object
Dim myAssem As System.Reflection.Assembly

myAssem = myAssem.LoadFrom(MyDLLFilePath) '<-- This works.
myObj = myAssem.CreateInstance("MyAssem.Class") '<-- This works.

Dim newMMP As Panel = myObj.Initialize '<-- at myObj.Initialize you
get the error which says that CF.NET does not support late binding.
-----------------------------------------------------------

Again, maybe there is no suitable alternative but its worth a try
investigating since this would give this application the greatest
flexibility.

Thanks Alex, I hope this clarifies.

J.R.
 
I see.
Although there is no late binding, you can use Reflection to invoke methods
dynamically. It's a bit more work, but you can wrap it into a set of
functions/methods and get by:

'Instead of this
'Dim newMMP As Panel = myObj.Initialize
'Do this
Dim newMMP As Panel =
CType(myObj.GetType().GetMethod("Initialize").Invoke(myObj, Nothing), Panel)
 
Back
Top