<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C++ on Remko's Blog</title><link>https://remkoweijnen.nl/blog/categories/c++/</link><description>Recent content in C++ on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 13 Mar 2013 10:01:31 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/categories/c++/index.xml" rel="self" type="application/rss+xml"/><item><title>Returning a string from unmanaged dll to .net</title><link>https://remkoweijnen.nl/blog/2013/03/13/returning-a-string-from-unmanaged-dll-to-net/</link><pubDate>Wed, 13 Mar 2013 10:01:31 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/03/13/returning-a-string-from-unmanaged-dll-to-net/</guid><description>&lt;p&gt;&lt;img style="display: inline; float: right;" src="https://remkoweijnen.nl/blog/wp-content/uploads/recovered/40dc8d791b9e08ae.png" width="88" height="88" align="right" /&gt;I write most of my code in unmanaged languages such as Delphi and C/C++. Sometimes customers ask me to interface my code to their .net code in which case I create a dll for them.&lt;/p&gt;
&lt;p&gt;A recurring thing is that I need to return string to .net.&lt;/p&gt;
&lt;p&gt;There are many ways to do this of course but in all cases we need to manage memory: who will allocate the memory for the string and who is responsible for freeing it?&lt;/p&gt;</description></item><item><title>NTVDM encountered a hard error</title><link>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</link><pubDate>Wed, 14 Dec 2011 21:41:22 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/</guid><description>&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image7.webp" class="glightbox" data-type="image" data-gallery="post-2254"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 3px 0px 0px; display: inline; float: left" title="MS-Dos Logo" alt="MS-Dos Logo" align="left" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb7.webp" width="74" height="82" /&gt;&lt;/a&gt;Today I troubleshooted an old DOS application that needed to run on a 32 bit Citrix XenApp Server. The last time I saw an actual DOS application in a production environment must be years ago.&lt;/p&gt; &lt;p&gt;When starting the application, the WOW subsystem (NTVDM) crashed with the message: "NTVM encountered a hard error.":&lt;/p&gt; &lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image8.webp" class="glightbox" data-type="image" data-gallery="post-2254"&gt;&lt;img loading="lazy" decoding="async" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ntvdm.exe - System Error" border="0" alt="NTVDM encoutered a hard error" src="https://remkoweijnen.nl/blog/wp-content/uploads/2011/12/image_thumb8.webp" width="198" height="104" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;After spending some time troubleshooting I remembered a similar issue from a few years ago where a DOS application worked fine from the Console but refused to work from an RDP or ICA session.&lt;/p&gt;</description></item></channel></rss>