title: Windows has triggered a breakpoint
body: <p>I'm experiencing a problem while trying to use functions exported from my DLL.</p>
  <p>I'm getting a message which states (sorry, but I couldn't upload an image):</p>
  <blockquote>
  <p>Windows has triggered a breakpoint in LibTester.exe.</p>
  <p>This may be due to a corruption of the heap, which indicates a bug in LibTester.exe or any
  of the DLLs it has loaded.</p>
  <p>This may also be due to the user pressing F12 while LibTester.exe has focus.</p>
  <p>The output window may have more diagnostic information.</p>
  </blockquote>
  <p>I have a Vector class, with overloaded assignment operator and some constructors:</p>
  <pre><code>Vector::Vector() : X(0.0f), Y(0.0f), Z(0.0f) { }
  Vector::Vector(const Vector&amp; vector) : X(vector.X), Y(vector.Y), Z(vector.Z) { }
  Vector::Vector(float x, float y, float z) : X(x), Y(y), Z(z) { }
  .
  .
  .
  Vector&amp; Vector::operator=(const Vector&amp; rhs)
  {
      this-&gt;X = rhs.X;
      this-&gt;Y = rhs.Y;
      this-&gt;Z = rhs.Z;
  
      return *this;
  }
  </code></pre>
  <p>The problem only occurs when i'm attempting to assign an existing vector to a new vector
  generated by the constructor:</p>
  <pre><code>Vector v1 = Vector();                  //Works
  Vector v2 = Vector(1.0f, 1.0f, 1.0f);  //Works
  v1 = v2;                               //Works
  v1 = Vector();                         //Fails
  v1 = Vector(1.0f, 1.0f, 1.0f);         //Fails
  </code></pre>
  <p>In case this is relevant, the Vector <em>struct</em> is derived from the <em>class</em> IPrintable:</p>
  <pre><code>class IPrintable
  {
  public: 
      ~IPrintable() 
      {
          if (this-&gt;m_pStr != NULL)
              delete[] this-&gt;m_pStr;
      }
  
      virtual char* ToString() = 0;   
  
  protected:
      char* m_pStr;
  };
  </code></pre>
  <p>Any one has a clue as to what could cause this behavior?</p>