Click here to Skip to main content
15,916,042 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create modeless CDialog ? Pin
Michael Dunn9-Sep-06 17:21
sitebuilderMichael Dunn9-Sep-06 17:21 
QuestionGet Object id from PhoneGetCallLogEntry Pin
bodaay9-Sep-06 6:11
bodaay9-Sep-06 6:11 
QuestionProblem with calcutation. Pin
EzraYap9-Sep-06 5:59
EzraYap9-Sep-06 5:59 
AnswerRe: Problem with calcutation. Pin
bodaay9-Sep-06 6:15
bodaay9-Sep-06 6:15 
GeneralRe: Problem with calcutation. Pin
EzraYap9-Sep-06 6:21
EzraYap9-Sep-06 6:21 
GeneralRe: Problem with calcutation. Pin
Rick York9-Sep-06 10:21
mveRick York9-Sep-06 10:21 
GeneralRe: Problem with calcutation. Pin
EzraYap10-Sep-06 2:31
EzraYap10-Sep-06 2:31 
Questionvirtual methods in base classes Pin
jon-809-Sep-06 5:34
professionaljon-809-Sep-06 5:34 
Shouldn't the compiler call the method in the base class when the method with the same name is not declared as virtual?

Is this specific to VS2003?

#include <iostream>
using namespace std;

class mammal
{
public:
void walk () {cout << "mammal walks" << endl;}
protected:
mammal (bool pFacialhair) {facialhair = pFacialhair;};
bool facialhair;
virtual void takesaleak () {cout << "mammal takes a leak" << endl;}
};
class dog : public mammal
{

private:
bool takingapiss;
public:
dog() : mammal(true)
{
facialhair = true;
};
int legs;
void walk () {cout << "dog walks" << endl;}
void takesaleak () {cout << "dog takes a leak" << endl;}
};


void main ()
{ dog Fido;

Fido.walk(); //Error: mammal walks Actually the output is: dog walks
Fido.takesaleak(); //dog takes a leak
//Fido.takingapiss; // not allowed because it is a protected method


}

Error!

Jon
AnswerRe: virtual methods in base classes Pin
Jun Du9-Sep-06 6:27
Jun Du9-Sep-06 6:27 
AnswerRe: virtual methods in base classes Pin
mostafa_pasha9-Sep-06 12:20
mostafa_pasha9-Sep-06 12:20 
GeneralRe: virtual methods in base classes Pin
Michael Dunn9-Sep-06 17:26
sitebuilderMichael Dunn9-Sep-06 17:26 
AnswerRe: virtual methods in base classes Pin
Michael Dunn9-Sep-06 17:25
sitebuilderMichael Dunn9-Sep-06 17:25 
GeneralRe: virtual methods in base classes Pin
prasad_som10-Sep-06 23:25
prasad_som10-Sep-06 23:25 
QuestionA single dialog box to show all the data from the device using serial port RS-232 Pin
Veeresh Hiremath9-Sep-06 5:21
Veeresh Hiremath9-Sep-06 5:21 
QuestionCan't Open File Pin
Max++9-Sep-06 3:49
Max++9-Sep-06 3:49 
AnswerRe: Can't Open File Pin
Chris Losinger9-Sep-06 4:04
professionalChris Losinger9-Sep-06 4:04 
AnswerRe: Can't Open File Pin
Hamid_RT9-Sep-06 4:50
Hamid_RT9-Sep-06 4:50 
Questionhow to retrieve color of sliders ticks Pin
CWiC9-Sep-06 2:18
CWiC9-Sep-06 2:18 
GeneralRe: how to retrieve color of sliders ticks Pin
prasad_som9-Sep-06 21:07
prasad_som9-Sep-06 21:07 
GeneralRe: how to retrieve color of sliders ticks Pin
CWiC11-Sep-06 6:55
CWiC11-Sep-06 6:55 
Questionany comments about a cache design? Pin
George_George9-Sep-06 2:18
George_George9-Sep-06 2:18 
Questioninheritance Pin
jon-809-Sep-06 0:45
professionaljon-809-Sep-06 0:45 
AnswerRe: inheritance [modified] Pin
ewighell9-Sep-06 0:59
ewighell9-Sep-06 0:59 
GeneralRe: inheritance Pin
toxcct9-Sep-06 2:19
toxcct9-Sep-06 2:19 
QuestionDesperately need your help. A weird problem about CString Pin
ewighell9-Sep-06 0:42
ewighell9-Sep-06 0:42 

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.