I have the same problem exposed here. I'm using Visual C++ Express 2010.
I tried declaring extern "C", and changing the options Project + Properties, Linker, Debugging, Generate Debug Info = No. My function names are mangled on every compilation.
After reading the answer of jjones I changed the calling convention from StdCall to Cdecl, and then my function names are correct in the compiled dll. But I need the StdCall because I'm using this dll from VB6 (Vb6 protests when using other calling convention). So, everytime I compile with StdCall calling convention, my function names get mangled again.
How can I avoid my function names from being mangled with StdCall calling convention? or Is there a way to call a function in a Dll with cdecl calling convention from VB6?