我有一个用 C++ 编写的 .NET 类库。“public ref class MyClass”定义了一个方法“MyMethod”,它采用两个 System::Int32 参数。
这是 MyClass 首先是我的问题:
namespace MyNetAssembly {
public ref class MyClassThatDoesStuff
{
public:
MyClassThatDoesStuff();
void MyMethod(System::Int32^ number1, System::Int32^ number2);
property System::Int32 MyProperty{
int get (){
return *_result;
}
void set(System::Int32 value){
}
}
private:
int^ _result;
};
}
这是cpp代码:
MyNetAssembly::MyClassThatDoesStuff::MyClassThatDoesStuff()
{
*_result = 0;
}
void MyNetAssembly::MyClassThatDoesStuff::MyMethod(System::Int32^ number1, System::Int32^ number2)
{
*_result =(*number1 + *number2) * 100;
}
当我使用“构造器节点”从 LabView 8.5 加载这个程序集时 vi。然后,我尝试使用“调用方法”vi 调用 MyMethod(),我将方法的参数设为“ValuteType”而不是“Int32”,因为我希望直接与 LabView 常量和控件一起使用。相反,当我通过右键单击参数的连接器创建常量时,我得到“.NET 对象”!
请问,如何让 LabView 识别参数类型?
注意:我尝试将参数从更改System::Int32^ number1
为System::Int32 number1
. 那也没有帮助。