Why Visual C++ generates other function name, but I use extern "C"
-
Who know, why Visual C++ generates other function name, but I use extern "C" I use Visual C++ 2003 and try to export function from DLL. I declare function: extern "C" __declspec(dllexport) char* __stdcall GetUserFromAdir(HWND ParentWindow); When I view DLL by TDUMP (TDUMP is a utility from Borland Delphi), I see, my function GetUserFromAdir has other name (_GetUserFromAdir@4) How shall I solve this problem?
-
Who know, why Visual C++ generates other function name, but I use extern "C" I use Visual C++ 2003 and try to export function from DLL. I declare function: extern "C" __declspec(dllexport) char* __stdcall GetUserFromAdir(HWND ParentWindow); When I view DLL by TDUMP (TDUMP is a utility from Borland Delphi), I see, my function GetUserFromAdir has other name (_GetUserFromAdir@4) How shall I solve this problem?
Gasanov wrote: How shall I solve this problem? What problem? The "@4" indicates the size of the parameters (in bytes). Had your function used
void
, you would see "@0" instead. I think if you use the__stdcall
calling convention, it will decorate the name. Use the .def file like Blake suggests to undecorate the name.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Gasanov wrote: How shall I solve this problem? What problem? The "@4" indicates the size of the parameters (in bytes). Had your function used
void
, you would see "@0" instead. I think if you use the__stdcall
calling convention, it will decorate the name. Use the .def file like Blake suggests to undecorate the name.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
I think he expects the completely undecorated name, so that GetProcAddress can work. I usually do not add the 'dllexport' part and put the undecorated name into a DEF file. Always works for me.
-
I think he expects the completely undecorated name, so that GetProcAddress can work. I usually do not add the 'dllexport' part and put the undecorated name into a DEF file. Always works for me.
Thank's. When I exported, by using .DEF file, it work