why do this
Doing that simply creates an alias for __stdcall. Allowing you to write STDMETHODCALLTYPE or __stdcall in any place you would use __stdcall. If you have ever wrote a WinMain then you may of used "int WINAPI WinMain(...)", WINAPI is an alias to a calling convention defined in the same was as you have shown.
Basically it's just an alias and there are many reasons for using it. A few reasons could be: Giving it a more descriptive name, Keeping consistant naming in a library of some sort, Personal preference..
Basically it's just an alias and there are many reasons for using it. A few reasons could be: Giving it a more descriptive name, Keeping consistant naming in a library of some sort, Personal preference..
I think one of the primary reasons is that they can change the calling convention if they ever need to.
_stdcall has a well defined meaning (not sure if it's actually an ISO-C++ keyword tho?) thus they couldn't easily change it.
Conversely, if you have STDMETHODCALLTYPE and everyone uses it, they could change just the one #define and force a recompile and voila! all sorted. Examples of this might be an optimization (or debug) switch or maybe a platform switch (e.g. Win32->Win64)...
hth
Jack
_stdcall has a well defined meaning (not sure if it's actually an ISO-C++ keyword tho?) thus they couldn't easily change it.
Conversely, if you have STDMETHODCALLTYPE and everyone uses it, they could change just the one #define and force a recompile and voila! all sorted. Examples of this might be an optimization (or debug) switch or maybe a platform switch (e.g. Win32->Win64)...
hth
Jack
Quote:Original post by jollyjeffers
_stdcall has a well defined meaning (not sure if it's actually an ISO-C++ keyword tho?) thus they couldn't easily change it.
All identifiers starting with double underscores are vendor-specific extensions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement