|
-
March 12th, 2003, 06:53 AM
#1
difference between __cdecl and __stdcall
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?
Daniel Pu
-
March 12th, 2003, 01:25 PM
#2
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.
Last edited by dude_1967; March 12th, 2003 at 01:45 PM.
You're gonna go blind staring into that box all day.
-
March 12th, 2003, 05:14 PM
#3
There are solution designs that requires the use of __stdcall. One design is COM interface. Another design is Win32 callback function.
Kuphryn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|