title: Warning C4251 when building a DLL that exports a class containing an ATL::CString member
body: <p>I am converting an ATL-based static library to a DLL and am getting the following warning on any exported classes that use the ATL <code>CString</code> class (found in atlstr.h):</p>
  
  <blockquote>
    <p>warning C4251: 'Foo::str_' : class
    'ATL::CStringT'
    needs to have dll-interface to be used
    by clients of class 'Foo'</p>
  </blockquote>
  
  <p>I am correctly declaring the <code>Foo</code> class as exported via <code>__declspec(dllexport)</code>.  Is this a warning I can safely ignore or am I doing something wrong?  The DLL project settings are set to dynamically link with ATL, but this doesn't seem to make any difference.</p>
  
  <p>For example:</p>
  
  <pre><code>#ifdef DLLTEST_EXPORTS
  #define DLLTEST_API __declspec(dllexport)
  #else
  #define DLLTEST_API __declspec(dllimport)
  #endif
  
  // This class is exported from the DLLTest.dll
  class DLLTEST_API Foo
  {
  public:
   Foo();
   CString str_; // WARNING C4251 HERE
  };
  </code></pre>
  
  <p>All clients of this DLL will also be using ATL.</p>