title: extern "C" not working as expected
body: <p>I am trying to hook a Win32 API function. I am making a DLL from which I want to export the function, but I am already failing at the basics. My declaration is as follows:</p>
  
  <pre><code>extern "C" __declspec(dllexport) int WINAPI fnTest(void);
  </code></pre>
  
  <p>but the exported function name is not "fnTest" - as I would expect - but is "_fnTest@0". I can only make it work when declaring the functions calling convention to <code>__cdecl</code>, which results to an exported name of "fnTest", but since the Win32 calling conection is <code>WINAPI/__stdcall</code> this is not an option.</p>
  
  <p>I am using VS2010. Thanks in advance.</p>