Click here to Skip to main content
15,927,903 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detecting when running from the command line Pin
Parish6-Mar-02 20:22
Parish6-Mar-02 20:22 
GeneralFile names inside a folder.. Pin
Neha5-Mar-02 22:58
Neha5-Mar-02 22:58 
GeneralRe: File names inside a folder.. Pin
Nish Nishant5-Mar-02 23:18
sitebuilderNish Nishant5-Mar-02 23:18 
GeneralRe: File names inside a folder.. Pin
Mazdak6-Mar-02 0:29
Mazdak6-Mar-02 0:29 
GeneralSpinbutton and EN_CHANGE Pin
Arjan Schouten5-Mar-02 22:09
Arjan Schouten5-Mar-02 22:09 
GeneralCopy constructor ignored when passing by value to a function with unspecified number of arguments. Pin
Serge Krynine5-Mar-02 21:01
Serge Krynine5-Mar-02 21:01 
GeneralRe: Copy constructor ignored when passing by value to a function with unspecified number of arguments. Pin
Joaquín M López Muñoz5-Mar-02 21:38
Joaquín M López Muñoz5-Mar-02 21:38 
GeneralRe: Check this disassembly.... Pin
Atul Dharne6-Mar-02 0:04
Atul Dharne6-Mar-02 0:04 
Your copy constructor is not being called. The reason for this can be found in the partial disassembly of the line

mc1.Foo(2, mc1, mc2);
31:       mc1.Foo(2, mc1, mc2);
00401090   mov         eax,dword ptr [ebp-0Ch]  ---->points to mc2.b and loads it to eax
00401093   push        eax		   ----->push value to stack for function
00401094   mov         ecx,dword ptr [ebp-10h]  ---->points to mc2.a and loads it to eax
00401097   push        ecx		   ----->push value to stack for function
00401098   mov         edx,dword ptr [ebp-4]      ---->points to mc1.b and loads it to eax
0040109B   push        edx		   ----->push value to stack for function
0040109C   mov         eax,dword ptr [ebp-8]     ---->points to mc1.a and loads it to eax
0040109F   push        eax		  ----->push value to stack for function
004010A0   push        2		  ----->This is the first arg
004010A2   lea         ecx,[ebp-8]
004010A5   push        ecx
004010A6   call        @ILT+0(MyClass::Foo) (00401005)
004010AB   add         esp,18h


This seems to be compiler optimization if I am not mistaken. However if you write
MyClass mc2(mc1); then the value of mc2 members a & b are 0 i.e. your copy constructor is called.

Atul


Sonork 100.13714 netdiva
GeneralRe: Copy constructor ignored when passing by value to a function with unspecified number of arguments. Pin
Serge Krynine6-Mar-02 14:41
Serge Krynine6-Mar-02 14:41 
GeneralCalling member function from CALLBACK function Pin
5-Mar-02 20:46
suss5-Mar-02 20:46 
GeneralRe: Calling member function from CALLBACK function Pin
5-Mar-02 20:53
suss5-Mar-02 20:53 
GeneralRe: Calling member function from CALLBACK function Pin
Michael Dunn6-Mar-02 7:28
sitebuilderMichael Dunn6-Mar-02 7:28 
GeneralDraw something on the button Pin
Rickard Andersson205-Mar-02 20:44
Rickard Andersson205-Mar-02 20:44 
GeneralRe: Draw something on the button Pin
Christian Graus6-Mar-02 10:30
protectorChristian Graus6-Mar-02 10:30 
GeneralI want to Write CToolBar class from the scratch Pin
Abhishek Narula5-Mar-02 19:34
Abhishek Narula5-Mar-02 19:34 
GeneralRe: I want to Write CToolBar class from the scratch Pin
Christian Graus5-Mar-02 20:09
protectorChristian Graus5-Mar-02 20:09 
GeneralRe: I want to Write CToolBar class from the scratch Pin
Abhishek Narula5-Mar-02 20:33
Abhishek Narula5-Mar-02 20:33 
GeneralRe: I want to Write CToolBar class from the scratch Pin
Christian Graus5-Mar-02 20:31
protectorChristian Graus5-Mar-02 20:31 
GeneralRe: I want to Write CToolBar class from the scratch Pin
Abhishek Narula6-Mar-02 0:31
Abhishek Narula6-Mar-02 0:31 
GeneralGUI implementation Pin
Morozov Alexey5-Mar-02 17:51
Morozov Alexey5-Mar-02 17:51 
GeneralRe: GUI implementation Pin
Christian Graus5-Mar-02 18:56
protectorChristian Graus5-Mar-02 18:56 
GeneralRe: GUI implementation Pin
Morozov Alexey5-Mar-02 20:30
Morozov Alexey5-Mar-02 20:30 
GeneralRe: GUI implementation Pin
Christian Graus6-Mar-02 8:11
protectorChristian Graus6-Mar-02 8:11 
GeneralRe: GUI implementation Pin
Nish Nishant5-Mar-02 20:23
sitebuilderNish Nishant5-Mar-02 20:23 
GeneralRe: GUI implementation Pin
Christian Graus5-Mar-02 20:25
protectorChristian Graus5-Mar-02 20:25 

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.