在通过串口接收数据的后台工作人员工作期间,我需要返回字符串的四维数组。
在后台工作人员中:
array<String^>^ Received = gcnew array<String^>(4);
backgroundWorker1->ReportProgress(10,Received);
报告进度:
private: System::Void backgroundWorker1_ProgressChanged(System::Object^ sender, System::ComponentModel::ProgressChangedEventArgs^ e)
{
array<String^>^ Received2 = gcnew array<String^>(4);
Received2 =(e->UserState);
}
我正进入(状态:
错误 C2440:“=”:无法从“System::Object ^”转换为“cli::array”
这并不奇怪,但是如何转换和分配UserState
到string array
?