title: How to properly call a thiscall function with this being an mfc control
body: <p>So i have an injected DLL and i'm trying to call a thiscall function with the following signature:</p>
  
  <pre><code>int __thiscall sub_76FDF3(CMFCTabCtrl *this, int, int)
  </code></pre>
  
  <p>From what i've read i can create a function pointer and call it directly, so i've created a typedef for the function:</p>
  
  <pre><code>#include &lt;afxtabctrl.h&gt;
  
  typedef int(__thiscall *TestFuncDef)(CMFCTabCtrl, int, int);
  TestFunc = (TestFuncDef)0x76FDF3;
  </code></pre>
  
  <p>Now i'm scratching my head wondering if i have to locate 'this' being the real tabctrl and then somehow cast it to a CMFCTabCtrl to be able to actually call the function passing my own int params?</p>
  
  <p>New to all this so i apologize if it's a daft question. Thanks.</p>