在看书的时候,看到'PASCAL'一词的出现,但是完全不理解它的用法~以前没接触过~
这本书是在这论坛上看到人家介绍的,<深入浅出MFC>,
希望有这本书的人,可以翻翻看,为我解释解释~~~诚谢啊!
Page 97
struct
{
...
CObject* (PASCAL* m_pfnCreateObject)();
...
}Page 116
CObject* pObject;
pObject = (*m_pfnCreateObject)();以前见过对'PASCAL'使用,所以请解释详细点~非常感谢!!!!!!
在此,代表菜鸟同志们,向答题者致敬!∠○
这本书是在这论坛上看到人家介绍的,<深入浅出MFC>,
希望有这本书的人,可以翻翻看,为我解释解释~~~诚谢啊!
Page 97
struct
{
...
CObject* (PASCAL* m_pfnCreateObject)();
...
}Page 116
CObject* pObject;
pObject = (*m_pfnCreateObject)();以前见过对'PASCAL'使用,所以请解释详细点~非常感谢!!!!!!
在此,代表菜鸟同志们,向答题者致敬!∠○
#define WINAPI __stdcall
是函数的一种编译约束或描述了,我说的不严密啊。
与之对应的还有一种 __cdecl 区别:
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.
This is the default calling convention for C and C++ programs. Because the stack is cleaned up by the caller, it can do vararg functions. The __cdecl calling convention creates larger executables than __stdcall, because it requires each function call to include stack cleanup code. The following list shows the implementation of this calling convention.
此外还有__cdecl、__thiscall、__fastcall。函数定义时指定用哪种规则来传递参数,如果没有指定则使用默认的规则。再强制转换函数指针要注意,传递参数的规则必须相同,其它情况可不必考虑。