Click to See Complete Forum and Search --> : difference between __cdecl and __stdcall
Daniel Pu
March 12th, 2003, 05:53 AM
I read a book which said that the function have the __cdecl will pop all arguments from the stack before returning, but the __stdcall will pop them after returning.
But I want to ask how this difference effects the function's performance. What time I should use __cdecl and what to use
____stdcall?
dude_1967
March 12th, 2003, 12:25 PM
Daniel,
I do not think that it would be wise to use either of them. It should not be necessary to use such qualifiers. These qualifiers might be specific to certain development environments and they are not elements of the standard C or C++ languages. Sometimes for mixed language projects, it can be useful to have such qualifiers governing the calling convention.
The function performance will be most strongly governed by the quality of the written code as well as the quality of the optimizing compiler. Some developers use the "inline" keyword when trying to get the maximum run-time performance from compilers. Although a construct in C++, "inline" is often supported by C-compilers as well.
Sincerely, Chris.
:)
kuphryn
March 12th, 2003, 04:14 PM
There are solution designs that requires the use of __stdcall. One design is COM interface. Another design is Win32 callback function.
Kuphryn
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.