title: Can't access private class members inside of static method?
body: <p>I have the following setup:</p>
  <pre><code>//.h
  class Cell
  {
  private:
      POINT   mCellStartingPoint;
      int     mXoffset;
      int     mYoffset;
  public:
      static void DrawRowOfPixels(int yoff);
      Cell();
      ~Cell();
  };
  
  //.cpp
  void Cell::DrawRowOfPixels(int yoff)
  {
      HDC dc = GetDC(NULL);
      COLORREF red = 0xFF0000;
      for(int i = mCellStartingPoint.x; i &lt; mXoffset; i++)
      {
          SetPixel(dc, mCellStartingPoint.x + i, mCellStartingPoint + yoff, red);
      }
  }
  </code></pre>
  <p>However, when implementing the DrawRowOfPixels() method in the .cpp file, I get errors at all of the member variables of the Cell class. (i.e. mCellStartingpoint, mXoffset, and mYoffset)</p>
  <blockquote>
  <p>error C2228: left of '.x' must have class/struct/union</p>
  <p>error C2597: illegal reference to non-static member 'Cell::mXoffset'</p>
  <p>error C3867: 'Cell::mXoffset': function call missing argument list; use '&amp;Cell::mXoffset' to create a pointer to member</p>
  <p>error: A nonstatic member reference must be relative to a specific object</p>
  </blockquote>
  <p>I know I'm probably doing something really stupid, but what's going on here? Why can't I use my private member variables inside my static member function like I should be able to?</p>