title: Access violation writing location 0xCCCCCCCC
body: <p>So i have one of the wierdest bug i've seen in my life.
  I've bought a DirectX 11 book which comes with some [sample code]:<a href="http://www.d3dcoder.net/d3d11.htm" rel="nofollow">http://www.d3dcoder.net/d3d11.htm</a>
  I am pretty sure at some point in time i managed to compile and run every single sample app, but now, i have a "Access violation writing location 0xCCCCCCCC" error at runtime.</p>
  
  <p>Now, this is happening one the following line :</p>
  
  <pre><code>ShadowsApp::ShadowsApp(HINSTANCE hInstance) : D3DApp(hInstance)
  {
      mMainWndCaption = L"Shadows Demo"; &lt;- Crashes here !!!  
      mLastMousePos.x = 0;
      mLastMousePos.y = 0;
      ...
  }
  </code></pre>
  
  <p>mMainWndCaption being declared like this in the .h</p>
  
  <pre><code>std::wstring mMainWndCaption;
  </code></pre>
  
  <p>and set with a default value in the constructor of the class ShadowsApp inherits from</p>
  
  <pre><code>D3DApp::D3DApp(HINSTANCE hInstance) : 
  mhAppInst(hInstance),
  mMainWndCaption(L"D3D11 Application"),...
  </code></pre>
  
  <p>I think, this is already quite odd ...
  Now the strangest part comes when i declare ANY variable of ANY type in the d3dApp.h, I no longer have the "Access violation writing location 0xCCCCCCCC" error, everything builds and run perfectly.
  As a C# programmer, this makes absolutely no sense to me. How can the declaration of a random variable in a class can "fix" such a thing ?!</p>
  
  <p>Any suggestion would be greatly appreciated :-)</p>