Skip to content

Managed C++/CLI

Discussions on Managed Extensions for Visual C++ .NET

This category can be followed from the open social web via the handle managed-c-cli@forum.codeproject.com

4.4k Topics 14.9k Posts
  • MultiThreading/Synchronization related problem

    help c++ question career
    2
    0 Votes
    2 Posts
    29 Views
    L
    Amrit Agr wrote: Please help me with the solution. Exactly what help are you asking for? If you are expecting someone else to write the code for you, I am afraid you have come to the wrong place. And if you have no expertise in this area, why are you being interviewed for such a role? Incidentally, your question has nothing to do with C++/CLI, it is should have gone to C / C++ / MFC Discussion Boards[^].
  • Need Help (Command Console)

    help
    7
    0 Votes
    7 Posts
    36 Views
    A
    Yeah sorry, as Dave stated, not going to happen if you want someone to write your code for you, not how it works here on CP
  • Convert From C# to C++/CLI

    csharp c++ graphics
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • 0 Votes
    1 Posts
    9 Views
    No one has replied
  • Trying to Add System::ComponentModel

    question c++ visual-studio help
    4
    0 Votes
    4 Posts
    22 Views
    L
    The documentation at Win32Exception Class (System.ComponentModel) | Microsoft Learn[^] tells you which dll holds it.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • TreelistView c++/cli

    c++
    11
    0 Votes
    11 Posts
    59 Views
    T
    FINALLY I MADE IT ;)
  • 0 Votes
    16 Posts
    63 Views
    K
    glthreads does not collide msride.
  • Heap Corruption in richedit

    help csharp visual-studio data-structures debugging
    4
    0 Votes
    4 Posts
    17 Views
    K
    stat thread does not collapse prominent threads such as concept of algorithmics and totality.
  • Good news, /clr builds will soon add C++ 20 support!

    c++ dotnet com json announcement
    2
    0 Votes
    2 Posts
    16 Views
    K
    depends on upper class methods, whether oos, or objs. Perls, or methods outside the class, are concurrent.
  • 0 Votes
    1 Posts
    7 Views
    No one has replied
  • rekursif

    question
    2
    0 Votes
    2 Posts
    19 Views
    OriginalGriffO
    No. Partly because it's incomplete so we have no idea what it's supposed to do, partly because if you are trying to recreate an existing program, it's because the version you have can't be handed in without you presumably getting spotted for plagiarism. And if that's the case, you won't learn anything from the exercise if you do. Sit down with your assignment, think about it, and try designing an app from scratch. You end up learning more, and that means that your next assignment will be easier for you to complete yourself. If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^] And by the way: when I told you yesterday that we are an English language site, it's somewhat rude to ignore that and carry on posting in Indonesian. Being rude to people you want voluntary help from isn't a good way to start ... "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • rekursif program (Recursive Program)

    database
    2
    0 Votes
    2 Posts
    16 Views
    OriginalGriffO
    This is an English language site, and we can only accept and answer questions in that language. I have run this through Google Translate to produce a probably-good version, but you should check it and make sure it does say what you are actually asking. And that code isn't recursive: it's iterative. Recursion happens when a function calls itself, either directly: int foo(int i) { if (i <= 1) return 1; return i + foo(i - 1); } Or indirectly: int foo(int i) { if (i <= 1) return 1; return i + bar(i); } int bar(int i) { return foo(i - 1); } Your code contains one method, which you do not call yourself! And please, do yourself a favour and indent your code more deeply - it's a lot easier to see what is going on with three or four spaces per indent rather than one. It's not a massive problem with a tiny code fragment like you show, but as your code gets bigger it becomes seriously difficult to work out what is going on! "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • 0 Votes
    2 Posts
    14 Views
    L
    This might help re: the data adapter. Quote: This overload of the Fill method does not implicitly call Close on the ADO object when the fill operation is complete. Therefore, always call Close when you are finished using ADO Recordset or Record objects. This makes sure that the underlying connection to a data source is released in a timely manner, and also prevents possible access violations because of unmanaged ADO objects being reclaimed by garbage collection when existing references still exist. "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
  • 0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    3 Posts
    26 Views
    M
    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
  • calling String ^ * from C#

    c++ question csharp com help
    8
    0 Votes
    8 Posts
    39 Views
    R
    Thanks ByStorm. You saved my life. Been searching for this for weeks.
  • c++

    c++ tutorial
    4
    0 Votes
    4 Posts
    24 Views
    S
    You have to include windows.h header. Here is an working example. #include #include #include int main() { DEVMODE devmode; devmode.dmPelsWidth = 1024; devmode.dmPelsHeight = 768; devmode.dmFields = DM\_PELSWIDTH | DM\_PELSHEIGHT; devmode.dmSize = sizeof(DEVMODE); long result = ChangeDisplaySettings(&devmode, 0); return 0; }
  • c++ forms 2022 code

    question csharp c++ winforms
    2
    0 Votes
    2 Posts
    15 Views
    L
    Try calling dataGridView1->Refresh() after you add the data.
  • 0 Votes
    1 Posts
    6 Views
    No one has replied