title: How can I use a member function pointer in libcurl
body: <p>I am using libcurl I have my downloading of files inside of a class, to which I want to see a progress function. I notice I can set a typical function pointer by</p>
  
  <pre><code>curl_easy_setopt(mCurl, CURLOPT_PROGRESSFUNCTION, progress_func3);
  </code></pre>
  
  <p>However, I would like to set it to a function pointer to my class. I can get the code to compile with</p>
  
  <pre><code>curl_easy_setopt(mCurl, CURLOPT_PROGRESSFUNCTION, &amp;MyClass::progress_func3);
  </code></pre>
  
  <p>and the <code>progress_func3</code> function will get called. The problem is, as soon as it returns there will be a "Buffer overrun detected!" error through, saying the program can not safely continue and execute, and must be terminated. (It is a Microsoft Visual C++ Runtime Library error window, I am using Visual Studio 2010).</p>
  
  <p>When I use a function, there is no problem, but when I use a member function pointer, I will get this error. How can I use a member function pointer in libcurl?</p>