title: C++ - Pointer to a class method
body: <p>I have to set up a pointer to a library function (<code>IHTMLDocument2::write</code>) which is a method of the class <code>IHTMLDocument2</code>. (for the curious: i have to hook that function with Detours)</p>
  
  <p>I can't do this directly, because of type mismatch, neither can I use a cast (<code>reinterpret_cast&lt;&gt;</code> which is the "right one" afaik doesn't work)</p>
  
  <p>Here's what I am doing:</p>
  
  <pre><code>HRESULT (WINAPI *Real_IHTMLDocument2_write)(SAFEARRAY *) = &amp;IHTMLDocument2::write
  </code></pre>
  
  <p>Thanks for your help!</p>