StdCall pascal cdecl 区别:参数传入Stack的顺序有所不同
Directive Parameter order Clean-up Passes parameters in registers?
register Left-to-right Routine Yes
pascal Left-to-right Routine No
cdecl Right-to-left Caller No
stdcall Right-to-left Routine No
safecall Right-to-left Routine No
_stdcall将参数压栈是按C语言的顺序(从右到左),但与C 语言不同的是它是由被调用者将参数从栈中清除的,所以它的编译文件比_cdecl小。_stdcall是Windows API函数中默认的调用约定,VB、VFP等也采用这个约定。
_cdecl是C语言采用的默认调用方法,它的优点是支持printf这样的可变参数调用。
另外,VC++对于两种调用方法的名称转换方法也不同。
摘自互联网。
[此贴子已经被作者于2006-2-18 19:54:32编辑过]
|