title: What's the fundamental difference between MFC and ATL?
body: <p><em>Assuming I am <strong>only</strong> using them for "normal" GUI programs (no COM, no ActiveX, nothing fancy), what is the fundamental difference I will see between ATL and MFC, to help me figure out which one to use?</em></p>
  
  <hr>
  
  <p>I've done some searches on the web, but ultimately none of the answers really answered my question:</p>
  
  <ul>
  <li><p><a href="http://msdn.microsoft.com/en-us/library/bk8ytxz5(v=vs.80).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/bk8ytxz5(v=vs.80).aspx</a>:</p>
  
  <ul>
  <li><p><em>"ATL is a fast, easy way to both create a COM component in C++ and maintain a small footprint. Use ATL to create a control if you don't need all of the built-in functionality that MFC automatically provides."</em></p>
  
  <p>Doesn't really answer my question, because:</p>
  
  <ul>
  <li><p>I'm not working with COM.</p></li>
  <li><p>Does this imply MFC <em>isn't</em> fast? Why/how?</p></li>
  </ul></li>
  <li><p><em>"MFC allows you to create full applications, ActiveX controls, and active documents. If you have already created a control with MFC, you may want to continue development in MFC. When creating a new control, consider using ATL if you don't need all of MFC's built-in functionality."</em></p>
  
  <p>Also doesn't answer my question, because:</p>
  
  <ul>
  <li><p>I don't really even know what ActiveX <em>is</em> in the first place.</p></li>
  <li><p>It looks as though Microsoft is discouraging the use of MFC, but I can't figure out why.</p></li>
  <li><p>What exactly <strong><em>is</em></strong> MFC's "built-in functionality" that ATL doesn't provide?</p></li>
  </ul></li>
  <li><p>In general, this doesn't answer my question because <strong>it doesn't explain the downsides</strong> and the reasons behind them.</p></li>
  </ul></li>
  </ul>
  
  <p>because directly or indirectly, everything seems to link back to the previous page:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/821676/how-do-i-decide-whether-to-use-atl-mfc-win32-or-clr-for-a-new-c-project">How do I decide whether to use ATL, MFC, Win32 or CLR for a new C++ project?</a></p>
  
  <ul>
  <li><p><em>"ATL &amp; MFC are somewhat trickier to decide between.</em> [[No kidding!]] <em>I'd refer you to <a href="http://msdn.microsoft.com/en-us/library/bk8ytxz5%28VS.80%29.aspx" rel="noreferrer">MSDN's page</a> for choosing in order to decide between them."</em></p>
  
  <p><em>Obviously</em>, this doesn't answer my question. :)</p></li>
  </ul></li>
  <li><p><a href="http://www.codeguru.com/forum/archive/index.php/t-64778.html" rel="noreferrer">http://www.codeguru.com/forum/archive/index.php/t-64778.html</a></p></li>
  <li><p>etc.</p></li>
  </ul>
  
  <p>What I have <strong>currently observed</strong> (within the last couple of days, while trying to learn both):</p>
  
  <ul>
  <li>ATL is based on templates, or compile-time polymorphism.
  
  <ul>
  <li>ATL methods tend to be non-virtual, and tend to return references.</li>
  </ul></li>
  <li>MFC is based on virtual methods, or run-time polymorphism.
  
  <ul>
  <li>MFC methods tend to be virtual, and tend to return pointers.</li>
  </ul></li>
  </ul>
  
  <p>But there <em>doesn't seem to be any architectural difference between them</em>:</p>
  
  <ul>
  <li>Both use message maps (<code>BEGIN_MSG_MAP</code> vs. <code>BEGIN_MESSAGE_MAP</code>... big deal)</li>
  <li>Both wrap Win32 methods into classes</li>
  <li>Both seem to have similar classes <code>CWnd</code> vs. <code>CWindow</code></li>
  </ul>
  
  <p>But then, if there's no real difference except for the compile-time vs. run-time aspect, then why do both of them exist? Shouldn't one of them be enough?</p>
  
  <p>What am I missing here?</p>