stdcall and __cdecl

V

vinu_gt

Hi All,

I had a question about stdcall and cdecl calling convention related to
Visual Studio 6.0

I have a console project and in Project->setting->C++->Code Generation
The "calling convention" is __cdecl.
1) Does this mean that function calls(meaning i call a function in my
program or a function in a dll)
in my program will assume that the called functions have been compiled
with __cdecl calling standard and as
such use __cdecl convention to call those functions.
Or
2) Does it mean that "by default" the functions in my program will be
constructed with __cdecl calling convention.

Does it work the same way on both windows and unix.

Could you also kindly direct me to some nice article which explains
this in detail.

Thanks
Vinu
 
J

John Carson

Hi All,

I had a question about stdcall and cdecl calling convention related to
Visual Studio 6.0

Any questions that look like they may be Microsoft specific (like this one)
are better asked in

microsoft.public.vc.language
I have a console project and in Project->setting->C++->Code Generation
The "calling convention" is __cdecl.
1) Does this mean that function calls(meaning i call a function in my
program or a function in a dll)
in my program will assume that the called functions have been compiled
with __cdecl calling standard and as
such use __cdecl convention to call those functions.
Or
2) Does it mean that "by default" the functions in my program will be
constructed with __cdecl calling convention.

It means that any function will be assumed to use the __cdecl convention
unless the function prototype indicates otherwise. Function declarations in
windows file header almost always *will* indicate otherwise, usually via
macros like CALLBACK or WINAPI.
Does it work the same way on both windows and unix.

Don't know.
Could you also kindly direct me to some nice article which explains
this in detail.

Type in stdcall or cdecl in your compiler help file and you should get some
hits. Or do likewise at

http://msdn.microsoft.com/library/default.asp
 
L

Larry I Smith

Hi All,

I had a question about stdcall and cdecl calling convention related to
Visual Studio 6.0

I have a console project and in Project->setting->C++->Code Generation
The "calling convention" is __cdecl.
1) Does this mean that function calls(meaning i call a function in my
program or a function in a dll)
in my program will assume that the called functions have been compiled
with __cdecl calling standard and as
such use __cdecl convention to call those functions.
Or
2) Does it mean that "by default" the functions in my program will be
constructed with __cdecl calling convention.

Does it work the same way on both windows and unix.

Could you also kindly direct me to some nice article which explains
this in detail.

Thanks
Vinu

http://msdn.microsoft.com/library/d...e_argument_passing_and_naming_conventions.asp

Note the differences under the "Stack cleanup" column.

Click the links (__cdecl, __stdcall, etc) for details of each.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top