Kane Jeeves
Active member
- Joined
- May 17, 2006
- Messages
- 44
- Programming Experience
- 5-10
I have a simple structure, say
Structure layout
Dim X as String
Dim Y as Integer
End Structure
I want to use Reflection to get the datatype of the fields. I know I can do something like below to get the field, but I can't seem to get the datatype of the field.
Dim valObj As System.Reflection.FieldInfo
valObj = GetType(layout).GetField("X")
I thought using GetTypeCode on valObj would work but it just returns System.Object, not System.String (or Int32) as I'd expect.
Any help is appreciated!
- Kane
Structure layout
Dim X as String
Dim Y as Integer
End Structure
I want to use Reflection to get the datatype of the fields. I know I can do something like below to get the field, but I can't seem to get the datatype of the field.
Dim valObj As System.Reflection.FieldInfo
valObj = GetType(layout).GetField("X")
I thought using GetTypeCode on valObj would work but it just returns System.Object, not System.String (or Int32) as I'd expect.
Any help is appreciated!
- Kane