I'm using VS2010, I'm try to use a C# dll to get any enum member name in C++,
My C# dll source code:
namespace CSharpFuncion
{
public class CSFun
{
public string GetEnumName(Enum en)
{
return Enum.GetName(typeof(Enum), en);
}
}
}
My C++ code
#using "CSharpFuncion.dll"
using namespace CSharpFuncion;
CSFun ^ csFun = gcnew CSFun;
cout << csFun->GetEnumName(MyTestEnum::E_A) << endl;
Error message:
cannot convert parameter from 'MyTestEnum' to 'System::Enum ^'
How can I fix it?