C language > Beginner questions
Problem with external library
TimoVJL:
PellesC default calling convention is __cdecl for console and __stdcall for GUI program.
Pelle:
Console mode projects are intended for standard C and free of 'Windows clutter', so they default the C calling convention (cdecl). GUI mode project are by definition for Windows where the default calling convention is stdcall. Different project types will have different conventions, but there really isn't a good *common* convention...
( Generally speaking I personally think it's safer to include the calling convention in any form of 'interface' prototypes, maybe 'hidden' in a macro, rather than remember to use the same convention for all the projects. Just one thing less that *may* cause problems a year from now... )
CBSD:
Thanks for information Pelle and Timovjl!
Now I formulated the logic for myself! :)
1) Console projects are mostly for learning purposes and have cdecl calling convention. Being a *pure* (and newbie) C programmer, I can use functions with variable number of parameters for example!
2) *Real tough* GUI projects have stdcall convention because of Windows clutter. This tool used by experienced programmers.
3) Library is a tool for experienced developers not for beginners! ;D Hence it has *experienced* stdcall convention by default.
Now my restless mind has a rest. ;D
Navigation
[0] Message Index
[*] Previous page
Go to full version