C
Christian Schwarz
Hello,
I try to call an object's member function by Type.InvokeMember() function.
It works perfectly under .NET Framework but throws an NotSupportedException
under the .NET Compact Framework. Please take a look at the following code
snippet:
public class TestClass1
{
private string m_Name;
public TestClass1(string name)
{
this.m_Name = name;
}
public string GetName()
{
return this.m_Name;
}
}
TestClass1 tc1 = new TestClass1("Meyer");
string name = (string)typeof(TestClass1).InvokeMember("GetName",
BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance,
null, tc1, new object[0]);
Is the BindingFlags.InvokeMethod not supported under .NET CF ? If so, what
else could I do to call a member function dynamically and what other
limitations exist under .NET CF regarding the Type.InvokeMember() function ?
Regards, Christian
I try to call an object's member function by Type.InvokeMember() function.
It works perfectly under .NET Framework but throws an NotSupportedException
under the .NET Compact Framework. Please take a look at the following code
snippet:
public class TestClass1
{
private string m_Name;
public TestClass1(string name)
{
this.m_Name = name;
}
public string GetName()
{
return this.m_Name;
}
}
TestClass1 tc1 = new TestClass1("Meyer");
string name = (string)typeof(TestClass1).InvokeMember("GetName",
BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance,
null, tc1, new object[0]);
Is the BindingFlags.InvokeMethod not supported under .NET CF ? If so, what
else could I do to call a member function dynamically and what other
limitations exist under .NET CF regarding the Type.InvokeMember() function ?
Regards, Christian