The information in this article applies to:
SUMMARY
Visual C++,32-bit Edition, supports three calling conventions: C
(_cdecl), standard (_stdcall), and fastcall (_fastcall). The compiler does not support the Pascal calling convention (_pascal) provided by Microsoft compilers for MS-DOS and 16-bit Windows.
Note 1: The _stdcall calling convention decorates each function name by prepending an underscore character (as the _cdecl convention does) and appending an at sign "@" and the decimal representation of the number of bytes of stack space required. Each argument is widened to a multiple of four bytes. Note 2: The _fastcall calling convention decorates each function name by prepending an at sign "@" and appending an at sign and the decimal representation of the number of bytes of stack space required. Each argument is widened to a multiple of four bytes. Note 3: The first two function arguments that require four or fewer bytes are placed into registers. The caller pushes the remainder of the parameters onto the stack from right to left. This behavior may change in future versions. The default calling convention is _cdecl. If an application declares a function that accepts a variable number of arguments with the _fastcall or _stdcall calling convention, the compiler uses the _cdecl calling convention for that function. MORE INFORMATIONThe following code examples illustrate the code generated in the calling function and in the called function to support the C calling convention:
The following code example illustrates the code generated in the
calling function and in the called function to support the standard
calling convention:
The following code example illustrates the code generated in the
calling function and in the called function to support the fastcall
calling convention:
REFERENCESAdditional query words:
Keywords : kbCompiler kbVC600 |
Last Reviewed: June 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |