Can you write this code in a VB .Net application?
Or is this code only understood by the VB .Net compiler?
Public Sub LateCall( _
ByVal Instance As Object, _
ByVal MethodName As String, _
ByVal Arguments() As Object, _
ByVal ArgumentNames() As String, _
ByVal CopyBack() As Boolean)
Dim T As Type = Instance.GetType
Dim Members As Reflection.MemberInfo() = T.GetMember(MethodName)
Dim Result As Reflection.MemberInfo = _
PerformMemberResolution(Members, Arguments, ArgumentNames)
Select Case Result.MemberType
Case MemberTypes.Method
Dim MethodResult As MethodInfo = DirectCast(Result,
MethodInfo)
MethodResult.Invoke(Instance, Arguments)
For Each P As ParameterInfo In MethodResult.GetParameters
If P.ParameterType.IsByRef Then
CopyBack(index_of_P) = True
End If
Next
Case ...
End Select
End Sub
from: "Anatomy of a Late Bound Expression"
by: Cameron Beccario
http://blogs.msdn.com/cambecc/archive/2004/06/01/145309.aspx
Mattias Sj?gren - 17 Jul 2004 14:42 GMT
>Can you write this code in a VB .Net application?
Yes, did you try it?
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Coder - 18 Jul 2004 16:28 GMT
Thanks
> >Can you write this code in a VB .Net application?
>
[quoted text clipped - 6 lines]
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.