title: Building MFC Automation example (to access Excel using OLE automation). Can't compile
body: <p>I'm trying to build the example described at <a href="http://support.microsoft.com/kb/178749/EN-US/" rel="nofollow noreferrer">http://support.microsoft.com/kb/178749/EN-US/</a>  in order to build an application that programatically accesses Excel using Automation.  I have Visual C++ 2005/Visual Studio 2005.  Some of the instructions don't exactly match up (classwizard, mostly), but the general idea seems to be the same.</p>
  
  <p>Problems: I don't end up with an excel.h file after using the "new class" to create my wrapper classes.  So I can' t #include that file as it specifies in step 13.  I do get a excel.tlh and an excel.tli in my windebug directory, but that doesn't seem to work.  I tried all orders for </p>
  
  <pre><code>#include "stdafx.h"
  #include "debug/excel.tli"
  #include "debug/excel.tlh"
  </code></pre>
  
  <p>... including leaving one of those files out of the compile, but I still end up with a ton of compile errors.</p>
  
  <p>Here's the top 5 compile errors with the above #includes:</p>
  
  <pre><code>1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(16) : error C3861: 'get_Parent': identifier not found
  </code></pre>
  
  <p>Here's the top 5 errors with these includes:</p>
  
  <pre><code>#include "stdafx.h"
  #include "debug/excel.tlh"
  
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(550) : error C3121: cannot change GUID for class 'IFilter'
  1&gt;        c:\program files\microsoft sdks\windows\v6.0\include\comdef.h(483) : see declaration of 'IFilter'
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C2923: '_com_IIID' : 'Rectangle' is not a valid template type argument for parameter '_Interface'
  1&gt;        c:\program files\microsoft sdks\windows\v6.0\include\wingdi.h(3667) : see declaration of 'Rectangle'
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tlh(1541) : error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type
  </code></pre>
  
  <p>Here's the top 5 errors with these includes:</p>
  
  <pre><code>#include "stdafx.h"
  #include "debug/excel.tli"
  
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2653: 'Adjustments' : is not a class or namespace name
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2146: syntax error : missing ';' before identifier 'GetParent'
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C2433: 'IDispatchPtr' : 'inline' not permitted on data declarations
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  1&gt;c:\users\sniles\documents\visual studio 2005\source10\testole\testole\debug\excel.tli(14) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  </code></pre>
  
  <p>Thanks in advance.</p>