S
sippyuconn
Hi
Using Reflection to get an Enumeration value that I pass to another DLL
The dll has a check of incoming Enum paramater is of specific type
The checl always fails because it thinks the Enum if of Type FieldInfo
Is there a way to cast to Original type ???
Thanks
//Reflection to get Enum and pass to Dll Method
Type enumType = GenericDLL.GetType("MyTest.InputFields");
System.Reflection.FieldInfo enumItem = enumType.GetField("Enum1");
Method1(enumItem );
//Dll method
Method1(object o1)
{
//This method always fails - gets type FieldInfo
if (o1 .GetType() == typeof(InputFields))
MessageBox.Show("OK");
}
Using Reflection to get an Enumeration value that I pass to another DLL
The dll has a check of incoming Enum paramater is of specific type
The checl always fails because it thinks the Enum if of Type FieldInfo
Is there a way to cast to Original type ???
Thanks
//Reflection to get Enum and pass to Dll Method
Type enumType = GenericDLL.GetType("MyTest.InputFields");
System.Reflection.FieldInfo enumItem = enumType.GetField("Enum1");
Method1(enumItem );
//Dll method
Method1(object o1)
{
//This method always fails - gets type FieldInfo
if (o1 .GetType() == typeof(InputFields))
MessageBox.Show("OK");
}