Home > Back-end >  Consult the big brother a question: why stdcal agreed function name to become total byte] [_ functio
Consult the big brother a question: why stdcal agreed function name to become total byte] [_ functio

Time:10-14

 extern "C" _declspec (dllexport) double _stdcall add (double a, double b);//a derived function 


Then on the other side of the dynamic load the DLL
 GetProcAddress call (" _add @ 16 ") 


Function name is derived from the source of the add - & gt; _add @ 16

I searched for, it is the characteristics of the stdcall calling convention,
Want to ask: so why this call it agreed to this skill? What benefits can do (I believe that if there is no meaning, not redundant)?

Thank you,

CodePudding user response:

The
reply: refer to the original poster thousand dreams life
 extern "C" _declspec (dllexport) double _stdcall add (double a, double b);//a derived function 


Then on the other side of the dynamic load the DLL
 GetProcAddress call (" _add @ 16 ") 


Function name is derived from the source of the add - & gt; _add @ 16

I searched for, it is the characteristics of the stdcall calling convention,
Want to ask: so why this call it agreed to this skill? What benefits can do (I believe that if there is no meaning, not redundant)?

Thank you,

About by def file to specify the name of this, I through the search already know, but that doesn't solve my v. by this problem

CodePudding user response:

https://stackoverflow.com/questions/4550294/stdcall-name-mangling-using-extern-c-and-dllexport-vs-module-definitions-msvc

Has finally found a slightly on this statement:
In stdcall calling convention, the callee removes the parameters from the stack. To make that safe, the exported name contains the number of bytes that the callee will remove the from the stack.
Probably say the stdcall is the internal stack, so let's add @ number of this and to secure a bit, how safe? Who will to reference the @ number?

CodePudding user response:

In order to see the knowledge meaning, and nothing in particular,
Like you call thousand life dreams, I see will be a little familiar, but if you are a string of Numbers, I can never remember you,
Personal opinion,

In addition, the naming standards may not have regulation, not too clear,
  • Related