extern "C"
{
__declspec(dllexport) LRESULT CALLBACK MTest
}
Using depends , I found there is still name mangling even using extern "C"
.
The only way to get truly undecorated names with __declspec(dllexport) is to export them with the __cdecl calling convention. CALLBACK becomes __stdcall, which decorates the "C" form of the name with a leading _ and trailing @bytes.
Otherwise you can use a .DEF file, which is a pain. Another MSVC specific way is to embed a /EXPORT directive into the object file (or pass it as a explicit linker setting)
#pragma comment(linker, "/EXPORT:ExportSymbol=DecoratedName");
For some reason the =
part of the directive is not listed in the help
That's name decoration rather than mangling. You should declare the undecorated name in a DEF file and then you'll get the behaviour you are seeking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With