C函数回调如何工作? [重复]

时间:2022-07-18 16:47:38

This question already has an answer here:

这个问题在这里已有答案:

I'm a bit confused with this definition in an example provided by microsoft using TAPI in Windows Mobile 5.0. What does CALLBACK do in this case? What is the purpose of it?

在Windows Mobile 5.0中使用TAPI的microsoft提供的示例中,我对此定义有点困惑。在这种情况下,CALLBACK做了什么?它的目的是什么?

BOOL CALLBACK DialingProc (HWND, UINT, WPARAM, LPARAM);

BOOL CALLBACK DialingProc(HWND,UINT,WPARAM,LPARAM);

The implementation looks the same BOOL and CALLBACK.

该实现看起来与BOOL和CALLBACK相同。

BOOL CALLBACK DialingProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
   //Some code here...
}

I've been following http://c.learncodethehardway.org/book/ which is great but haven't really seen anything in regards to this... Also did a couple searches but no luck- maybe i don't know what i'm searching for here?

我一直在关注http://c.learncodethehardway.org/book/这很棒但是没有真正看到任何关于这个...也做了几次搜索但没有运气 - 也许我不知道是什么我在这里寻找?

1 个解决方案

#1


2  

CALLBACK is #defined as __stdcall stdcall is a calling convention that determines how arguments are passed. WinAPI uses this very often. See What does "CALLBACK" in a Windows API function declaration mean?

CALLBACK是#defined,因为__stdcall stdcall是一个调用约定,用于确定参数的传递方式。 WinAPI经常使用它。请参阅Windows API函数声明中的“CALLBACK”是什么意思?

#1


2  

CALLBACK is #defined as __stdcall stdcall is a calling convention that determines how arguments are passed. WinAPI uses this very often. See What does "CALLBACK" in a Windows API function declaration mean?

CALLBACK是#defined,因为__stdcall stdcall是一个调用约定,用于确定参数的传递方式。 WinAPI经常使用它。请参阅Windows API函数声明中的“CALLBACK”是什么意思?