title: ActiveX plugin causes ASSERT to fail on application exit in VS2008
body: <p>My MFC application using the "ESRI MapObjects LT2" ActiveX plugin throws an ASSERT at me when closing it.
  The error occurs in <code>cmdtarg.cpp</code>:</p>
  
  <pre><code>CCmdTarget::~CCmdTarget()
  {
  #ifndef _AFX_NO_OLE_SUPPORT
      if (m_xDispatch.m_vtbl != 0)
          ((COleDispatchImpl*)&amp;m_xDispatch)-&gt;Disconnect();
      ASSERT(m_dwRef &lt;= 1); //&lt;--- Fails because m_dwRef is 3
  #endif
      m_pModuleState = NULL;
  }
  </code></pre>
  
  <p>I built the (native C++) application with VC9.
  When I compile the application with VC6, it behaves nicely.</p>
  
  <p>What could be the reason for this?</p>