__stdcall的含义和用法是什么? [英] What is the meaning and usage of __stdcall?

查看:961
本文介绍了__stdcall的含义和用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到 _stdcall 在我看来,msdn不能很清楚地解释这是什么意思,
何时以及为什么应该使用它,如果有的话。



如果有人会提供解释,最好是一个例子,或2。



感谢

$ b / b

解决方案

C / C ++中的所有函数都有一个特定的调用约定。调用约定的目的是确定如何在调用者和被调用者之间传递数据,谁负责诸如清除调用堆栈的操作。



Windows上最受欢迎的调用约定是




  • stdcall

  • cdecl

  • clrcall

  • fastcall

  • thiscall



将此说明符添加到函数声明中基本上告诉编译器,您希望此特定函数具有此特定调用约定。



调用约定在这里记录





Raymond Chen还从这里开始了一系列关于各种调用约定的历史(5部分) p>


I come across _stdcall a lot these days.
And in my opinion msdn doesn't explain very clearly what it really means,
when and why should it be used, if at all.

I would appreciate if someone would provide an explanation, preferably, with an example, or 2.

Thanks

解决方案

All functions in C/C++ have a particular calling convention. The point of a calling convention is to establish how data is passed between the caller and callee and who is responsible for operations such as cleaning out the call stack.

The most popular calling conventions on windows are

  • stdcall
  • cdecl
  • clrcall
  • fastcall
  • thiscall

Adding this specifier to the function declaration essentially tells the compiler that you want this particular function to have this particular calling convention.

The calling conventions are documented here

Raymond Chen also did a long series on the history of the various calling conventions (5 parts) starting here.

这篇关于__stdcall的含义和用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