Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vc++
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Vc++
Divers
Thread ID:
00166468
Message ID:
00168859
Vues:
21
Nope. From MSDN, Glossary P:
"Pascal calling convention
A calling convention that pushes arguments onto the stack in the order in which they appear in the function call (from left to right). The Pascal calling convention requires that the called routine remove arguments from the stack."

From Glossary C:
"C calling convention
The C standard for calling a function — that is, pushing arguments onto the stack from right to left (in reverse order from the way they appear in the argument list). After the function returns, the calling function removes the arguments from the stack. The C calling convention permits a variable number of arguments to be passed."

From MSDN, __stdcall:
"The __stdcall calling convention is used to call Win32 API functions. The callee cleans the stack, so the compiler makes vararg functions __cdecl. Functions that use this calling convention require a function prototype. The following list shows the implementation of this calling convention.

Argument-passing order Right to left.
Stack-maintenance responsibility Called function pops its own arguments from the stack."

So, __stdcall passes params as the C calling convention, but the stack is cleaned by the called function as in the Pascal calling convention.

Or is the info in MSDN wrong?

Vlad

>It's all terminology. _stdcall *is* PASCAL calling convention. It
>refers to the way things get pushed onto the stack. C goes left to
>to right, while Pascal goes right to left (fixed and I may have
>those backwards - can't remember my stack semantics). C is more flexible
>with variable parameter lists while Pascal convention is faster,
>which is why the WinAPI uses it...
>
>_stdcall/PASCAL same thing - different time frame <s>...
>
>+++ Rick ---
>
>
>>Well, it's what you get when declare a function as "extern "C"". :) Or, this is what I wanted to say.
>>
>>Actually, the WinAPI calling convention is WINAPI (macro that resolves to __stdcall), which is neither pascal nor c calling conventions. :)
>>
>>PASCAL and __pascal are not supported anymore and they are defined as macros that resolve to __stdcall in Win32.
>>
>>Vlad
>>
>>>actually it's not C style,
>>>but PASCAL style <s>, which is the WinAPI stack format.
>>>
>>>+++ Rick ---
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform