<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>CodeProject Latest postings for Managed C++/CLI</title>
    <link>https://www.codeproject.com</link>
    <description>Latest postings for Managed C++/CLI from CodeProject</description>
    <language>en-us</language>
    <image>
      <title>CodeProject Latest postings for Managed C++/CLI</title>
      <url>https://www.codeproject.com/App_Themes/Std/Img/logo100x30.gif</url>
      <link>https://www.codeproject.com</link>
      <width>100</width>
      <height>30</height>
      <description>CodeProject</description>
    </image>
    <copyright>Copyright  CodeProject, 1999-2024</copyright>
    <webMaster>Webmaster@codeproject.com (Webmaster)</webMaster>
    <lastBuildDate>Mon, 15 Apr 2024 17:22:00 GMT</lastBuildDate>
    <ttl>20</ttl>
    <generator>C# Hand-coded goodness</generator>
    <item>
      <title>The C++ / CLI is for managed and mixed-mode C++ programming only</title>
      <description>This message board is for managed and mixed-mode C++ programming only: Managed C++ in VC++.NET or C++/CLI. Please post all standard C++ programming questions in the &lt;a href="/Forums/1647/C-Cplusplus-MFC.aspx" rel="nofollow"&gt;Visual C++ board&lt;/a&gt;[&lt;a href="/Forums/1647/C-Cplusplus-MFC.aspx" target="_blank" rel="nofollow"&gt;^&lt;/a&gt;]. &lt;br /&gt;
&lt;br /&gt;
cheers,&lt;br /&gt;
Chris Maunder&lt;br /&gt;
&lt;div class="smallText"&gt;CodeProject.com : C++ MVP&lt;/div&gt;</description>
      <author>Chris Maunder</author>
      <link>https://www.codeproject.com/Messages/1329679/The-Cplusplus-CLI-is-for-managed-and-mixed-mode-Cp</link>
      <pubDate>Mon, 09 Jan 2006 20:36:00 GMT</pubDate>
      <guid>3_1329679</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>MultiThreading/Synchronization related problem</title>
      <description>Hi Friends,&lt;br /&gt;
&lt;br /&gt;
I have been asked this below question in a interview related to MultiThreading/Synchronization&lt;br /&gt;
I don't have much expertise in the same area.&lt;br /&gt;
Please help me with the solution.&lt;br /&gt;
Thanks in Advance&lt;br /&gt;
&lt;br /&gt;
Problem-&gt;&lt;br /&gt;
Develop a C++ program to demonstrate  threading and synchronization.&lt;br /&gt;
&lt;br /&gt;
Char code generated by main process on press of key.   (int iChar = getch();​ ) &lt;br /&gt;
&lt;br /&gt;
Application will accept key between 0 to 9  only.&lt;br /&gt;
&lt;br /&gt;
Three threads are  spawned by main process to display key pressed&lt;br /&gt;
&lt;br /&gt;
Any  one of the thread will display the Number key pressed and and Thread ID&lt;br /&gt;
&lt;br /&gt;
If No key is pressed  Threads will wait for input.&lt;br /&gt;
&lt;br /&gt;
Process will be terminated if Key '0' is pressed.&lt;br /&gt;</description>
      <author>Amrit Agr</author>
      <link>https://www.codeproject.com/Messages/5996931/MultiThreading-Synchronization-related-problem</link>
      <pubDate>Mon, 15 Apr 2024 17:22:00 GMT</pubDate>
      <guid>3_5996931</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Need Help (Command Console)</title>
      <description>hey guys i am new here i need help you guys are pro i hope i am in right place i need some dll to call function like command console press key to call console then you type in it "hello guys" it will output hello guys as strings &lt;br /&gt;
&lt;br /&gt;
how i wanna use that dll&lt;br /&gt;
&lt;br /&gt;
load_library "Console.dll" &lt;br /&gt;
&lt;br /&gt;
get_proc_address "Commands"</description>
      <author>Mahek Thapa</author>
      <link>https://www.codeproject.com/Messages/5994791/Need-Help-Command-Console</link>
      <pubDate>Sat, 30 Mar 2024 15:17:00 GMT</pubDate>
      <guid>3_5994791</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Convert From C# to C++/CLI</title>
      <description>Hi, I try to convert from C# to C++/Cli. I have a small application in C#. When I try to print the RDLC report directly to printer, I found a c# online-codes.&lt;br /&gt;
