Click here to Skip to main content
16,017,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can I disable Firewall Pin
Ali_quaidian31-May-05 21:42
Ali_quaidian31-May-05 21:42 
AnswerRe: How can I disable Firewall Pin
Christian Graus31-May-05 22:01
protectorChristian Graus31-May-05 22:01 
Generaltransfer data between dialog boxes Pin
abhi_code31-May-05 21:36
abhi_code31-May-05 21:36 
GeneralRe: transfer data between dialog boxes Pin
Cedric Moonen31-May-05 21:55
Cedric Moonen31-May-05 21:55 
GeneralRe: transfer data between dialog boxes Pin
abhi_code1-Jun-05 0:59
abhi_code1-Jun-05 0:59 
GeneralRe: transfer data between dialog boxes Pin
Christian Graus31-May-05 21:58
protectorChristian Graus31-May-05 21:58 
GeneralRe: transfer data between dialog boxes Pin
abhi_code1-Jun-05 1:02
abhi_code1-Jun-05 1:02 
GeneralAssignement operator Pin
Haakon S.31-May-05 21:17
Haakon S.31-May-05 21:17 
I have a little problem with the assignement operator and inheritance. How does this work:

class CBaseClass{
int m_intB;
const CBaseClass& operator=(const CBaseCase& b);
}

class CDerivedClass : public CBaseClass{
int m_intD;
const CDerivedClass& operator=(const CDerivedClass& d);
}

Both assignement operators are defined like this

const CBaseClass& CBaseClass::operator=(const CBaseClass& b){
m_intB=b.m_intB;
return *this;
}

Subsequently

CDerivedClass* a_obj=new CDerivedClass;
a_obj.m_intB=5;
a_obj.m_intD=6;

CDerivedClass* b_obj=new CDerivedClass;

If I do

*b_obj=*a_obj;

only the CBaseClass member is assigned.

Is it possible to make the assignement operator virtual?


Regards, Haakon S.





A sure cure for seasickness is to sit under a tree.
Spike Milligan

GeneralRe: Assignement operator Pin
Haakon S.31-May-05 21:20
Haakon S.31-May-05 21:20 
GeneralRe: Assignement operator Pin
PJ Arends31-May-05 21:50
professionalPJ Arends31-May-05 21:50 
GeneralRe: Assignement operator Pin
Haakon S.1-Jun-05 3:50
Haakon S.1-Jun-05 3:50 
GeneralRe: Assignement operator Pin
PJ Arends1-Jun-05 14:57
professionalPJ Arends1-Jun-05 14:57 
GeneralRe: Assignement operator Pin
Haakon S.1-Jun-05 20:54
Haakon S.1-Jun-05 20:54 
GeneralRe: Assignement operator Pin
Haakon S.2-Jun-05 0:00
Haakon S.2-Jun-05 0:00 
GeneralRe: Assignement operator Pin
S. Senthil Kumar31-May-05 23:12
S. Senthil Kumar31-May-05 23:12 
GeneralCadlib for creating dxf Pin
saqibsohail31-May-05 20:51
saqibsohail31-May-05 20:51 
GeneralManaged Form in Unmanaged Host Pin
Aamir Butt31-May-05 20:47
Aamir Butt31-May-05 20:47 
GeneralRe: Managed Form in Unmanaged Host Pin
Ryan Binns31-May-05 22:20
Ryan Binns31-May-05 22:20 
GeneralMaking setup file vc++ Pin
ningthemcha00731-May-05 20:19
ningthemcha00731-May-05 20:19 
GeneralRe: Making setup file vc++ Pin
ThatsAlok31-May-05 20:33
ThatsAlok31-May-05 20:33 
Generalpop up message Pin
ask_you31-May-05 17:44
ask_you31-May-05 17:44 
GeneralRe: pop up message Pin
Michael Dunn31-May-05 18:39
sitebuilderMichael Dunn31-May-05 18:39 
GeneralRe: pop up message Pin
ddmcr31-May-05 20:58
ddmcr31-May-05 20:58 
GeneralRe: pop up message Pin
Anonymous31-May-05 21:48
Anonymous31-May-05 21:48 
GeneralRe: pop up message Pin
PJ Arends31-May-05 22:11
professionalPJ Arends31-May-05 22:11 

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.