title: How can I get my callback function to work?
body: <p>I'm getting monitor information using <code>EnumDisplayMonitors</code>:</p>
  
  <pre><code>BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData){
    Class::callback(hMonitor,hdcMonitor,lprcMonitor,dwData);
    return true;
  }
  
  bool Class::callback(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData){
    classVar.appendData("callback");
    return true;
  }
  
  bool Class::f(){
    ...
    EnumDisplayMonitors(NULL,NULL,MonitorEnumProc,NULL);
    ...
  }
  </code></pre>
  
  <p><code>Class::callback</code> is static (if it isn't I get error C2352: illegal call of non-static function). This however causes problems with <code>classVar</code>: error C2228: left of '.appendData must have class/struct/union'. What should I be doing here to get around this problem (I want the callback to write data to <code>classVar</code>)?</p>