Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

c++ - How to declare an __stdcall function pointer

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As MSDN says, the correct way to write this is

typedef void (__stdcall *MessageHandler)(const Task*);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...