title: Debugging Memory Leaks in Windows Component Object Model (COM)
body: <p>We have a native C++ application running on Windows which uses Component Object Model (COM)  as a client.  In our case, we can using <code>IUIAutomation</code>.  Unfortunately, we have memory leaks in our code that aren't showing up using our basic memory debugging approaches:</p>
  
  <p><code>_CRTDBG_MAP_ALLOC</code> - <a href="http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx</a></p>
  
  <p>How can we debug memory leaks in our executable related to our misuse of COM/IUnknown/and memory allocations across the COM barrier?  </p>
  
  <p>We are flexible on tools/libraries/etc.  We are on Windows 8 running Visual Studio 2012.</p>