title: Build .DLL using MFC in a Static Library. C++
body: <p>I am upgrading some Windows applications (Legacy Code) from VC 6 to VS2010. The program I am currently upgrading uses a .dll and I would like to build it with MFC in a static library. 
  When I set the "Use of MFC" option to "Use MFC in a Static Library" and the "Runtime Library" to /MT I get the following errors:</p>
  
  <pre><code>    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdllx.h(56): error    C2039: 'm_pFactoryInit' : is not a member of 'AFX_MODULE_STATE'
  
      c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdllx.h(55): error C2039: 'm_pClassInit' : is not a member of 'AFX_MODULE_STATE'
  </code></pre>
  
  <p>If I add _AFXDLL to the Preprocessor definitions, it solves the error but then I am asked to "Please use the /MD switch for _AFXDLL builds".</p>
  
  <p>My Question: Is there a way to build my program, which is dependent on this .dll, using MFC in a static library?</p>
  
  <p>Hope that makes some kind of sense, thanks in advance. </p>