title: How to override Qt member function with .dll injection
body: <p>I'm trying to provide a windows version of some code <a href="http://sourceforge.net/projects/openhmitester/" rel="nofollow">here</a> which is used to record Qt (4.7) events.  The target application is Qt based as is the code that does the injection, fwiw.  The linux version uses library preloading to override QWidget::x11event as a starting point to the recording code. </p>
  
  <p>I have tried to do the same, using winEvent as the appropriate equivalent to x11event. I am using dll injection which as far as I can tell is successful. The dll is listed in loaded modules in the debugger and the loading routines are all successful. </p>
  
  <p>However I am never seeing my winEvent being called. I have tried overriding other functions with the same result. </p>
  
  <p>I am new to dll creation, let alone injection, so may be missing an important step somewhere, but my suspicions are raised by compiler warnings when I build the .dll containing my winEvent implementation; I get "warning C4273: 'QWidget::winEvent' : inconsistent dll linkage". The dll compiles successfully though. At the moment I simply have </p>
  
  <pre><code>bool QWidget::winEvent ( MSG *message, long *result)
  {
   // my code
  }
  </code></pre>
  
  <p>in one of the cpp files in my .dll. Is this enough? </p>