title: C++/CLI Parametrized Thread Start problems
body: <p>I am writing a sample program with threading. I have a class called CamThread defined as follows in CamThread.h</p>
  
  <pre><code>public ref class CamThread{
  
  public:
      CamThread();
      void takeImages();
  
  private:
      Driver^ driver;
  };
  </code></pre>
  
  <p>CamThread.cpp file looks like: </p>
  
  <pre><code>using namespace System::Threading;
  
  CamThread::CamThread(){
  
  Driver^ newdriver;
  newdriver = (Driver^)gcnew ZylaDriver();
  newdriver-&gt;initCamera();
  
  Thread^ acquireThread = gcnew Thread(gcnew ParameterizedThreadStart(this,&amp;CamThread::takeImages));
  acquireThread-&gt;Start;
  };
  
  void CamThread::takeImages(){
  //Additional code.}
  </code></pre>
  
  <p>Main function is</p>
  
  <p>int main(int argc, char* argv[])
  {</p>
  
  <pre><code>CamThread^ cameraThread = gcnew CamThread();
  
  cout &lt;&lt; endl &lt;&lt; "Press enter to close" &lt;&lt; endl;
  cin.ignore();
  return 0;
  }
  </code></pre>
  
  <p>The problem I'm having is that in CamThread.cpp Visual  Studio 2013 has an issue with &amp;CamThread::takeImages in ParameterizedThreadStart. It is giving me "Error: Invalid delegate initializer -- function does not match the delegate type".</p>
  
  <p>It seems like I'm constructing the delegate &amp;CamThread::takeImages incorrectly, but many of the examples I've found seem to use a similar construction (e.g. <a href="https://msdn.microsoft.com/en-us/library/system.threading.parameterizedthreadstart%28v=vs.110%29.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/system.threading.parameterizedthreadstart%28v=vs.110%29.aspx</a>).</p>
  
  <p>I've been having trouble finding other good examples.</p>