简化后为
typedef BOOLEAN (* PFMIFSCALLBACK) (CALLBACKCOMMAND Command);
typedef  VOID (* PFORMATEX) (PFMIFSCALLBACK Callback);
BOOLEAN __stdcall FormatExCallback( CALLBACKCOMMAND Command)
{...};
PFORMATEX   FormatEx;
FormatEx(FormatExCallback);
这样编译不过去,提示:
error C2664: “void (PFMIFSCALLBACK)” : 不能将参数 1 从“overloaded-function”转换为“PFMIFSCALLBACK”如果把__stdcall去掉,编译可以过去,但是运行时出错:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

解决方案 »

  1.   

    typedef BOOLEAN ( __stdcall *PFN...)(...)
      

  2.   

    编译没有问题但是运行起来还是出现
    Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
      

  3.   

    BOOLEAN __stdcall FormatExCallback( CALLBACKCOMMAND Command)是成员函数?
    加static每一个函数声明均加上__stdcalltry
      

  4.   

    different calling convention.
    函数调用约定要一直