如何声明一个__stdcall函数指针 [英] How to declare an __stdcall function pointer
本文介绍了如何声明一个__stdcall函数指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试过这个
typedef void(* __stdcall MessageHandler)(const Task *);
这会编译但给出此警告(VS2003):
我想声明一个指向stdcall调用约定的函数的指针?我做错了什么?
解决方案
由于 MSDN说,正确的写法是
typedef void(__stdcall * MessageHandler)(const Task *);
I tried this
typedef void (* __stdcall MessageHandler)(const Task*);
This compiles but gives me this warning (VS2003):
warning C4229: anachronism used : modifiers on data are ignored
I want to declare a pointer to a function with stdcall calling convention? What am I doing wrong?
解决方案
As MSDN says, the correct way to write this is
typedef void (__stdcall *MessageHandler)(const Task*);
这篇关于如何声明一个__stdcall函数指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文