DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: luismasgoret
今日帖子: 40
在线用户: 7
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 lqlayy (lqlayy) ★☆☆☆☆ -
禁用账号
2003/12/11 13:57:38
标题:
被禁用帐号,仅在管理模式可见! 浏览:1604
加入我的收藏
楼主: ……
被禁用帐号,帖子内容自动屏蔽!
……

----------------------------------------------
发布广告,账号被禁用!
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2003/12/11 19:09:56
1楼: 看BORALND的帮助吧:
When you declare a procedure or function, you can specify a calling convention using one of the directives register, pascal, cdecl, stdcall, and 
safecall. For example,

function MyFunction(X, Y: Real): Real; cdecl;

 ...

Calling conventions determine the order in which parameters are passed to the routine. They also affect the removal of parameters from the stack, the use of registers for passing parameters, and error and exception handling. The default calling convention is register.

The register and pascal conventions pass parameters from left to right; that is, the leftmost parameter is evaluated and passed first and the rightmost parameter is evaluated and passed last. The cdecl, stdcall, and safecall conventions pass parameters from right to left.
  For all conventions except cdecl, the procedure or function removes parameters from the stack upon returning. With the cdecl convention, the caller removes parameters from the stack when the call returns.

The register convention uses up to three CPU registers to pass parameters, while the other conventions pass all parameters on the stack.
  The safecall convention implements exception 揻irewalls.?On Windows, this implements interprocess COM error notification.

The table below summarizes calling conventions.

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
The default register convention is the most efficient, since it usually avoids creation of a stack frame. (Access methods for published properties must use register.) The cdecl convention is useful when you call functions from shared libraries written in C or C++, while stdcall and safecall are recommended, in general, for calls to external code. On Windows, the operating system APIs are stdcall and safecall. Other operating systems generally use cdecl. (Note that stdcall is more efficient than cdecl.)

The safecall convention must be used for declaring dual-interface methods. The pascal convention is maintained for backward compatibility. For more information on calling conventions, see Program control.
The directives near, far, and export refer to calling conventions in 16-bit Windows programming. They have no effect in 32-bit applications and are maintained for backward compatibility only.
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 loubingtt (我的生活与你无关) ★☆☆☆☆ -
盒子活跃会员
2003/12/12 5:24:27
2楼: 函数(参数)的调用方式。
----------------------------------------------
按此在新窗口浏览图片
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS