title: Call AfxBeginThread with class member function?
body: <p>How can I call AfxBeginThread with an arbitrary non-static class method? Maybe there is something I can do with <a href="http://www.boost.org/doc/libs/release/libs/bind" rel="nofollow">boost bind</a>? Below is the expected usage from Microsoft (and is an example of calling a non-static method but it is hard-coded which method):</p>
  
  <pre><code>UINT MyThreadProc( LPVOID pParam )
  {
      CMyObject* pObject = (CMyObject*)pParam;
  
      if (pObject == NULL ||
          !pObject-&gt;IsKindOf(RUNTIME_CLASS(CMyObject)))
      return 1;   // if pObject is not valid
  
      // do something with 'pObject'
  
      return 0;   // thread completed successfully
  }
  
  // inside a different function in the program
  ...
  pNewObject = new CMyObject;
  AfxBeginThread(MyThreadProc, pNewObject);
  </code></pre>