Hi all
I need to return four dimensional array of strings during the work of background worker which is receiving data via serial port.

In background worker:

 array<String^>^ Received = gcnew array<String^>(4);
 BackgroundWorker1->ReportProgress(10,Received);

In report progress:

private: System::Void backgroundWorker1_ProgressChanged(System::Object^ sender,   System::ComponentModel::ProgressChangedEventArgs^  e)
{
    array<String^>^ Received2 = gcnew array<String^>(4);
    Received2 =(e->UserState);
}

I am getting:

error C2440: '=' : cannot convert from 'System::Object ^' to 'cli::array "

Can anyone advise me how to convert and assign UserState to string array? Thanks all for help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.