Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Starting programs when windows logs Pin
toxcct26-Jan-04 8:53
toxcct26-Jan-04 8:53 
GeneralRe: Starting programs when windows logs Pin
l a u r e n26-Jan-04 9:39
l a u r e n26-Jan-04 9:39 
GeneralRe: Starting programs when windows logs Pin
David Crow26-Jan-04 10:52
David Crow26-Jan-04 10:52 
GeneralRefreshing windows systray Pin
haritadala26-Jan-04 7:58
haritadala26-Jan-04 7:58 
GeneralRe: Refreshing windows systray Pin
SJolly27-Jan-04 0:26
SJolly27-Jan-04 0:26 
GeneralRe: Refreshing windows systray Pin
haritadala27-Jan-04 3:56
haritadala27-Jan-04 3:56 
GeneralC++ operator question Pin
Ed K26-Jan-04 7:55
Ed K26-Jan-04 7:55 
GeneralRe: C++ operator question Pin
toxcct26-Jan-04 8:30
toxcct26-Jan-04 8:30 
that's quite simple.

you can create a pointer or a reference to the base class. Then, that variable will point to/reference not only the base class objects, but also the subclasses objects. for example :

CBaseClass {
     <font style="color:blue;">int</font> m_iField;
 <font style="color:blue;">public</font>:
     CBaseClass();
     ~CBaseClass();
     CBaseClass <font style="color:blue;">operator</font>=(CBaseClass& ref);
};
CSubClass : CBaseClass {
 <font style="color:blue;">public</font>:
     CSubClass();
     ~CSubClass();
     CSubClass& <font style="color:blue;">operator</font>=(CSubClass& ref);
};

<font style="color:blue;">void</font> main (<font style="color:blue;">void</font>) {
     CSubClass  CSObj1, CSObj2;
     CBaseClass& refCBObj = CSObj1; <font style="color:green;">// Allowed because CSubClass is derived from CBaseClass</font>

     refCBOb2 = CSObj2; <font style="color:green;">// CBaseClass::Operator=()
}</font>


if you would a function of the SubClass with the Same name in the both classes to be used instead of the BaseClass, you must define the BaseClass function as virtual :

CBaseClass {
 <font style="color:blue;">public</font>:
     CBaseClass();
     <font style="color:blue;">virtual</font> ~CBaseClass(); <font style="color:green;">// Will call The SubClass Destructor</font>
     CBaseClass <font style="color:blue;">operator</font>=(CBaseClass& ref);
};




TOXCCT
GeneralRe: C++ operator question Pin
J. Eric Vaughan26-Jan-04 8:44
J. Eric Vaughan26-Jan-04 8:44 
GeneralRe: C++ operator question Pin
Jörgen Sigvardsson26-Jan-04 9:02
Jörgen Sigvardsson26-Jan-04 9:02 
GeneralRe: C++ operator question Pin
J. Eric Vaughan26-Jan-04 9:35
J. Eric Vaughan26-Jan-04 9:35 
GeneralRe: C++ operator question Pin
Ed K26-Jan-04 12:07
Ed K26-Jan-04 12:07 
GeneralRe: C++ operator question Pin
Jörgen Sigvardsson26-Jan-04 12:46
Jörgen Sigvardsson26-Jan-04 12:46 
GeneralRe: C++ operator question Pin
toxcct27-Jan-04 2:08
toxcct27-Jan-04 2:08 
GeneralRe: C++ operator question Pin
Roger Wright26-Jan-04 12:38
professionalRoger Wright26-Jan-04 12:38 
GeneralRe: C++ operator question Pin
Jörgen Sigvardsson26-Jan-04 12:47
Jörgen Sigvardsson26-Jan-04 12:47 
GeneralRe: C++ operator question Pin
Roger Wright26-Jan-04 13:21
professionalRoger Wright26-Jan-04 13:21 
GeneralRe: C++ operator question Pin
Jörgen Sigvardsson26-Jan-04 9:01
Jörgen Sigvardsson26-Jan-04 9:01 
GeneralMFC Extension Dlls - loading screws up the resource chain... Pin
Nick Nougat26-Jan-04 7:29
Nick Nougat26-Jan-04 7:29 
GeneralRe: MFC Extension Dlls - loading screws up the resource chain... Pin
Blake Miller26-Jan-04 8:42
Blake Miller26-Jan-04 8:42 
GeneralRe: MFC Extension Dlls - loading screws up the resource chain... Pin
Nick Nougat27-Jan-04 5:01
Nick Nougat27-Jan-04 5:01 
GeneralProblem with displaying icon in system tray after re-login thru as a part of service Pin
helptochirag26-Jan-04 7:21
susshelptochirag26-Jan-04 7:21 
GeneralRe: Problem with displaying icon in system tray after re-login thru as a part of service Pin
Nick Nougat26-Jan-04 7:37
Nick Nougat26-Jan-04 7:37 
GeneralRe: Problem with displaying icon in system tray after re-login thru as a part of service Pin
helptochirag26-Jan-04 8:24
susshelptochirag26-Jan-04 8:24 
GeneralRe: Problem with displaying icon in system tray after re-login thru as a part of service Pin
helptochirag26-Jan-04 8:25
susshelptochirag26-Jan-04 8: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.