I defined the function in C# DLL as follows,
public class Class1
{
public static dynamic CS_Func()
{
dynamic obj = new ExpandoObject();
obj.num = 99;
return obj;
}
}
In another C# EXE, it could be called like this:
public void CS_Caller()
{
dynamic obj = Class1.CS_Func();
int num = obj.num; // OK
}
But if using C++/CLI, how should I call the CS_Func()?
void CPP_Caller()
{
ExpandoObject ^obj = (ExpandoObject ^)Class1::CS_Func();
//int num = obj->num; // ERROR
}