Is there a way for the code below to work
as a smart device application?
It would seem that I have no access to the
GetTypeFromProgID() method.
Dim oType As Type
oType = Type.GetTypeFromProgID("Person.Bean.1")
If IsNothing(oType) Then
TextBox1.Text = "Type not found"
Exit Sub
End If
Dim oObj As Object
oObj = Activator.CreateInstance(oType)
If IsNothing(oObj) Then
TextBox1.Text = "Unable to instantiate object"
Exit Sub
End If
Dim oArgs(0) As Object
oArgs(0) = "Kenneth"
oType.InvokeMember("setFirstName",
Reflection.BindingFlags.InvokeMethod, Nothing, oObj, oArgs)
oArgs(0) = "Baylosis"
oType.InvokeMember("setFirstName",
Reflection.BindingFlags.InvokeMethod, Nothing, oObj, oArgs)
TextBox1.Text = oType.InvokeMember("getName",
Reflection.BindingFlags.InvokeMethod, Nothing, oObj,
Nothing)
oObj = Nothing
oType = Nothing