title: Create new thread in class (windows)
body: <p>I want to create a new thread in a class. The problem is when I need to pass a pointer to the function that will be used in the new thread. I am unable to pass a pointer to the function. A class function under the hood is basically this right?</p>
  
  <pre><code>void foo (this);
  </code></pre>
  
  <p>Then why does this code refuse to compile?</p>
  
  <pre><code>class TimeClass
  {
  private:
      DWORD   dwThreadId;
      HANDLE  hThread;
  
      LPTHREAD_START_ROUTINE Timer ();
  public:
      TimeClass ();
  };
  
  TimeClass::TimeClass ()
  {
      dwThreadId = CreateThread (NULL, 0, Timer, this, 0, &amp;dwThreadId);
  }
  </code></pre>