Click here to Skip to main content
15,921,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Radio button creation mfc- how Pin
deeps_cute2-Mar-07 18:14
deeps_cute2-Mar-07 18:14 
GeneralRe: Radio button creation mfc- how Pin
Hamid_RT2-Mar-07 18:32
Hamid_RT2-Mar-07 18:32 
AnswerRe: Radio button creation mfc- how Pin
prasad_som2-Mar-07 19:03
prasad_som2-Mar-07 19:03 
QuestionFunction overloading and calling conventions Pin
sawerr2-Mar-07 12:14
sawerr2-Mar-07 12:14 
AnswerRe: Function overloading and calling conventions Pin
led mike2-Mar-07 12:58
led mike2-Mar-07 12:58 
AnswerRe: Function overloading and calling conventions Pin
Mark Salsbery2-Mar-07 13:01
Mark Salsbery2-Mar-07 13:01 
AnswerRe: Function overloading and calling conventions Pin
Michael Dunn2-Mar-07 14:07
sitebuilderMichael Dunn2-Mar-07 14:07 
GeneralRe: Function overloading and calling conventions Pin
sawerr2-Mar-07 19:45
sawerr2-Mar-07 19:45 
Thanks for all answers.
Micheal Dunn you told me:
"Function overloading is done by the compiler giving each overload different internal names. This is unrelated to calling conventions."
Yes i tried a piece of code
#include <iostream><br />
using namespace std;<br />
<br />
class CRectangle {<br />
    int x, y;<br />
  public:<br />
    void set_values (int,int);<br />
    int _stdcall area () {return (x*y);}<br />
	int _stdcall area (int x ) {cout << x; return 0;}<br />
};<br />
<br />
void CRectangle::set_values (int a, int b) {<br />
  x = a;<br />
  y = b;<br />
}<br />
<br />
int main () {<br />
  CRectangle rect;<br />
  rect.set_values (3,4);<br />
  cout << "area: " << rect.area();<br />
  rect.area(8);<br />
  return 0;<br />
}

It works. I tried both _stdcall and _cdecl there is no problem.
But i dont understand here. Why do they write:
"For C calling convention (__cdecl): Function name is decorated by prefixing it with an underscore character '_' .
For Standard calling convention (__stdcall): Function name is decorated by prepending an underscore character and appending a '@' character and the number of bytes of stack space required."
For cdecl Compiler generate function name for area():
?area@CRectangle@@QAAHXZ
?area@CRectangle@@QAAHH@Z

So function name decoration information is not true for member functions. Because function names both 2 area func must be "_area". Right?
If function overloading is done by compiler why is there a specification for calling conventions? Why is there an information about function name decoration? VC++ doesnt obey this rule.

Can you please explain here please.
Thanks for answers
GeneralRe: Function overloading and calling conventions Pin
Michael Dunn2-Mar-07 20:00
sitebuilderMichael Dunn2-Mar-07 20:00 
Questionimplementing a popup window Pin
Jim Crafton2-Mar-07 10:23
Jim Crafton2-Mar-07 10:23 
QuestionScreen capture a web browser Pin
llp00na2-Mar-07 7:47
llp00na2-Mar-07 7:47 
AnswerRe: Screen capture a web browser Pin
Mark Salsbery2-Mar-07 8:43
Mark Salsbery2-Mar-07 8:43 
GeneralRe: Screen capture a web browser Pin
llp00na2-Mar-07 9:07
llp00na2-Mar-07 9:07 
QuestionRe: Screen capture a web browser Pin
David Crow2-Mar-07 9:23
David Crow2-Mar-07 9:23 
AnswerRe: Screen capture a web browser Pin
llp00na2-Mar-07 10:00
llp00na2-Mar-07 10:00 
GeneralRe: Screen capture a web browser Pin
David Crow2-Mar-07 10:08
David Crow2-Mar-07 10:08 
GeneralRe: Screen capture a web browser Pin
llp00na4-Mar-07 4:11
llp00na4-Mar-07 4:11 
QuestionRe: Screen capture a web browser Pin
Mark Salsbery2-Mar-07 9:24
Mark Salsbery2-Mar-07 9:24 
AnswerRe: Screen capture a web browser Pin
llp00na2-Mar-07 10:05
llp00na2-Mar-07 10:05 
GeneralRe: Screen capture a web browser Pin
Mark Salsbery2-Mar-07 10:44
Mark Salsbery2-Mar-07 10:44 
GeneralRe: Screen capture a web browser Pin
llp00na4-Mar-07 4:14
llp00na4-Mar-07 4:14 
AnswerRe: Screen capture a web browser Pin
Mark Salsbery4-Mar-07 6:56
Mark Salsbery4-Mar-07 6:56 
GeneralRe: Screen capture a web browser Pin
llp00na4-Mar-07 8:57
llp00na4-Mar-07 8:57 
GeneralRe: Screen capture a web browser Pin
Mark Salsbery5-Mar-07 6:32
Mark Salsbery5-Mar-07 6:32 
GeneralRe: Screen capture a web browser Pin
llp00na4-Mar-07 9:09
llp00na4-Mar-07 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.