timer - Is preceding a function with CALLBACK or WINAPI or PASCAL (in MFC) is absolutely necessary or only for readability purpose? -


in mfc vc++, settimer function setted using callback procedure. link read

a function marked __stdcall uses standard calling convention named because win32 api functions (except few take variable arguments) use it.

and that, have understand, vc++ mfc functions use __stdcall calling conversions.

and callback defined follows....

 #define callback __stdcall 

what have read: preceding function callback used emphasise particular function called automatically whenever necessary(like in settimer case or onclick case in javascript),

my doubt is , in mfc vc++ functions(except few take variable arguments) has default calling convention of __stdcall. hence either preceding or not preceding function callback or winapi or pascal has same effect?

is absolutely necessary computer? depends on context. when mismatch calling convention, either lucky because datatypes on stack happen match requirements of api, or fail miserably when code run on different architecture x64 , crashes every time.

is absolutely necessary maintenance programmer? yes, is. know, poor person have figure out non-standard conventions , clever "optimizations." day, poor person might you.

the compiler yelling @ reason when tried subvert api.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -