Thank you very much Richard If MS docs had C++ version of this i would have not neded to bother you I was very confused as i dont do delegates if i can avoid it Very happy some C++/CLR people still exist ill mark as solved Here is the Final working MainForm() showing cross thread update of textBox, Random, and usage of other Member funtions This is here to help anyone that is as bad at this overcomplicated Parallel coding in C++/CLR (my opinion should be easier) "Parallel::For" - intellisense still moans about 2 or more overloads of it but who cares anyway, no one :¬)
namespace CppTutorial {
using namespace System;
using namespace System::Threading::Tasks;
using namespace System::Windows::Forms;
/// /// Summary for MainForm
///
public ref class MainForm : public System::Windows::Forms::Form
{
public:
MainForm(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// /// Clean up any resources being used.
///
~MainForm()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox ^textBox1;
protected:
private:
/// /// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// /// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->textBox1=(gcnew System::Windows::Forms::TextBox());
this->SuspendLayout();
//
// textBox1
//
this->textBox1->Dock=System::Windows::Forms::DockStyle::Fill;
this->textBox1->Location=System::Drawing::Point(0,0);
this->textBox1->Multiline=true;
this->textBox1->Name=L"textBox1";
this->textBox1->Size=System::Drawing::Size(563,451);
this->textBox1->TabIndex=0;
//
// MainForm
//
this->AutoScaleDimensions=System::Drawing::SizeF(6,13);
this->AutoScaleMode=System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize=System::Drawing::Size(563,451);
this->Controls->Add(this->textBox1);
this->Name=L"MainForm";
this->Text=L"MainForm";
this->Shown+=gcnew System::EventHandler(this,&MainForm::MainForm_Shown);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
public:
static MainForm ^staticmain;
Random ^rand1