What does a “CALLBACK” declaration in C do?

后端 未结 4 1948
Happy的楠姐
Happy的楠姐 2020-12-01 18:47

I was looking through some code from the SDL library and came across a function declared like this:

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wPar         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 19:47

    It's a calling convention, and Delphi has them too. Try looking up 'cdecl' in the Delphi Help. In Delphi (or Object Pascal as we oldies like to call it) calling conventions come after the function declaration, like this;

    function MyFunction(X, Y: Real): Real; cdecl;
    

提交回复
热议问题