title: C++: Unhandled exception at 0x0b9ec715 (XX.dll) in XY.exe: 0xC0000005: Access violation reading location 0x00000004
body: <p>How do I debug the above error?  I'm using C++ with Microsoft Visual Studio.</p>
  
  <p>Below is part of the code:</p>
  
  <pre><code>HDC dc =*mMemDC;
  X-&gt;SelectPalette(dc);
  </code></pre>
  
  <p>When I debug the code, it crashes on the line <code>X-&gt;selectPallete(dc);</code></p>