VS2008 C# 错误“.ctor”不支持语言
C# 代码:
class Program
{
static void Main(string[] args)
{
TFWrapper tf;
String lexDir = ".......";
String lic = "........";
String key = ".........";
ArrayList cats = new ArrayList();
Boolean useConj = false;
String lang = "english";
String encoding = "auto";
tf = new TFWrapper(lexDir, lic, key, cats, useConj, lang, encoding);
}
}
正在调用托管 C++ 方法:
TFWrapper::TFWrapper(String^ mlexDir, String^ mlic, String^ mkey, ArrayList catList, Boolean^ m_useConj, String^ m_lang, String^ m_encoding);
C# 最后一行的语言错误不支持获取“.ctor”
C# code:
class Program
{
static void Main(string[] args)
{
TFWrapper tf;
String lexDir = ".......";
String lic = "........";
String key = ".........";
ArrayList cats = new ArrayList();
Boolean useConj = false;
String lang = "english";
String encoding = "auto";
tf = new TFWrapper(lexDir, lic, key, cats, useConj, lang, encoding);
}
}
Managed C++ method being called:
TFWrapper::TFWrapper(String^ mlexDir, String^ mlic, String^ mkey, ArrayList catList, Boolean^ m_useConj, String^ m_lang, String^ m_encoding);
Getting '.ctor' is not supported by the language error on the last line of C#
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是一种预感,但我认为你需要更改
为
因为 Boolean 是值类型而 ArrayList 是引用类型。
Just a hunch, but I think you need to change
to
Because Boolean is a value type and ArrayList a reference type.
尝试在 C# 中调用此函数:
另外,在 C++ 声明中,
ArrayList catList
不应该是ArrayList^ catlist
吗?Try calling this in your C#:
Also, in your C++ declaration, shouldn't
ArrayList catList
beArrayList^ catlist
?