这里的问题。
我得到了一个带有 VB.NET 函数的库,它应该打印通过 System.Reflection:MethodBase 方法解析的方法的名称。
Public Shared Function WriteName(ByRef executingMethod As MethodBase)
Return ....
End Function
我从 C++ 导入了我的库 (xxx) 并调用了方法“WriteName”:
xxx::WriteName(Reflection::MethodBase::GetCurrentMethod());
但是他没有找到匹配的库函数。 相反,如果我让这个 boring 两步过程,我一点问题都没有。
System::Reflection::MethodBase ^ name = Reflection::MethodBase::GetCurrentMethod();
xxx::WriteName(name);
有人知道我为什么会有这种行为吗?