title: Memory Leak (false positive) when an MFC applications uses a DLL
body: <p>I develop a C++ Library (DLL). When I create a minimal MFC project (VS2017) that links with this DLL its okay. But as soon as any function of the library is used by the MFC application the debugger of the MFC project complains about memory leaks (many lines like the ones below):</p>
  
  <pre><code>Detected memory leaks!
  Dumping objects -&gt;
  {2255} normal block at 0x000002A4B1F8C360, 48 bytes long.
   Data: &lt;                &gt; 10 BB F8 B1 A4 02 00 00 B0 BD F8 B1 A4 02 00 00 
  {2242} normal block at 0x000002A4B1F8BDB0, 48 bytes long.
   Data: &lt;                &gt; C0 C0 F8 B1 A4 02 00 00 F0 C2 F8 B1 A4 02 00 00 
  {2220} normal block at 0x000002A4B1F8C2F0, 48 bytes long.
   Data: &lt;                &gt; 80 C2 F8 B1 A4 02 00 00 10 C9 F8 B1 A4 02 00 00 
  </code></pre>
  
  <p>These are false positives because it occurs also when only an empty test function of the library is called. Moreover this does not happen when the library is linked with a non-MFC project. </p>
  
  <p>What can cause these warnings? Related information:</p>
  
  <ul>
  <li>A VS2013 user said that he can avoid the warnings by changing the
  character set of his MFC project. I have tested that in VS2017 but
  get still warnings. </li>
  <li>A VS2017 user said that the warnings are gone when he delay-loads
  the DLL.</li>
  <li>In the course of debugging I have compiled the DLL with CMake in order to use settings which are as standard as possible. But no change. </li>
  </ul>