title: stdcall name mangling using extern c and dllexport vs module definitions (msvc++)
body: <p>I was trying to export a simple test function for a dll to work with an application (fyi: mIRC) that specifies the calling convention as:</p>
  
  <pre><code>int __stdcall test_func(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
  </code></pre>
  
  <p>Now, to call this from the application, I'd be using <strong>test_func</strong> but I have noticed due to name mangling it is not as simple as I'd thought.</p>
  
  <p>Through similar topics here I have come to the understanding that using <strong>extern "C"</strong> in combination with <strong>__declspec(dllexport)</strong> is an equivelant (somewhat) method of removing mangling to module definitions (.def). However, when using the extern/dllexport method my function (as an example) is always <strong>_test_func@numbers</strong> whereas the .def removed all mangling as required for use with the application i needed to export to.</p>
  
  <p>Could someone please explain why this is? I'm just curious about the two methods. Thanks!</p>