title: C++: Debug assertion failed, afx.inl line 122
body: <p>here is the description of the problem.</p>
  
  <p>I have the following class defined..</p>
  
  <pre><code>class classA {
  public:
    CString aString;
  };
  extern classA theApp;
  </code></pre>
  
  <p>in another class function, I do this </p>
  
  <pre><code>theApp.aString = "test string";
  </code></pre>
  
  <p>then I get the runtime error debug assertion failed, afx.inl line 122;
  please advise.</p>
  
  <p>I tried to do the allocation inside the class as well but it fails flagging the same runtime error.</p>
  
  <pre><code> class classA {
      public:
        CString aString;
        void set_string()
        {
            aString = "test string 2";
        }
      };
      extern classA theApp;
  
      //in another class function
  
      theApp.set_string();
  </code></pre>
  
  <p>visual c++ version: VC++ 6.0</p>