&lt;br /&gt;
  &lt;div class='pre-lang' id='premain698873'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode698873' class='copy-code' data-index='698873' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre698873' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Print(&lt;span class="code-keyword"&gt;this&lt;/span&gt; LocalReport report, PageSettings pageSettings)
{
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; deviceInfo =
        $&lt;span class="code-string"&gt;@"&lt;/span&gt;&lt;span class="code-string"&gt;&amp;lt;DeviceInfo&amp;gt;
            &amp;lt;OutputFormat&amp;gt;EMF&amp;lt;/OutputFormat&amp;gt;
            &amp;lt;PageWidth&amp;gt;{pageSettings.PaperSize.Width * 100}in&amp;lt;/PageWidth&amp;gt;
            &amp;lt;PageHeight&amp;gt;{pageSettings.PaperSize.Height * 100}in&amp;lt;/PageHeight&amp;gt;
            &amp;lt;MarginTop&amp;gt;{pageSettings.Margins.Top * 100}in&amp;lt;/MarginTop&amp;gt;
            &amp;lt;MarginLeft&amp;gt;{pageSettings.Margins.Left * 100}in&amp;lt;/MarginLeft&amp;gt;
            &amp;lt;MarginRight&amp;gt;{pageSettings.Margins.Right * 100}in&amp;lt;/MarginRight&amp;gt;
            &amp;lt;MarginBottom&amp;gt;{pageSettings.Margins.Bottom * 100}in&amp;lt;/MarginBottom&amp;gt;
        &amp;lt;/DeviceInfo&amp;gt;"&lt;/span&gt;;
    Warning[] warnings;
    &lt;span class="code-keyword"&gt;var&lt;/span&gt; streams = &lt;span class="code-keyword"&gt;new&lt;/span&gt; List&amp;lt;Stream&amp;gt;();
    &lt;span class="code-keyword"&gt;var&lt;/span&gt; pageIndex = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
    report.Render(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Image"&lt;/span&gt;, deviceInfo,
        (name, fileNameExtension, encoding, mimeType, willSeek) =&amp;gt;
        {
            MemoryStream stream = &lt;span class="code-keyword"&gt;new&lt;/span&gt; MemoryStream();
            streams.Add(stream);
            &lt;span class="code-keyword"&gt;return&lt;/span&gt; stream;
        }, &lt;span class="code-keyword"&gt;out&lt;/span&gt; warnings);
    &lt;span class="code-keyword"&gt;foreach&lt;/span&gt; (Stream stream &lt;span class="code-keyword"&gt;in&lt;/span&gt; streams)
        stream.Position = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (streams == &lt;span class="code-keyword"&gt;null&lt;/span&gt; || streams.Count == &lt;span class="code-digit"&gt;0&lt;/span&gt;)
        &lt;span class="code-keyword"&gt;throw&lt;/span&gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; Exception(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;No stream to print."&lt;/span&gt;);
    &lt;span class="code-keyword"&gt;using&lt;/span&gt; (PrintDocument printDocument = &lt;span class="code-keyword"&gt;new&lt;/span&gt; PrintDocument())
    {
        printDocument.DefaultPageSettings = pageSettings;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (!printDocument.PrinterSettings.IsValid)
            &lt;span class="code-keyword"&gt;throw&lt;/span&gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; Exception(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Can&amp;#39;t find the default printer."&lt;/span&gt;);
        &lt;span class="code-keyword"&gt;else&lt;/span&gt;
        {
            printDocument.PrintPage += (sender, e) =&amp;gt;
            {
                Metafile pageImage = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Metafile(streams[pageIndex]);
                Rectangle adjustedRect = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Rectangle(e.PageBounds.Left - (&lt;span class="code-keyword"&gt;int&lt;/span&gt;)e.PageSettings.HardMarginX, e.PageBounds.Top - (&lt;span class="code-keyword"&gt;int&lt;/span&gt;)e.PageSettings.HardMarginY, e.PageBounds.Width, e.PageBounds.Height);
                e.Graphics.FillRectangle(Brushes.White, adjustedRect);
                e.Graphics.DrawImage(pageImage, adjustedRect);
                pageIndex++;
                e.HasMorePages = (pageIndex &amp;lt; streams.Count);
                e.Graphics.DrawRectangle(Pens.Red, adjustedRect);
            };
            printDocument.EndPrint += (Sender, e) =&amp;gt;
            {
                &lt;span class="code-keyword"&gt;if&lt;/span&gt; (streams != &lt;span class="code-keyword"&gt;null&lt;/span&gt;)
                {
                    &lt;span class="code-keyword"&gt;foreach&lt;/span&gt; (Stream stream &lt;span class="code-keyword"&gt;in&lt;/span&gt; streams)
                        stream.Close();
                    streams = &lt;span class="code-keyword"&gt;null&lt;/span&gt;;
                }
            };
            printDocument.Print();
        }
    }
}
&lt;/pre&gt;
For the above code I convert it like the below, but still need to improve the conversion, any helps please. Thanks. And my converted codes.
&lt;div class='pre-lang' id='premain767692'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode767692' class='copy-code' data-index='767692' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre767692' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt;: &lt;span class="code-keyword"&gt;static&lt;/span&gt; System::Void Print(LocalReport^ report, PageSettings^ pageSettings){
             String^ deviceInfo =
                 $&lt;span class="code-string"&gt;@"&lt;/span&gt;&lt;span class="code-string"&gt;&amp;lt;DeviceInfo&amp;gt;
                 &amp;lt;OutputFormat&amp;gt;EMF&amp;lt; / OutputFormat&amp;gt;
                 &amp;lt;PageWidth&amp;gt;{pageSettings-&amp;gt;PaperSize-&amp;gt;Width * 100}in&amp;lt; / PageWidth&amp;gt;
                 &amp;lt;PageHeight&amp;gt;{pageSettings-&amp;gt;PaperSize-&amp;gt;Height * 100}in&amp;lt; / PageHeight&amp;gt;
                 &amp;lt;MarginTop&amp;gt;{pageSettings-&amp;gt;Margins-&amp;gt;Top * 100}in&amp;lt; / MarginTop&amp;gt;
                 &amp;lt;MarginLeft&amp;gt;{pageSettings-&amp;gt;Margins-&amp;gt;Left * 100}in&amp;lt; / MarginLeft&amp;gt;
                 &amp;lt;MarginRight&amp;gt;{pageSettings-&amp;gt;Margins-&amp;gt;Right * 100}in&amp;lt; / MarginRight&amp;gt;
                 &amp;lt;MarginBottom&amp;gt;{pageSettings-&amp;gt;Margins-&amp;gt;Bottom * 100}in&amp;lt; / MarginBottom&amp;gt;
                 &amp;lt; / DeviceInfo&amp;gt;"&lt;/span&gt;;
                 cli::array&amp;lt;Warning^&amp;gt;^ warnings = gcnew cli::array&amp;lt;Warning^&amp;gt;();
                 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Warning[] warnings;&lt;/span&gt;
                 cli::array&amp;lt;Stream^&amp;gt;^ streams = gcnew cli::array&amp;lt;Stream^&amp;gt;();
                 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;var streams = new List&amp;lt;Stream&amp;gt;();&lt;/span&gt;
                 &lt;span class="code-keyword"&gt;int&lt;/span&gt; pageIndex = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
                 report-&amp;gt;Render(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Image"&lt;/span&gt;, deviceInfo, (name, fileNameExtension, encoding, mimeType, willSeek) = &amp;gt; {
                 MemoryStream^ stream = gcnew MemoryStream();
                 streams-&amp;gt;Add(stream);
                 &lt;span class="code-keyword"&gt;return&lt;/span&gt; stream;
                 }, out^ warnings);
                 &lt;span class="code-keyword"&gt;for&lt;/span&gt; each(Stream^ stream &lt;span class="code-keyword"&gt;in&lt;/span&gt; streams) {
                     stream-&amp;gt;Position = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
                     &lt;span class="code-keyword"&gt;if&lt;/span&gt; (streams == nullptr || streams-&amp;gt;Length == &lt;span class="code-digit"&gt;0&lt;/span&gt;) {
                         &lt;span class="code-keyword"&gt;throw&lt;/span&gt; gcnew Exception(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;No stream to print."&lt;/span&gt;);
                     }
                     &lt;span class="code-keyword"&gt;else&lt;/span&gt; {
                         PrintDocument^ printDocument = gcnew PrintDocument();
                         printDocument-&amp;gt;DefaultPageSettings = pageSettings;
                         &lt;span class="code-keyword"&gt;if&lt;/span&gt; (!printDocument-&amp;gt;PrinterSettings-&amp;gt;IsValid)
                             &lt;span class="code-keyword"&gt;throw&lt;/span&gt; gcnew Exception(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Can&amp;#39;t find the default printer."&lt;/span&gt;);
                         &lt;span class="code-keyword"&gt;else&lt;/span&gt;
                         {
                             printDocument-&amp;gt;PrintPage += (sender, e) = &amp;gt;
                             {
                                 Metafile^ pageImage = gcnew Metafile(streams[pageIndex]);
                                 Rectangle^ adjustedRect = gcnew Rectangle(e-&amp;gt;PageBounds-&amp;gt;Left - (&lt;span class="code-keyword"&gt;int&lt;/span&gt;)e-&amp;gt;PageSettings-&amp;gt;HardMarginX, e-&amp;gt;PageBounds-&amp;gt;Top - (&lt;span class="code-keyword"&gt;int&lt;/span&gt;)e-&amp;gt;PageSettings-&amp;gt;HardMarginY, e-&amp;gt;PageBounds-&amp;gt;Width, e-&amp;gt;PageBounds-&amp;gt;Height);
                                 e-&amp;gt;Graphics-&amp;gt;FillRectangle(Brushes-&amp;gt;White, adjustedRect);
                                 e-&amp;gt;Graphics-&amp;gt;DrawImage(pageImage, adjustedRect);
                                 pageIndex++;
                                 e-&amp;gt;HasMorePages = (pageIndex &amp;lt; streams-&amp;gt;Count);
                                 e-&amp;gt;Graphics-&amp;gt;DrawRectangle(Pens-&amp;gt;Red, adjustedRect);
                             };
                             printDocument-&amp;gt;EndPrint += (Sender, e) = &amp;gt;
                             {
                                 &lt;span class="code-keyword"&gt;if&lt;/span&gt; (streams != nullptr)
                                 {
                                     &lt;span class="code-keyword"&gt;foreach&lt;/span&gt;(Stream^ stream &lt;span class="code-keyword"&gt;in&lt;/span&gt; streams)
                                         stream-&amp;gt;Close();
                                     streams = nullptr;
                                 }
                             };
                             printDocument-&amp;gt;Print();
                         }
                     }
                 }
         }
&lt;/pre&gt;</description>
      <author>Paramu1973</author>
      <link>https://www.codeproject.com/Messages/5990648/Convert-From-Csharp-to-Cplusplus-CLI</link>
      <pubDate>Sat, 02 Mar 2024 01:26:00 GMT</pubDate>
      <guid>3_5990648</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Trying to Add System::ComponentModel</title>
      <description>I want to use the &lt;code&gt;Win32Exception&lt;/code&gt; class in my C++/CLI DLL. The docs say it is located in the &lt;code&gt;System::ComponentModel&lt;/code&gt; namespace.&lt;br /&gt;
&lt;br /&gt;
But Intellisense is telling me that there is no &lt;code&gt;ComponentModel&lt;/code&gt; namespace inside &lt;code&gt;System&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
And worse, there is no System.ComponentModel DLL to which to add a reference.&lt;br /&gt;
&lt;br /&gt;
I'm stuck. How do I get the &lt;code&gt;System::ComponentModel&lt;/code&gt; namespace and its classes into my DLL?&lt;br /&gt;
&lt;div class="signature"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difficult we do right away...&lt;br /&gt;
...the impossible takes slightly longer.&lt;/div&gt;</description>
      <author>Richard Andrew x64</author>
      <link>https://www.codeproject.com/Messages/5976958/Trying-to-Add-System-ComponentModel</link>
      <pubDate>Sat, 09 Dec 2023 21:10:00 GMT</pubDate>
      <guid>3_5976958</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>TreelistView c++/cli</title>
      <description>hi guys&lt;br /&gt;
&lt;br /&gt;
im working on c++/ cli project and i need something like objectlistview of TreelistView so i can display treeview with multi columns</description>
      <author>Temblor</author>
      <link>https://www.codeproject.com/Messages/5958333/TreelistView-cplusplus-cli</link>
      <pubDate>Tue, 22 Aug 2023 09:05:00 GMT</pubDate>
      <guid>3_5958333</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Heap Corruption in richedit</title>
      <description>Hi &lt;br /&gt;
&lt;br /&gt;
I am getting a heap corruption. I am running under the visual studio debugger. and the exception is at &lt;blockquote class="quote"&gt;&lt;div class="op"&gt;Quote:&lt;/div&gt; 	&lt;br /&gt;
ntdll.dll!RtlReportCriticalFailure&#x1E;()	Unknown&lt;br /&gt;
&lt;/blockquote&gt;     &lt;br /&gt;
&lt;br /&gt;
My scenario is I have a DLL reading and formatting data for a .exe. I keep a record count so when I get a exception, at &lt;blockquote class="quote"&gt;&lt;div class="op"&gt;Quote:&lt;/div&gt; 	ntdll.dll!RtlReportCriticalFailure&#x1E;()	Unknown&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
 I insert code if (recordcount == 0x0000196e) __debugbreak; I then start stepping through the code looking for the problem how ever when stepping through the code works I try this multiple times however when I stop the code where the exception were to occur it always complete successfully&lt;br /&gt;
&lt;br /&gt;
The listing I am trying to to inset in the richedit is huge about 153 pages 30 lines to page, 134 bytes across I roughly calculate the number of bytes I am trying to insert into the richedit is 1.6 meg. I am not sure if the size is the issue I do a Rciheditctrl::LimitText with the amount bytes I need&lt;br /&gt;
&lt;br /&gt;
Again when break on the offending record and step thru the code it completes normally    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Here is the stack frame My code starts a the DriveRichedit.exe&lt;br /&gt;
  &lt;br /&gt;
 	ntdll.dll!RtlReportCriticalFailure&#x1E;()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpHeapHandleError&#x1E;()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpHpHeapHandleError&#x1E;()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpLogHeapFailure&#x1E;()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpHeapFindListLookupEntry()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpFindEntry&#x1E;()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpAllocateHeap()	Unknown&lt;br /&gt;
 	ntdll.dll!RtlpAllocateHeapInternal()	Unknown&lt;br /&gt;
 	riched20.dll!CTxtArray::AddBlock(long,long)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtArray::SplitBlock(long,long,long,long,int)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtPtr::InsertRange(long,unsigned short const *)	Unknown&lt;br /&gt;
 	riched20.dll!CRchTxtPtr::ReplaceRange(long,long,unsigned short const *,class IUndoBuilder *,long,long *,unsigned long)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtRange::ReplaceRange(long,unsigned short const *,class IUndoBuilder *,enum SELRR,long *,unsigned long)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtRange::CheckLimitReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned long,long *,long,int,unsigned long)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtRange::CleanseAndReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned short *,long *,unsigned long)	Unknown&lt;br /&gt;
 	riched20.dll!CLightDTEngine::ReadPlainText(class CTxtRange *,struct _editstream *,int,class IUndoBuilder *,long)	Unknown&lt;br /&gt;
 	riched20.dll!CLightDTEngine::LoadFromEs(class CTxtRange *,long,struct _editstream *,int,class IUndoBuilder *)	Unknown&lt;br /&gt;
 	riched20.dll!CTxtEdit::TxSendMessage(unsigned int,unsigned __int64,__int64,__int64 *)	Unknown&lt;br /&gt;
 	riched20.dll!RichEditWndProc&#x1E;()	Unknown&lt;br /&gt;
 	riched20.dll!RichEditANSIWndProc&#x1E;()	Unknown&lt;br /&gt;
 	user32.dll!UserCallWinProcCheckWow()	Unknown&lt;br /&gt;
 	user32.dll!CallWindowProcAorW(__int64 ,struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,int)	Unknown&lt;br /&gt;
 	user32.dll!CallWindowProcA&#x1E;()	Unknown&lt;br /&gt;
 	mfc140d.dll!CWnd::DefWindowProcA(unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 1100	C++&lt;br /&gt;
 	mfc140d.dll!CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2100	C++&lt;br /&gt;
 	mfc140d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 265	C++&lt;br /&gt;
 	mfc140d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 418	C++&lt;br /&gt;
 	mfc140d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 299	C++&lt;br /&gt;
 	user32.dll!UserCallWinProcCheckWow()	Unknown&lt;br /&gt;
 	user32.dll!SendMessageWorker()	Unknown&lt;br /&gt;
 	user32.dll!SendMessageInternal(struct HWND__ *,unsigned int,unsigned __int64,__int64,int)	Unknown&lt;br /&gt;
 	user32.dll!SendMessageA()	Unknown&lt;br /&gt;
 	mfc140d.dll!CRichEditCtrl::StreamIn(int nFormat, _editstream &amp;amp; es) Line 775	C++&lt;br /&gt;
&amp;gt;	DriveRichEdit.exe!CProgDebug::OnInitDialog() Line 136	C++&lt;br /&gt;
 	[External Code]	&lt;br /&gt;
 	DriveRichEdit.exe!CMainFrame::PROGDEBUG() Line 48	C++&lt;br /&gt;
 	[External Code]	&lt;br /&gt;
 	DriveRichEdit.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26	C++&lt;br /&gt;
 	[External Code]</description>
      <author>ForNow</author>
      <link>https://www.codeproject.com/Messages/5920857/Heap-Corruption-in-richedit</link>
      <pubDate>Sun, 15 Jan 2023 23:49:00 GMT</pubDate>
      <guid>3_5920857</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>trying to understand DLL and Thread local storage</title>
      <description>Hi &lt;br /&gt;
&lt;br /&gt;
I have  been looking at the examples off dll and TLS &lt;br /&gt;
&lt;br /&gt;
First thing I noticed that &lt;div class='pre-lang' id='premain188492'&gt;&lt;div&gt;C++&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode188492' class='copy-code' data-index='188492' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre188492' style='margin-top:0;' class='lang-cplusplus' data-language='cpp' data-allowShrink='True' data-collapse='False'&gt;
DWORD g_dwThreadIndex;&lt;/pre&gt; is in global storage&lt;br /&gt;
&lt;br /&gt;
It would be nice as in the IBM manuals would have registers on at entry to DllMain&lt;br /&gt;
&lt;br /&gt;
I mean is the SP (register) that of the calling application&lt;br /&gt;
&lt;br /&gt;
regardless if the index returned from tlsalloc lets say is 5 &lt;br /&gt;
&lt;br /&gt;
and then before the current thread access the storage set by tlssetvalue&lt;br /&gt;
&lt;br /&gt;
another thread does a tlsallloc g_dwThreadindex becomes 6 &lt;br /&gt;
&lt;br /&gt;
then the first thread then does tlsgetvalue it  would be using 6 instead of 5 obviously I am not understanding something&lt;br /&gt;
&lt;br /&gt;
I mean if gw_dwThreadindex would be defined in the callers stack I would get it&lt;br /&gt;
&lt;br /&gt;
more so is the anyway of knowing the identity of the caller I mean maybe process id or thread guess I could do a call to Startupinfo</description>
      <author>ForNow</author>
      <link>https://www.codeproject.com/Messages/5912996/trying-to-understand-DLL-and-Thread-local-storage</link>
      <pubDate>Sun, 04 Dec 2022 19:52:00 GMT</pubDate>
      <guid>3_5912996</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Good news, /clr builds will soon add C++ 20 support!</title>
      <description>Here's some good news for anyone dealing with C++/CLI:&lt;br /&gt;
&lt;br /&gt;
Stephan Lavavej recently committed changes to the VC STL which will remove a number of the roadblocks and warnings we've hit using C++/CLI in recent years. The rest of our codebase is moving to use C++20 constructs and the /clr code has had problems. &lt;br /&gt;
&lt;br /&gt;
The PR: &lt;a href="https://github.com/microsoft/STL/pull/3194"&gt;Enable /clr C++ 20 support #3194&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
John</description>
      <author>John Schroedl</author>
      <link>https://www.codeproject.com/Messages/5909606/Good-news-clr-builds-will-soon-add-Cplusplus-20-su</link>
      <pubDate>Tue, 15 Nov 2022 16:49:00 GMT</pubDate>
      <guid>3_5909606</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>rekursif</title>
      <description>apakah anda bisa membantu saya membuat sebuah program yang sama outputnya tetapi beda kode programnya?&lt;br /&gt;
tolong bantu aku&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
// PROGRAM MENGHILANGKAN KARAKTER YANG SAMA DENGAN REKURSIF&lt;br /&gt;
&lt;br /&gt;
void remove(string roihan){&lt;br /&gt;
	//BASE CASE&lt;br /&gt;
    if (roihan.length() == 1){&lt;br /&gt;
        cout&amp;lt;</description>
      <author>Achmad Roihan</author>
      <link>https://www.codeproject.com/Messages/5906397/rekursif</link>
      <pubDate>Fri, 28 Oct 2022 12:31:00 GMT</pubDate>
      <guid>3_5906397</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>rekursif program (Recursive Program)</title>
      <description>fungsi program adalah menghilangkan karakter yang sama sehingga karakter tersebut hanya munsul satu kali dengan menggunakan rekursif&lt;br /&gt;
&lt;br /&gt;
perogram ku blm sempurnah&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="quote"&gt;&lt;div class="op"&gt;Google Translate:&lt;/div&gt;the function of the program is to remove the same character so that the character appears only once by using recursive&lt;br /&gt;
&lt;br /&gt;
my program is not perfect&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain154901'&gt;&lt;div&gt;C++&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode154901' class='copy-code' data-index='154901' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre154901' style='margin-top:0;' class='lang-cplusplus' data-language='C++' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;#include&lt;/span&gt;&lt;span class="code-preprocessor"&gt; &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;iostream&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class="code-keyword"&gt;#include&lt;/span&gt;&lt;span class="code-preprocessor"&gt; &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;windows.h&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class="code-keyword"&gt;using&lt;/span&gt; &lt;span class="code-keyword"&gt;namespace&lt;/span&gt; std;

&lt;span class="code-keyword"&gt;int&lt;/span&gt; main(){

 &lt;span class="code-keyword"&gt;char&lt;/span&gt; nama[&lt;span class="code-digit"&gt;1000&lt;/span&gt;];
 &lt;span class="code-keyword"&gt;int&lt;/span&gt; index[&lt;span class="code-digit"&gt;100&lt;/span&gt;];
 cout&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;masukkan nama = "&lt;/span&gt;;												

 &lt;span class="code-keyword"&gt;for&lt;/span&gt;(&lt;span class="code-keyword"&gt;int&lt;/span&gt; i=&lt;span class="code-digit"&gt;0&lt;/span&gt;; i&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;strlen(nama); i++){
 	
  &lt;span class="code-keyword"&gt;int&lt;/span&gt; n=&lt;span class="code-digit"&gt;0&lt;/span&gt;;
  
  &lt;span class="code-keyword"&gt;for&lt;/span&gt;(&lt;span class="code-keyword"&gt;int&lt;/span&gt; j=&lt;span class="code-digit"&gt;0&lt;/span&gt;; j&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;strlen(nama); j++){
  	
   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(nama[i] == nama[j]){
   	
   n++;
   
    index[j]=i;
   } 
  }
 }

 &lt;span class="code-keyword"&gt;for&lt;/span&gt;(&lt;span class="code-keyword"&gt;int&lt;/span&gt; i=&lt;span class="code-digit"&gt;0&lt;/span&gt;; i&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;strlen(nama); i++){
 	
  &lt;span class="code-keyword"&gt;if&lt;/span&gt;(i == index[i]){
  	
   cout&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;nama[i];
  }
 }
}&lt;/pre&gt;</description>
      <author>Achmad Roihan</author>
      <link>https://www.codeproject.com/Messages/5906178/rekursif-program-Recursive-Program</link>
      <pubDate>Thu, 27 Oct 2022 05:51:00 GMT</pubDate>
      <guid>3_5906178</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>How to close &amp;amp; clear the oledbconnection on form2()_load?</title>
      <description>Hi,&lt;br /&gt;
I am using vs-2015. Managed C++/Cli Windows Forms Applications. I have Form1-MdiContainer &amp;amp; Form2. From Form1_Button_Click() accessing Form2.&lt;br /&gt;
In Form2_Load() I have OLEDBConnection. For When I press Form1-Button_Click(),&lt;br /&gt;
First time it's working good. Also when I re-click() the same Form1-Button()&lt;br /&gt;
the whole application is getting closed. I analysed that when I close the OLEDBConnection, the whole program is also getting closed. And the same code working good in c#. I can't understand my mistakes..! Thanks.&lt;br /&gt;
&lt;br /&gt;
Note:- For First time when I click the Form1-Button no problem it's working good. But for re-click() whole application is getting closed().&lt;br /&gt;
Thanks Again&lt;br /&gt;
&lt;br /&gt;
My Codes
&lt;div class='pre-lang' id='premain513706'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode513706' class='copy-code' data-index='513706' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre513706' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
Form1-MdiContainer()
&lt;span class="code-keyword"&gt;private&lt;/span&gt;: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    Form2^ MyStForm = Form2::GetForm(&lt;span class="code-keyword"&gt;true&lt;/span&gt;, &lt;span class="code-keyword"&gt;this&lt;/span&gt;);
    MyStForm-&amp;gt;MdiParent = &lt;span class="code-keyword"&gt;this&lt;/span&gt;;
    MyStForm-&amp;gt;FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
    MyStForm-&amp;gt;Dock = DockStyle::Fill;
    MyStForm-&amp;gt;Show();
}
Form2-Top side
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;ref&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; Form2 : &lt;span class="code-keyword"&gt;public&lt;/span&gt; System::Windows::Forms::Form
    {
        &lt;span class="code-keyword"&gt;public&lt;/span&gt;: &lt;span class="code-keyword"&gt;static&lt;/span&gt; Form2^ Form2::_instance = nullptr;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt;: &lt;span class="code-keyword"&gt;static&lt;/span&gt; Form2^ Form2::GetForm(&lt;span class="code-keyword"&gt;bool&lt;/span&gt; IsMDIChild, System::Windows::Forms::Form^ MyInstFrm) {
            &lt;span class="code-keyword"&gt;if&lt;/span&gt; (_instance == nullptr)
                _instance = gcnew Form2();
            &lt;span class="code-keyword"&gt;if&lt;/span&gt; (_instance-&amp;gt;IsDisposed)
                _instance = gcnew Form2();
            &lt;span class="code-keyword"&gt;if&lt;/span&gt; (IsMDIChild)
                _instance-&amp;gt;MdiParent = MyInstFrm;
            &lt;span class="code-keyword"&gt;return&lt;/span&gt; _instance;
        }
        blah..blah...blah...
         }

Form2-Load()
&lt;span class="code-keyword"&gt;private&lt;/span&gt;: System::Void Form2_Load(System::Object^  sender, System::EventArgs^  e) {
    String^ MyStrConn = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&lt;/span&gt; + MyExcelFile + &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;; Extended Properties=\"Excel 12.0; HDR=YES; OLE DB Services=-1; \""&lt;/span&gt;;
    String^ MyExcelFile=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;C:\Students\Names.xlsx"&lt;/span&gt;;
    String^ MyExcelSheet = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;[Sheet1$]"&lt;/span&gt;;
    String^ MySQLSelect = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;select * from "&lt;/span&gt; + MyExcelSheet;
    System::Data::OleDb::OleDbConnection^ Cn1 = nullptr;
    Cn1 = gcnew System::Data::OleDb::OleDbConnection();
    Cn1-&amp;gt;ConnectionString = MyStrConn;
    System::Data::OleDb::OleDbCommand^ MyCmd = nullptr;
    MyCmd = gcnew System::Data::OleDb::OleDbCommand();
    MyCmd-&amp;gt;CommandText = MySQLSelect;
    MyCmd-&amp;gt;Connection = Cn1;
    Cn1-&amp;gt;Open();
        System::Data::OleDb::OleDbDataAdapter^ Da1 = gcnew System::Data::OleDb::OleDbDataAdapter(MyCmd);
        Da1-&amp;gt;Fill(MyDataTable);
    Cn1-&amp;gt;Close(); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;????????????????? getting stuck&lt;/span&gt;
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Cn1 != nullptr){
        MyCmd-&amp;gt;Cancel();
    }
    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Cn1-&amp;gt;ConnectionString = nullptr;&lt;/span&gt;
    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Cn1-&amp;gt;ReleaseObjectPool();&lt;/span&gt;
    MyCmd = nullptr;
    Cn1 = nullptr;

} &lt;/pre&gt;
Thanks</description>
      <author>Paramu1973</author>
      <link>https://www.codeproject.com/Messages/5903340/How-to-close-amp-clear-the-oledbconnection-on-form</link>
      <pubDate>Mon, 10 Oct 2022 00:10:00 GMT</pubDate>
      <guid>3_5903340</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>How does the compiler achieve the CRT remapping?</title>
      <description>We've noticed that calling C functions such as abs() will call into the C Runtime implementation of abs() for a Debug build but will call into System::Math::Abs in a Release build. This was pretty unexpected as the substitution of System::Math::Abs will trigger .NET exceptions such as System::OverflowException for out of bounds conditions whereas the CRT will always return a value.&lt;br /&gt;
&lt;br /&gt;
For example, this will crash in Release but exit normally in Debug. Yes, it's UB so anything is possible but it also calls System::Math::Abs even if the args are normal values. This just illustrates the exception vs non-exception.&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain872511'&gt;&lt;div&gt;C++&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode872511' class='copy-code' data-index='872511' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre872511' style='margin-top:0;' class='lang-cplusplus' data-language='C++' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;#include&lt;/span&gt;&lt;span class="code-preprocessor"&gt; &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;cmath&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class="code-keyword"&gt;#include&lt;/span&gt;&lt;span class="code-preprocessor"&gt; &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-leadattribute"&gt;stdio.h&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
&lt;span class="code-keyword"&gt;int&lt;/span&gt; main(&lt;span class="code-keyword"&gt;int&lt;/span&gt;, &lt;span class="code-keyword"&gt;char&lt;/span&gt;**) 
{
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-sdkkeyword"&gt;std::abs&lt;/span&gt;(INT_MIN);
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Does anyone have any links or good search terms for this C Runtime substitution behavior they're doing?  ex. Does the loader redirect calls into System:: entrypoints for things besides abs()? I'd like to see that list so I know which calls may need to be guarded with try/catch.  &lt;br /&gt;
&lt;br /&gt;
I can understand that they do this swap for performance purposes and to avoid extra managed-&amp;gt;native-&amp;gt;managed transitions but it was news to me that this was ocurring.&lt;br /&gt;
&lt;br /&gt;
John</description>
      <author>John Schroedl</author>
      <link>https://www.codeproject.com/Messages/5894663/How-does-the-compiler-achieve-the-CRT-remapping</link>
      <pubDate>Mon, 22 Aug 2022 20:50:00 GMT</pubDate>
      <guid>3_5894663</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>[Solved] I hope there is a Managed C++/CLR person left to help me with Parallel::For</title>
      <description>Microsoft Documentation allows me to change the pull down to C++ from C# but continues to shows C# syntax&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain872511'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode872511' class='copy-code' data-index='872511' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre872511' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-preprocessor"&gt;#pragma once
&lt;/span&gt;
&lt;span class="code-keyword"&gt;namespace&lt;/span&gt; CppTutorial {

	&lt;span class="code-keyword"&gt;using&lt;/span&gt; &lt;span class="code-keyword"&gt;namespace&lt;/span&gt; System;
  &lt;span class="code-keyword"&gt;using&lt;/span&gt; &lt;span class="code-keyword"&gt;namespace&lt;/span&gt; System::Threading::Tasks;

	&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;	&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; Summary for MainForm
&lt;/span&gt;	&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;/summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;	&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;ref&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; MainForm : &lt;span class="code-keyword"&gt;public&lt;/span&gt; System::Windows::Forms::Form
	{
	&lt;span class="code-keyword"&gt;public&lt;/span&gt;:
		MainForm(&lt;span class="code-keyword"&gt;void&lt;/span&gt;)
		{
			InitializeComponent();
			&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;&lt;/span&gt;
			&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;TODO: Add the constructor code here&lt;/span&gt;
			&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;&lt;/span&gt;
		}

	&lt;span class="code-keyword"&gt;protected&lt;/span&gt;:
		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; Clean up any resources being used.
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;/summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		~MainForm()
		{
			&lt;span class="code-keyword"&gt;if&lt;/span&gt; (components)
			{
				delete components;
			}
		}

	&lt;span class="code-keyword"&gt;private&lt;/span&gt;:
		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; Required designer variable.
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;/summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		System::ComponentModel::Container ^components;

&lt;span class="code-preprocessor"&gt;#pragma region Windows Form Designer generated code
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; Required method for Designer support - do not modify
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; the contents of this method with the code editor.
&lt;/span&gt;		&lt;span class="code-summarycomment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-summarycomment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-summarycomment"&gt;/summary&lt;/span&gt;&lt;span class="code-summarycomment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;		&lt;span class="code-keyword"&gt;void&lt;/span&gt; InitializeComponent(&lt;span class="code-keyword"&gt;void&lt;/span&gt;)
		{
      this-&amp;gt;SuspendLayout();
      &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;/span&gt;
      &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; MainForm&lt;/span&gt;
      &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;/span&gt;
      this-&amp;gt;AutoScaleDimensions=System::Drawing::SizeF(&lt;span class="code-digit"&gt;6&lt;/span&gt;,&lt;span class="code-digit"&gt;13&lt;/span&gt;);
      this-&amp;gt;AutoScaleMode=System::Windows::Forms::AutoScaleMode::Font;
      this-&amp;gt;ClientSize=System::Drawing::Size(&lt;span class="code-digit"&gt;284&lt;/span&gt;,&lt;span class="code-digit"&gt;261&lt;/span&gt;);
      this-&amp;gt;Name=L&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;MainForm"&lt;/span&gt;;
      this-&amp;gt;Text=L&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;MainForm"&lt;/span&gt;;
      this-&amp;gt;Shown+=gcnew System::EventHandler(&lt;span class="code-keyword"&gt;this&lt;/span&gt;,&amp;amp;MainForm::MainForm_Shown);
      this-&amp;gt;ResumeLayout(&lt;span class="code-keyword"&gt;false&lt;/span&gt;);

    }
&lt;span class="code-preprocessor"&gt;#pragma endregion
&lt;/span&gt;
  &lt;span class="code-keyword"&gt;public&lt;/span&gt;:
  
  &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Body(&lt;span class="code-keyword"&gt;int&lt;/span&gt; index)
  {
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; test=&lt;span class="code-digit"&gt;0&lt;/span&gt;;
  }

  &lt;span class="code-keyword"&gt;delegate&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; MyDelegate(&lt;span class="code-keyword"&gt;int&lt;/span&gt; index);

  System::Void MainForm_Shown(System::Object^ sender,System::EventArgs^ e) 
  {
    MyDelegate ^body=gcnew MyDelegate(MainForm::Body);     
    ParallelLoopResult ^result=Parallel::For(&lt;span class="code-digit"&gt;0&lt;/span&gt;,&lt;span class="code-digit"&gt;10&lt;/span&gt;,(System::Action &amp;lt;int&amp;gt; ^)body);
  }

  };
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
System.InvalidCastException:&lt;br /&gt;
Unable to cast object of type 'MyDelegate' to type 'System.Action`1[System.Int32]'.&lt;br /&gt;
&lt;br /&gt;
in MC++/CLI i cant find the right syntax to use for&lt;br /&gt;
ParallelLoopResult ^result=Parallel::For( without casting to Action&lt;br /&gt;
there is no generic delegate in the overides&lt;br /&gt;
&lt;br /&gt;
Is there any MC++/CLI people left out there that can help or offer any other way to paralleize a for loop&lt;br /&gt;
&lt;br /&gt;
i tried the old parallel_for(x,y,z){ "do stuff here" } way but&lt;br /&gt;
i couldnt get that very far with that either&lt;br /&gt;
i prefer to stick with .net but this delegate stuff omg :¬( im to old hehe&lt;br /&gt;
&lt;br /&gt;
Thanks for even bothering to read this</description>
      <author>madusmacus</author>
      <link>https://www.codeproject.com/Messages/5889881/Solved-I-hope-there-is-a-Managed-Cplusplus-CLR-per</link>
      <pubDate>Wed, 27 Jul 2022 14:25:00 GMT</pubDate>
      <guid>3_5889881</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>c++ forms 2022 code</title>
      <description>What is the wrong with this code?&lt;br /&gt;
I simply want to show data from a datatable I have just made in a datagidview.&lt;br /&gt;
The code runs well but doesn't show the data. NB: the code written in c++ winforms 2022&lt;br /&gt;
           The code: &lt;div class='pre-lang' id='premain67696'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode67696' class='copy-code' data-index='67696' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre67696' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
DataTable ^dt = gcnew DataTable();
					 
					 dt-&amp;gt;Columns-&amp;gt;Add(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Name"&lt;/span&gt;);
					 dt-&amp;gt;Columns-&amp;gt;Add(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Surname"&lt;/span&gt;);
					 dt-&amp;gt;Columns-&amp;gt;Add(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Address"&lt;/span&gt;);
					 dt-&amp;gt;Columns-&amp;gt;Add(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Phone"&lt;/span&gt;);

					 DataRow^ datarow = dt-&amp;gt;NewRow();
					 					 
					 datarow[&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Name"&lt;/span&gt;] = &amp;lt;pre lang=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;C++"&lt;/span&gt;&amp;gt;&lt;/pre&gt; "Ahmad";&lt;br /&gt;
					 datarow["Surname"] = "Hassan";&lt;br /&gt;
					 datarow["Address"] = "Cairo";&lt;br /&gt;
					 datarow["Phone"] = "0987654321";&lt;br /&gt;
&lt;br /&gt;
					 dt-&amp;gt;Rows-&amp;gt;Add(datarow);&lt;br /&gt;
&lt;br /&gt;
					 dataGridView1-&amp;gt;DataSource = dt;</description>
      <author>Member 8848464</author>
      <link>https://www.codeproject.com/Messages/5883014/cplusplus-forms-2022-code</link>
      <pubDate>Fri, 17 Jun 2022 11:37:00 GMT</pubDate>
      <guid>3_5883014</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>I want to write a C++/CLI wrapper class library which can be utilized in both C++ and C# applications.</title>
      <description>&lt;div class='pre-lang' id='premain67696'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode67696' class='copy-code' data-index='67696' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre67696' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
I want to write a C++/CLI wrapper &lt;span class="code-keyword"&gt;class&lt;/span&gt; library which can be utilized &lt;span class="code-keyword"&gt;in&lt;/span&gt; both C++ and C# applications. Step by step procedure will be more helpful along with project configurations.Basically i want to consume the c++/cli dll &lt;span class="code-keyword"&gt;in&lt;/span&gt; both the applications. i need to write a wrapper which will be compatible with both the applications &lt;/pre&gt;</description>
      <author>Member 12162400</author>
      <link>https://www.codeproject.com/Messages/5881741/I-want-to-write-a-Cplusplus-CLI-wrapper-class-libr</link>
      <pubDate>Fri, 10 Jun 2022 07:45:00 GMT</pubDate>
      <guid>3_5881741</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>simplifying code</title>
      <description>i could use some tip about simplifying this code:&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain67696'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode67696' class='copy-code' data-index='67696' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre67696' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;class&lt;/span&gt; Pojazd
{
&lt;span class="code-keyword"&gt;public&lt;/span&gt;:

    &lt;span class="code-keyword"&gt;virtual&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; buduj()=&lt;span class="code-digit"&gt;0&lt;/span&gt;;
};

&lt;span class="code-keyword"&gt;class&lt;/span&gt; Sedan : Pojazd
{
&lt;span class="code-keyword"&gt;private&lt;/span&gt;:
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; typ=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Sedan"&lt;/span&gt;;
&lt;span class="code-keyword"&gt;public&lt;/span&gt;:
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; marka;
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; model;
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; hp;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;horse power&lt;/span&gt;
    &lt;span class="code-keyword"&gt;double&lt;/span&gt; v;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;pojemnosc silnika&lt;/span&gt;
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; cena;
    &lt;span class="code-keyword"&gt;virtual&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; buduj()
    {
        cout &amp;lt;&amp;lt; marka &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; "&lt;/span&gt; &amp;lt;&amp;lt; model &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; "&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Typ nadwozia: "&lt;/span&gt; &amp;lt;&amp;lt; typ &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Dane Techniczne: "&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;-"&lt;/span&gt; &amp;lt;&amp;lt; hp &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; KM"&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;\n-Silnik: "&lt;/span&gt; &amp;lt;&amp;lt; v &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;L"&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Cena "&lt;/span&gt; &amp;lt;&amp;lt; cena &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;\nmiesieczna rata "&lt;/span&gt; &amp;lt;&amp;lt; cena / &lt;span class="code-digit"&gt;12&lt;/span&gt; &amp;lt;&amp;lt; endl;
    }
    Sedan(&lt;span class="code-keyword"&gt;string&lt;/span&gt; nadwozie)
    {
        nadwozie = typ;
    }

};

&lt;span class="code-keyword"&gt;class&lt;/span&gt; Hatchback : Pojazd
{

    &lt;span class="code-keyword"&gt;string&lt;/span&gt; typ;
&lt;span class="code-keyword"&gt;public&lt;/span&gt;:
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; marka;                                             
    &lt;span class="code-keyword"&gt;string&lt;/span&gt; model;
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; hp;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;horse power&lt;/span&gt;
    &lt;span class="code-keyword"&gt;double&lt;/span&gt; v;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;pojemnosc silnika&lt;/span&gt;
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; cena;
    &lt;span class="code-keyword"&gt;virtual&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; buduj()
    {
        cout &amp;lt;&amp;lt; marka &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; "&lt;/span&gt; &amp;lt;&amp;lt; model &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; "&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Typ nadwozia: "&lt;/span&gt; &amp;lt;&amp;lt; typ &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Dane Techniczne: "&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;-"&lt;/span&gt; &amp;lt;&amp;lt; hp &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt; KM"&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;\n-Silnik: "&lt;/span&gt; &amp;lt;&amp;lt; v &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;L"&lt;/span&gt; &amp;lt;&amp;lt; endl;
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Cena "&lt;/span&gt; &amp;lt;&amp;lt; cena &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;\nmiesieczna rata "&lt;/span&gt; &amp;lt;&amp;lt; cena / &lt;span class="code-digit"&gt;12&lt;/span&gt; &amp;lt;&amp;lt; endl;
    }
    Hatchback(&lt;span class="code-keyword"&gt;string&lt;/span&gt; typ)
    {
        typ = typ;
    }
};

&lt;span class="code-keyword"&gt;int&lt;/span&gt; main()
{
    w:
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; switch_on;
    cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;1.Sedan\n2.Hatchback"&lt;/span&gt;&amp;lt;&amp;lt;endl;
    cin &amp;gt;&amp;gt; switch_on;
    &lt;span class="code-keyword"&gt;switch&lt;/span&gt; (switch_on)
    {
    &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-digit"&gt;1&lt;/span&gt;:
    {
        cout &amp;lt;&amp;lt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;1.Mercedes\n2.BMW\n3.Audi\n"&lt;/span&gt;;
        cin &amp;gt;&amp;gt; switch_on;
        &lt;span class="code-keyword"&gt;switch&lt;/span&gt; (switch_on)
        {
        &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-digit"&gt;1&lt;/span&gt;:
        {
            Sedan Mercedes(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Sedan"&lt;/span&gt;);
            Mercedes.marka = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Mercedes"&lt;/span&gt;;
            Mercedes.model = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;A klasa"&lt;/span&gt;;
            Mercedes.hp = &lt;span class="code-digit"&gt;145&lt;/span&gt;;
            Mercedes.v = &lt;span class="code-digit"&gt;2&lt;/span&gt;.&lt;span class="code-digit"&gt;1&lt;/span&gt;;
            Mercedes.cena = &lt;span class="code-digit"&gt;156000&lt;/span&gt;;

            Sedan* wsk_sedan;
            wsk_sedan = &amp;amp;Mercedes;
            wsk_sedan-&amp;gt;buduj();

        }
        &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-digit"&gt;2&lt;/span&gt;:
        {
            Sedan BMW(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Sedan"&lt;/span&gt;);
            BMW.marka = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;BMW"&lt;/span&gt;;
            BMW.model = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;d531i"&lt;/span&gt;;
            BMW.hp = &lt;span class="code-digit"&gt;166&lt;/span&gt;;
            BMW.v = &lt;span class="code-digit"&gt;2&lt;/span&gt;.&lt;span class="code-digit"&gt;5&lt;/span&gt;;
            BMW.cena = &lt;span class="code-digit"&gt;188770&lt;/span&gt;;

            Sedan* wsk_sedan;
            wsk_sedan = &amp;amp;BMW;
            wsk_sedan-&amp;gt;buduj();
        }
         
        }
    
}
        &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
    &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-digit"&gt;2&lt;/span&gt;:
    {
        
    }
        &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
    }
    

   
    

    &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-digit"&gt;0&lt;/span&gt;;
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
i could continue with constructing this switch case tree sort of thingy &lt;br /&gt;
but i'm wondering if i can make it simpler and maybe more like a pro ( &lt;img src="https://www.codeproject.com/script/Forums/Images/smiley_cool.gif" align="top" alt="Cool | :cool:" /&gt; )&lt;br /&gt;
i dont expect ready to go code just some tip/hint so i can find more info myself</description>
      <author>hshan_</author>
      <link>https://www.codeproject.com/Messages/5866327/simplifying-code</link>
      <pubDate>Tue, 15 Mar 2022 16:30:00 GMT</pubDate>
      <guid>3_5866327</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Convert From C# To Visual C++ 2015</title>
      <description>Hi,&lt;br /&gt;
I need to generate the following XML codes. And Iam using VS2015.
&lt;div class='pre-lang' id='premain262881'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode262881' class='copy-code' data-index='262881' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre262881' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&amp;lt;TALLYMESSAGE xmlns:UDF=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TallyUDF"&lt;/span&gt;&amp;gt;
  &amp;lt;VOUCHER VCHTYPE=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Sales"&lt;/span&gt; ACTION=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Create"&lt;/span&gt;&amp;gt;
     &amp;lt;VOUCHERTYPENAME&amp;gt;Sales&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;VOUCHERTYPENAME&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
     &amp;lt;ALLLEDGERENTRIES.LIST&amp;gt;
        &amp;lt;REMOVEZEROENTRIES&amp;gt;No&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;REMOVEZEROENTRIES&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
        &amp;lt;ISDEEMEDPOSITIVE&amp;gt;Yes&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;ISDEEMEDPOSITIVE&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
        &amp;lt;LEDGERFROMITEM&amp;gt;No&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;LEDGERFROMITEM&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
        &amp;lt;LEDGERNAME&amp;gt;Customer &lt;span class="code-digit"&gt;1&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;LEDGERNAME&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
        &amp;lt;AMOUNT&amp;gt;-5000&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;AMOUNT&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;ALLLEDGERENTRIES.LIST&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;VOUCHER&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;TALLYMESSAGE&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
For That from our website quick answers, I received the following codes in C#.
&lt;div class='pre-lang' id='premain592728'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode592728' class='copy-code' data-index='592728' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre592728' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-bracket"&gt;[&lt;/span&gt;&lt;span class="code-sdkkeyword"&gt;XmlRoot&lt;/span&gt;(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ALLLEDGERENTRIES.LIST"&lt;/span&gt;)]
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; ALLLEDGERENTRIESLIST { 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;REMOVEZEROENTRIES"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; REMOVEZEROENTRIES { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ISDEEMEDPOSITIVE"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; ISDEEMEDPOSITIVE { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;LEDGERFROMITEM"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; LEDGERFROMITEM { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;LEDGERNAME"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; LEDGERNAME { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;AMOUNT"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; AMOUNT { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 
}&lt;/pre&gt;

&lt;div class='pre-lang' id='premain123110'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode123110' class='copy-code' data-index='123110' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre123110' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-bracket"&gt;[&lt;/span&gt;&lt;span class="code-sdkkeyword"&gt;XmlRoot&lt;/span&gt;(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;VOUCHER"&lt;/span&gt;)]
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; VOUCHER { 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;VOUCHERTYPENAME"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; VOUCHERTYPENAME { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ALLLEDGERENTRIES.LIST"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; ALLLEDGERENTRIESLIST ALLLEDGERENTRIESLIST { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlAttribute(AttributeName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;VCHTYPE"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; VCHTYPE { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlAttribute(AttributeName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ACTION"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; ACTION { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlText] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; Text { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 
}&lt;/pre&gt;

&lt;div class='pre-lang' id='premain623333'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode623333' class='copy-code' data-index='623333' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre623333' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-bracket"&gt;[&lt;/span&gt;&lt;span class="code-sdkkeyword"&gt;XmlRoot&lt;/span&gt;(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TALLYMESSAGE"&lt;/span&gt;)]
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; TALLYMESSAGE { 

    [XmlElement(ElementName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;VOUCHER"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; VOUCHER VOUCHER { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlAttribute(AttributeName=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;UDF"&lt;/span&gt;)] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; UDF { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 

    [XmlText] 
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; Text { &lt;span class="code-keyword"&gt;get&lt;/span&gt;; &lt;span class="code-keyword"&gt;set&lt;/span&gt;; } 
}&lt;/pre&gt;
Is It possible to convert this From C# to Visual C++ 2015.&lt;br /&gt;
&lt;br /&gt;
My heartiest thanks for all helps&lt;br /&gt;
Always Thank To Richard &amp;amp; Victor &amp;amp; Other Superiors, those who are having kind hearts.&lt;br /&gt;
Thank Again</description>
      <author>Paramu1973</author>
      <link>https://www.codeproject.com/Messages/5848599/Convert-From-Csharp-To-Visual-Cplusplus-2015</link>
      <pubDate>Tue, 14 Dec 2021 07:21:00 GMT</pubDate>
      <guid>3_5848599</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>openFileDialog - AccessViolationException was unhandled</title>
      <description>Hi, &lt;br /&gt;
Iam using Vs2015, While I try to Open a file using OpenFileDialog, Iam receiving the error &lt;br /&gt;
&lt;br /&gt;
"Unhandled exception of type" System.AccessViolationException" occoured in system.windows.forms.dll &lt;br /&gt;
Additional information: Attempted to read or write protected memory.This is often an indication other memory is currupt.  &lt;br /&gt;
&lt;br /&gt;
My Codes
&lt;div class='pre-lang' id='premain911169'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode911169' class='copy-code' data-index='911169' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre911169' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
System::Windows::Forms::OpenFileDialog^ MyFileOpenDialog = gcnew System::Windows::Forms::OpenFileDialog();
MyFileOpenDialog-&amp;gt;Title = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Select Your Excel Test File"&lt;/span&gt;;
MyFileOpenDialog-&amp;gt;InitialDirectory = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;C:\\"&lt;/span&gt;;
MyFileOpenDialog-&amp;gt;Filter = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Excel Files (*.xls)|*.xls|All files (*.*)|*.*"&lt;/span&gt;;
MyFileOpenDialog-&amp;gt;FilterIndex = &lt;span class="code-digit"&gt;2&lt;/span&gt;;
MyFileOpenDialog-&amp;gt;RestoreDirectory = &lt;span class="code-keyword"&gt;true&lt;/span&gt;;
&lt;span class="code-keyword"&gt;if&lt;/span&gt; (MyFileOpenDialog-&amp;gt;ShowDialog() == System::Windows::Forms::DialogResult::OK) {
    MyExcelFile = MyFileOpenDialog-&amp;gt;FileName;
}&lt;/pre&gt;
I cannot  understand my mistake !&lt;br /&gt;
Thanks For the helps!&lt;img src="https://www.codeproject.com/script/Forums/Images/thumbs_up.gif" align="top" alt="Thumbs Up | :thumbsup:" /&gt; &lt;br /&gt;
Richard pls. advise me! Thank again !</description>
      <author>Paramu1973</author>
      <link>https://www.codeproject.com/Messages/5835587/openFileDialog-AccessViolationException-was-unhand</link>
      <pubDate>Mon, 04 Oct 2021 22:28:00 GMT</pubDate>
      <guid>3_5835587</guid>
      <subject>Managed C++/CLI</subject>
    </item>
    <item>
      <title>Convert/cast System::Array  class to List</title>
      <description>How do I convert array to list?&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain747549'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode747549' class='copy-code' data-index='747549' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre747549' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
array&amp;lt;System::Byte&amp;gt;^ My1DArray = gcnew array&amp;lt;System::Byte&amp;gt;(&lt;span class="code-digit"&gt;100&lt;/span&gt;);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
to &lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain293012'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode293012' class='copy-code' data-index='293012' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre293012' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
List&amp;lt;System::Byte&amp;gt;^ temp

temp = My1DArray.ToList(); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;doesn&amp;#39;t work&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Update:&lt;br /&gt;
&lt;br /&gt;
I am currently using a for loop to copy data 1 by 1, if there's no other faster way ,i'll stick with this for now . Thanks!&lt;br /&gt;
&lt;div class='pre-lang' id='premain60654'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode60654' class='copy-code' data-index='60654' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre60654' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
array&amp;lt;System::Byte&amp;gt;^ My1DArray = gcnew array&amp;lt;System::Byte&amp;gt;(&lt;span class="code-digit"&gt;100&lt;/span&gt;);

int^ bytesToRead = gcnew(&lt;span class="code-keyword"&gt;int&lt;/span&gt;);
*bytesToRead = SerialPort-&amp;gt;BytesToRead;
SerialPort-&amp;gt;Read(My1DArray, &lt;span class="code-digit"&gt;0&lt;/span&gt;, *bytesToRead);
SerialPort-&amp;gt;DiscardInBuffer();

List&amp;lt;System::Byte&amp;gt;^ temp = gcnew List&amp;lt;System::Byte&amp;gt;;

int^ counter = gcnew (&lt;span class="code-keyword"&gt;int&lt;/span&gt;);
&lt;span class="code-keyword"&gt;for&lt;/span&gt; (*counter = &lt;span class="code-digit"&gt;0&lt;/span&gt;; *counter &amp;lt; *bytesToRead; (*counter)++) {
    temp-&amp;gt;Add(My1DArray[*counter]);
}
&lt;/pre&gt;</description>
      <author>yehiga1467</author>
      <link>https://www.codeproject.com/Messages/5812001/Convert-cast-System-Array-class-to-List</link>
      <pubDate>Fri, 11 Jun 2021 03:51:00 GMT</pubDate>
      <guid>3_5812001</guid>
      <subject>Managed C++/CLI</subject>
    </item>
  </channel>
</rss>