<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>Polywick Studio Development Diaries</title>
  <link>https://polywickstudio.net/development-diaries</link>
  <atom:link href="https://polywickstudio.net/development-diary/rss.xml" rel="self" type="application/rss+xml" />
  <description>Development diaries from Polywick Studio.</description>
  <language>en</language>
  <lastBuildDate>Tue, 17 Feb 2026 02:22:01 GMT</lastBuildDate>
  <item>
    <title>Hot reloading QT C++ using Live++</title>
    <link>https://polywickstudio.net/development-diary/Hot-reloading-using-Live</link>
    <guid isPermaLink="true">https://polywickstudio.net/development-diary/Hot-reloading-using-Live</guid>
    <pubDate>Tue, 17 Feb 2026 02:21:39 GMT</pubDate>
    <category>C++ Builder</category>
    <description><![CDATA[C++ development lifecycle consists of - coding and waiting for the compiler to compile and link. Sometimes, the compiler takes many minutes, sometimes, hours to generate a resultant executable. Precious development time is spent... waiting. Live++ saves time and increases productivity]]></description>
    <content:encoded><![CDATA[<p>Turbocharge your QT C++ development using&nbsp;<a href="https://liveplusplus.tech/" target="_blank" rel="noopener noreferrer">Live++</a>&nbsp;hot reloading.</p><h2>What is hot reloading?</h2><p>C++ development lifecycle consists of - coding and waiting for the compiler to compile and link. Sometimes, the compiler takes many minutes, sometimes, hours to generate a resultant executable. Precious development time is spent... waiting.</p><figure><img src="https://polywickstudio.net/img/diaries/details/compiling-WugbB.png" alt="XKCD Compiling" /><figcaption>XKCD Compiling</figcaption></figure><p><a href="https://xkcd.com/303/" target="_blank" rel="noopener noreferrer">Photocredt: XKCD - Compiling</a></p><p>Before using Hot Reloading, you can avail of the following tips:</p>
  <ul>
    
        <li>
          Using a RAM drive means you have to put the whole C++ Build tool to RAM drive, all the libraries, and save the files back to NVME drive. This means your work will get accidentally wiped if your computer reboots.
          
        </li>
      
        <li>
          Moving code to PCH (Pre-compiled Headers), optimizing your code only goes so far before slow C++ compiler wears you down.
          
        </li>
      
        <li>
          Make sure your build process runs in Parallel. Set&nbsp;<a href="https://ninja-build.org/manual.html" target="_blank" rel="noopener noreferrer">Ninja number of parallel jobs</a>&nbsp;or set the number of parallel jobs Visual Studio
          
        </li>
      
  </ul>
<figure><img src="https://polywickstudio.net/img/diaries/details/image-q1Ndf.png" alt="" /></figure>
  <ul>
    
        <li>
          In C++ Builder, there is&nbsp;<a href="https://blogs.embarcadero.com/cbuilder-optimization-guide-with-twinecompile/" target="_blank" rel="noopener noreferrer">Twine compiler enhancement</a> which optimizes compile-time.
          
        </li>
      
  </ul>
<figure><img src="https://polywickstudio.net/img/diaries/details/image-EAlZI.png" alt="" /></figure><p>Live++ is easy to integrate with your code, and&nbsp;Live++ hot-patching modifies code-changes at run-time, greatly reducing debug and refactoring time.</p><h2>Immense Time Savings</h2><p>Adding Live++ is, simply linking to the Live++ SDK, and running the initialization process. When you want to recompile, use the Live++ hotkey - Ctrl+Alt+F11, as it patches the EXE with your updates, while your app <b>is still running!</b></p><figure><img src="https://polywickstudio.net/img/diaries/details/image-oHD5e.png" alt="" /></figure><p>Whoa. As a development example, you load data from the database, and you update the code to generate report, without restarting the app.<br><br><br>Without using Live++, you would have to constantly reload data from the database, then debug the code to generate the report.</p><p><br>Image a situation where, you update code, and don't have to repeatedly reload data from database to generate the report? That would save lot of time, allow you to resolve bugs immediately.<br><br></p><figure><img src="https://polywickstudio.net/img/diaries/details/TerminatorreloadinghisshotgunlikeabadassTerminator2-PLU1Z.gif" alt="Terminator: Hot reloading" /><figcaption>Terminator: Hot reloading</figcaption></figure><p><i>Photocredit: Terminator 2 clip.</i></p><h2>Reduce Build Times</h2><p>An average build takes 7+ minutes. A full recompile may take 15 minutes.</p><p>If there are multiple dependencies, and, work needs to be done in auxiliary projects, Doing a final build could take longer than an hour.</p><hr /><p>After using Live++, I could go between 3 seconds to 3mins for a hot-reload, instead of a compile every 7-15 minutes. This immense time-saving means I can do work faster.</p><pre>    lpp::LppDefaultAgent lppAgent = lpp::<span>LppCreateDefaultAgent</span>(<span>nullptr</span>, <span>L"(Folder)"</span>);
    <span>// bail out in case the agent is not valid</span>
    <span>if</span> (!lpp::<span>LppIsValidDefaultAgent</span>(&amp;lppAgent))
    {
        <span>return</span> <span>1</span>;
    }
    <span>// enable Live++ for all loaded modules</span>
    lppAgent.<span>EnableModule</span>(lpp::<span>LppGetCurrentModulePath</span>(), lpp::LPP_MODULES_OPTION_NONE, <span>nullptr</span>, <span>nullptr</span>);
</pre><p>Do you have C++ QT projects which require developers, who work smart, fast and think beyond the AI box?&nbsp;<a href="https://polywickstudio.net/contact" target="_blank" rel="noopener noreferrer">Contact us</a>.</p>]]></content:encoded>
    <dc:creator>Polywick Studio</dc:creator>
    <atom:updated>2026-02-17T02:22:01.059Z</atom:updated>
  </item>
  <item>
    <title>Accelerate your Apps using the Superluminal Performance Profiler.</title>
    <link>https://polywickstudio.net/development-diary/Accelerate-your-Apps-using-the-Superluminal-Performance-Profiler</link>
    <guid isPermaLink="true">https://polywickstudio.net/development-diary/Accelerate-your-Apps-using-the-Superluminal-Performance-Profiler</guid>
    <pubDate>Thu, 15 May 2025 08:38:38 GMT</pubDate>
    <category>C++ Builder</category>
    <description><![CDATA[Accelerate your App&#39;s Performance using SuperLuminal&#39;s  modern cutting-edge profiler for C++ Builder&#39;s ModernX 64-bit compiler. It is priced affordably, and one-time  purchase  if you are buying an individual license.]]></description>
    <content:encoded><![CDATA[<p>I have been looking for a Profiler that works with Delphi  and C++ Builder's new compiler, ModernX.</p><h2>What is Super Luminal?</h2><p><a href="https://superluminal.eu/" target="_blank" rel="noopener noreferrer">Superluminal</a>&nbsp;is a modern cutting-edge profiler,&nbsp;for Delphi's 64-bit and C++ Builder's ModernX 64-bit compiler. It is priced affordably, and one-time&nbsp;<a href="https://superluminal.eu/pricing/" target="_blank" rel="noopener noreferrer">purchase</a>&nbsp;if you are buying an individual license.</p>
  <ul>
    
        <li>
           Individuals: €59 (perpetual license),
          
        </li>
      
        <li>
          Businesses: €289 (per seat/per year).
          
        </li>
      
  </ul>
<p>Great feature set, and burn-down chart.</p><h2>Superluminal Tutorial for Delphi</h2><p>Superluminal is designed to profile 64-bit EXE files. If you are targeting Delphi 32-bit or C++ Builder 32-bit EXEs, you can easily switch your target platform to Delphi or C++ Builder Windows 64-bit.</p><h2>Step 1. Map2PDB</h2><p>Superluminal uses PDB files for profiling. However, Delphi generates TDS files. To bridge this gap, you can use a utility called <b>map2pdb</b> that converts MAP files into PDB format.</p><figure><img src="https://polywickstudio.net/img/diaries/details/profiler-9362689.png" alt="" /></figure><p>1. <b>Download</b> `map2pdb.exe` from Anders Melander's&nbsp;<a href="https://github.com/andersmelander/map2pdb" target="_blank" rel="noopener noreferrer">Github</a>&nbsp;repository.</p><p>2. <b>Copy</b> `map2pdb.exe` to a folder included in your system's environment pat</p><p>The below paths are suggested directory for specific Delphi versions.</p><p>For Delphi 12.2, Delphi 12.3</p><p>C:&gt;Users&gt;Public&gt;Documents&gt;Embarcadero&gt;Studio&gt;23.0&gt;Bpl</p><p>For Delphi 12.1:</p><p>C:&gt;Users&gt;Public&gt;Documents&gt;Embarcadero&gt;Studio&gt;22.0&gt;Bpl</p><p>For Delphi 12.0:</p><p>C:&gt;Users&gt;Public&gt;Documents&gt;Embarcadero&gt;Studio&gt;21.0&gt;Bpl</p><p>For Delphi 11.3:</p><p>C:&gt;Users&gt;Public&gt;Documents&gt;Embarcadero&gt;Studio&gt;20.0&gt;Bpl</p><p>_Replace &gt; to "" as Wordpress removes "backslash"._<br><br>Note: a&nbsp;<a href="https://gist.github.com/PolywickStudio/9cd285b36d25589e769b6ede6d7bf55e" target="_blank" rel="noopener noreferrer">Gist version</a>&nbsp;of the above-mentioned paths is provided.</p><h2>Step 2. Enable Map file output</h2><p>You need to enable MAP file in Delphi and C++ Builder. By default, this is turned off.</p><p>Go to Project | Options, Building | Delphi Compiler | Linking, Map File. Change to <b>Detailed</b>.</p><figure><img src="https://polywickstudio.net/img/diaries/details/a0cee0196e34f493578677c7420a9ef9-3949643.png" alt="" /></figure><p>For the next step, there are 2 approaches, to generate the MAP file via post-build event, or batch file.</p><h2>Step 3A. Use Post-build event.</h2><p>map2pdb.exe -pdb:(OUTPUTDIR)(OUTPUTFILENAME).pdb -bind:(OUTPUTDIR)(OUTPUTFILENAME) (OUTPUTDIR)(OUTPUTNAME).map<br><br>&nbsp; Note: a&nbsp;<a href="https://gist.github.com/PolywickStudio/9cd285b36d25589e769b6ede6d7bf55e" target="_blank" rel="noopener noreferrer">Gist version</a>&nbsp;of the above-mentioned paths is provided.&nbsp;&nbsp;</p><h2>Step 3B. Use a batch file</h2><p>map2pdb.exe -pdb:.win64DebugProfilerSample1.pdb -bind:.win64DebugProfilerSample1.exe .win64DebugProfilerSample1.map</p><p>pause</p><p>where: _win64DebugProfilerSample1.exe_ is your output project.<br><br>&nbsp; Note: a&nbsp;<a href="https://gist.github.com/PolywickStudio/9cd285b36d25589e769b6ede6d7bf55e" target="_blank" rel="noopener noreferrer">Gist version</a>&nbsp;of the above-mentioned paths is provided.&nbsp;&nbsp;</p><h2>Step 4. Profile!</h2><p>Please see the github directory for 3 sample projects - in Delphi, C++ Builder and C++ Builder ModernX.</p><h2>How to get your C++ ModernX project to work with Superluminal</h2><p>Enable MAP file and set property to <b>Detailed</b>.</p><figure><img src="https://polywickstudio.net/img/diaries/details/cbbmodernxoptions-4675445.png" alt="" /></figure><p>Profile! You should be able to see C++ Builder functions in Superluminal.</p><h2>Alternate Profilers</h2><p>To profile 32-bit EXEs, you can use Nexus Quality Suite, ProDelphi,&nbsp;<a href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html" target="_blank" rel="noopener noreferrer">Intel VTune</a>, or&nbsp;<a href="https://blogs.embarcadero.com/powerful-spider-delphi-profiler-brings-you-real-time-profiling-for-delphi-applications/" target="_blank" rel="noopener noreferrer">Spider Profiler</a>.</p><h2>Enhance your App Performance using NQS</h2><p>NexusDB's Nexus Quality Suite "<a href="https://nexusdb.com/support/index.php?q=node/27156" target="_blank" rel="noopener noreferrer">NQS</a>" is another excellent choice.</p><p>- -NQS includes CodeWatch, TestDriver and Coverage Analyst, invaluable tools to have in your toolchest.</p><p>-&nbsp;<a href="https://nexusdb.com/support/index.php?q=codewatchfeatures" target="_blank" rel="noopener noreferrer">CodeWatch</a>&nbsp;allows you to check memory-leaks, resource-leaks and API errors.</p><p>-&nbsp;<a href="https://nexusdb.com/support/index.php?q=testdriverfeatures" target="_blank" rel="noopener noreferrer">TestDriver</a>&nbsp;is a testing tool that records mouse and keyboard-strokes as scripts. TestDriver works with VCL and FMX.</p><p>-&nbsp;<a href="https://nexusdb.com/support/index.php?q=coverageanalystfeatures" target="_blank" rel="noopener noreferrer">Coverage Analyst</a>&nbsp;allows you to do code-coverage, to analyze which lines of code the profiler has hit. This allows you to check for redundant, dead-code, or create test-cases with conditions which execute all the lines in the resultant EXE or DLL.</p><h2>Propel your Delphi app to new heights using ProDelphi</h2><p>If you are using the Delphi part of RadStudio,&nbsp;<a href="https://www.prodelphi.de/" target="_blank" rel="noopener noreferrer">ProDelphi</a>&nbsp;is a CPU-cycles profiler. This works by isolating the code profiled, to only specific procedures and functions.</p><p>This works by isolating the code profiled, to only specific procedures and functions.</p><p>ProDelphi offers an alternative to traditional profiling, where it may be impractical to do whole-app profiling, due to copy-protection code interfering with the Profiler, or contains non-source DCUs or OBJ files, or interfaces third-party DLLs or non-Delphi DLLs which contains copy-protection</p><p>ProDelphi allows you to do drill-down profiling, where only certain parts of the application are profiled.</p><p><i>There is no correct way of doing profiling. Profiling is a process of sleuthing, finding bottlenecks and optimizing code.</i></p><hr /><p>Are you interested to get competitive priced updates, or need to update your Delphi apps?&nbsp;<br><a href="https://polywickstudio.net/contact" target="_blank" rel="noopener noreferrer">Contact us.</a></p><h2>Article Corrections</h2><p>1. Anders Bitbucket link updated to&nbsp;<a href="https://github.com/andersmelander/map2pdb" target="_blank" rel="noopener noreferrer">Github</a>.</p><p>2. A&nbsp;<a href="https://gist.github.com/PolywickStudio/9cd285b36d25589e769b6ede6d7bf55e" target="_blank" rel="noopener noreferrer">Gist</a>&nbsp;of the command-line statements are published on Gist. For some reason Wordpress keeps munching the slash for no reason.</p>]]></content:encoded>
    <dc:creator>Polywick Studio</dc:creator>
    <atom:updated>2025-08-29T04:19:58.824Z</atom:updated>
  </item>
  <item>
    <title>Powerful VCL Code Hooks in Delphi Athens on Windows</title>
    <link>https://polywickstudio.net/development-diary/Powerful-VCL-Code-Hooks-in-Delphi-Athens-on-Windows</link>
    <guid isPermaLink="true">https://polywickstudio.net/development-diary/Powerful-VCL-Code-Hooks-in-Delphi-Athens-on-Windows</guid>
    <pubDate>Sun, 26 May 2024 16:42:58 GMT</pubDate>
    <category>Delphi, C++ Builder, RadStudio</category>
    <description><![CDATA[Andy&#39;s VCL Fix Pack is a Delphi open-source unit that fixes VCL and RTL issues at runtime by patching the original functions. Here&#39;s one way to fix Delphi bug QC15408.]]></description>
    <content:encoded><![CDATA[<h2>Brief Introduction</h2><p><a href="https://www.idefixpack.de/blog/bugfix-units/vclfixpack-10/">Andy's VCL Fix Pack</a> is a Delphi open-source unit that fixes VCL and RTL issues at runtime by patching the original functions.</p><hr /><p>Andy's Unit contains easy-to-use functions to update code that cannot be easily recompiled or changed.</p><hr /><p>If you try to change VCL sources (files in Source folder of your RadStudio, Delphi or C++ Builder installation) and attempt to recompile them within your project, you'll get multiple errors, such as: DCU mismatch, (<i>file1.pas</i>) is compiled with a newer version of (<i>file2.pas</i>).  This occurs when source-code is compiled with a different file and needs to be fully recompiled.</p><hr /><p>The above errors may occur when source code is not present. This may occur, when a third-party library you brought, contains only DCU or DCP files.</p><hr /><h2>Example</h2><p>In the below example, I create a function. The code is redirected to another unit.<br></p><pre><code class="language-delphi">

procedure TfrmSample.Update1; 
begin
  ShowMessage('Hello World');
end;

procedure TfrmSample.Button2Click(Sender: TObject);
begin
  Update1;
end; 

</code></pre><hr /><p>Using <b>VCLFix.pas</b>, I can redirect the <i>TfrmSample.Update1</i> to another unit, so it shows "<i>Bye World</i>" instead!<br><br></p><figure><img src="https://polywickstudio.net/img/diaries/details/2024-05-15_00-51-08b-_8NRhs.jpg" alt="" /></figure><hr /><h2>Fixing QC15408</h2><p>I'm using Andy's VCL Fix Pack to fix Delphi bug QC15408.</p><hr /><p>In Delphi QC15408, when VCL UI objects TButton, TEdit are disabled, hint is <i>also </i>disabled.</p><p><br>Seen below</p><figure><img src="https://polywickstudio.net/img/diaries/details/qc15408_normal-9a42uQ.png" alt="" /></figure><hr /><p>In this fix, when the VCL UI objects TButton, TEdit are disabled, the hints are enabled.</p><figure><img src="https://polywickstudio.net/img/diaries/details/qc15408_fix-AHKgkP.png" alt="" /></figure><hr /><p>This fix works by hooking code that's private in Controls.FindDragTarget and replacing it with code I've made.</p><hr /><p>Source code is at this git repository:</p><p><a href="https://github.com/PolywickStudio/AndyVCLFIXPack">https://github.com/PolywickStudio/AndyVCLFIXPack</a></p><p><br>In this example, you can use Andy's VCLFixPack to create work-arounds for VCL bugs or resolve VCL issues.</p>]]></content:encoded>
    <dc:creator>Polywick Studio</dc:creator>
    <atom:updated>2024-06-13T02:47:56.275Z</atom:updated>
  </item>
  <item>
    <title>QT Windows Exception Logging Technique</title>
    <link>https://polywickstudio.net/development-diary/Quick-Bugs-Triage-with-QT-Windows-Exception-Logging-Technique</link>
    <guid isPermaLink="true">https://polywickstudio.net/development-diary/Quick-Bugs-Triage-with-QT-Windows-Exception-Logging-Technique</guid>
    <pubDate>Sat, 25 May 2024 10:44:40 GMT</pubDate>
    <category>C++ QT</category>
    <description><![CDATA[A small code snippet to handle QT Windows Structured Exception Handling (SEH)]]></description>
    <content:encoded><![CDATA[<h2>Background</h2><p>QT Windows C++ Applications do not have a specific Windows Exception handler.</p><hr /><p>In MFC, there is a CodeProject project <a href="https://www.codeproject.com/Articles/5257/XCrashReport-Exception-Handling-and-Crash-Reportin" target="_blank" rel="noopener noreferrer">XCrashReport</a>.</p><hr /><p>In QT, there isn't a specific SEH (Structured Exception Handler) so you need to add this manually.<br></p><hr /><h2>QT Windows SEH Handler</h2><p>In main.cpp file, before QT starts, add the following lines</p><pre><code class="language-cpp">
#ifdef _WINDOWS
// This code is specific to Windows platform
#define NOMINMAX
#include &lt;windows.h&gt;
#undef NOMINMAX


LONG WINAPI unhandled_handler(struct _EXCEPTION_POINTERS *apExceptionInfo);
{
    // Create your SEH 
    create_minidump(apExceptionInfo);
    return EXCEPTION_CONTINUE_SEARCH;
}
#endif

int main(int argc, char *argv[])
{
#ifdef _WINDOWS
    SetUnhandledExceptionFilter(unhandled_handler);
#endif
    QApplication app(argc, argv);
    return app.exec();
}

</code></pre><p>The above code, paired with an on-line bug tracker and CI/CD environment, allows for fast bug triage for QT applications.</p>]]></content:encoded>
    <dc:creator>Polywick Studio</dc:creator>
    <atom:updated>2024-06-02T19:03:48.275Z</atom:updated>
  </item>
</channel>
</rss>