How to declare an __stdcall function pointer

Armen Tsirunyan picture Armen Tsirunyan · Mar 14, 2011 · Viewed 18.1k times · Source

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?

Answer

Jon picture Jon · Mar 14, 2011

As MSDN says, the correct way to write this is

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