Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

madusmacus

@madusmacus
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • [Solved] I hope there is a Managed C++/CLR person left to help me with Parallel::For
    M madusmacus

    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

    Managed C++/CLI csharp help c++ database dotnet

  • [Solved] I hope there is a Managed C++/CLR person left to help me with Parallel::For
    M madusmacus

    Microsoft Documentation allows me to change the pull down to C++ from C# but continues to shows C# syntax

    #pragma once

    namespace CppTutorial {

    using namespace System;
    

    using namespace System::Threading::Tasks;

    /// /// 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:
    	/// /// 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->SuspendLayout();
    //
    // MainForm
    //
    this->AutoScaleDimensions=System::Drawing::SizeF(6,13);
    this->AutoScaleMode=System::Windows::Forms::AutoScaleMode::Font;
    this->ClientSize=System::Drawing::Size(284,261);
    this->Name=L"MainForm";
    this->Text=L"MainForm";
    this->Shown+=gcnew System::EventHandler(this,&MainForm::MainForm_Shown);
    this->ResumeLayout(false);

    }
    

    #pragma endregion

    public:

    static void Body(int index)
    {
    int test=0;
    }

    delegate void MyDelegate(int index);

    System::Void MainForm_Shown(System::Object^ sender,System::EventArgs^ e)
    {
    MyDelegate ^body=gcnew MyDelegate(MainForm::Body);
    ParallelLoopResult ^result=Parallel::For(0,10,(System::Action ^)body);
    }

    };
    }

    I know its all a bit bodged but its the only way i could get it to compile and link but the problem is obvious run time crash System.InvalidCastException: Unable to cast object of type 'MyDelegate' to type 'System.Action`1[System.Int32]'. in MC++/CLI i cant find the right syntax to use for ParallelLoopResult ^result=Parallel::For( without casting to Action there is no generic delegate in the overides Is there any MC++/CLI people left out there that can help or offer any other way to paralleize a for loop i tried the old parallel_for(x,y,z){ "do stuff here" } way but i couldnt get that very far with that either i prefer to stick with .net but this delegate stuff omg :¬

    Managed C++/CLI csharp help c++ database dotnet

  • I Moved this question to the proper forum "Managed C++/CLI" - Sorry for posting in the wrong place :¬)
    M madusmacus

    Thanks Victor for explaining i s in the wrong forum i did for look for a managed C++ CLI forum but i totaly failed :) I will moved my question to the right one now :¬)

    C / C++ / MFC c++ question

  • I Moved this question to the proper forum "Managed C++/CLI" - Sorry for posting in the wrong place :¬)
    M madusmacus

    Moved this question to the proper forum "Managed C++/CLI" Feel free to delete i cant

    C / C++ / MFC c++ question

  • Can I change my email address on my account??
    M madusmacus

    Use ie10/11 to change email addy Seems broken in Chrome Version 67.0.3396.99 (Official Build) (64-bit) Email shows but is blanked and password change is a popup with no input fields Can i have some of whatever your having as i dont see bouncing balls :¬) Update: Actualy Im dumb it was uBlock Plus causing the problems with chrome but using ie11 works well if your having trouble

    Site Bugs / Suggestions question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups