Click here to Skip to main content
15,905,144 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Playing a Avi file in dialog windows Pin
mt_samiei13-Oct-06 3:30
mt_samiei13-Oct-06 3:30 
GeneralRe: Playing a Avi file in dialog windows Pin
Hamid_RT13-Oct-06 3:30
Hamid_RT13-Oct-06 3:30 
AnswerRe: Playing a Avi file in dialog windows Pin
Hamid_RT13-Oct-06 3:30
Hamid_RT13-Oct-06 3:30 
QuestionPrivate inheritance Pin
sawerr13-Oct-06 3:06
sawerr13-Oct-06 3:06 
AnswerRe: Private inheritance Pin
Zac Howland13-Oct-06 4:10
Zac Howland13-Oct-06 4:10 
GeneralRe: Private inheritance Pin
sawerr13-Oct-06 4:27
sawerr13-Oct-06 4:27 
GeneralRe: Private inheritance Pin
Nemanja Trifunovic13-Oct-06 5:12
Nemanja Trifunovic13-Oct-06 5:12 
GeneralRe: Private inheritance Pin
Zac Howland13-Oct-06 5:28
Zac Howland13-Oct-06 5:28 
Nemanja Trifunovic wrote:
Not really. OP got it right, just used protected in his sample.


Check again (he copied the example from the C++ FAQ):

lass Wilma {
protected:
void fredCallsWilma()
{
std::cout << "Wilma::fredCallsWilma()\n";
wilmaCallsFred();
}
virtual void wilmaCallsFred() = 0; // A pure virtual function
};

class Fred : private Wilma {
public:
void barney()
{
std::cout << "Fred::barney()\n";
Wilma::fredCallsWilma(); //this can reach private function
}
protected:
virtual void wilmaCallsFred()
{
std::cout << "Fred::wilmaCallsFred()\n";
}
};

also
class D_prot : protected B {
public:
using B::f; // Note: Not using B::f(int,float)
}


For more information, check out this: http://www.gotw.ca/publications/mill06.htm[^]

And if you still don't believe me, try this:

#include <iostream>

using namespace std;

class Base
{
public:
        Base()          { cout << "Base::Base()" << endl; }
        virtual ~Base() { cout << "Base::~Base()" << endl; }

        void Print()    { cout << "Base::Print()" << endl; }
};

class Child : private Base
{
public:
        Child()         { cout << "Child::Child()" << endl; }
        virtual ~Child(){ cout << "Child::~Child()" << endl; }

        void MyPrint()
        {
                cout << "Child::MyPrint()" << endl;
                Print();        // call base class' print function
        }
};

int main()
{
        Child c;
        c.MyPrint();
        // the following line would produce an error if uncommented
//        c.Print();        // cannot access private memver of Child
}




If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: Private inheritance Pin
Nemanja Trifunovic13-Oct-06 7:09
Nemanja Trifunovic13-Oct-06 7:09 
GeneralRe: Private inheritance Pin
Zac Howland13-Oct-06 7:14
Zac Howland13-Oct-06 7:14 
AnswerRe: Private inheritance [modified] Pin
Nemanja Trifunovic13-Oct-06 5:08
Nemanja Trifunovic13-Oct-06 5:08 
QuestionAdding a Progress Bar Pin
Javagal Srinath13-Oct-06 2:51
Javagal Srinath13-Oct-06 2:51 
AnswerRe: Adding a Progress Bar Pin
Hamid_RT13-Oct-06 3:03
Hamid_RT13-Oct-06 3:03 
AnswerRe: Adding a Progress Bar Pin
Galatei13-Oct-06 3:03
Galatei13-Oct-06 3:03 
AnswerRe: Adding a Progress Bar Pin
Amish shah13-Oct-06 3:15
Amish shah13-Oct-06 3:15 
AnswerRe: Adding a Progress Bar Pin
David Crow13-Oct-06 3:49
David Crow13-Oct-06 3:49 
Questioncopying selected items Pin
radhika2813-Oct-06 2:34
radhika2813-Oct-06 2:34 
AnswerRe: copying selected items Pin
Galatei13-Oct-06 3:00
Galatei13-Oct-06 3:00 
GeneralRe: copying selected items Pin
Mark Salsbery13-Oct-06 6:29
Mark Salsbery13-Oct-06 6:29 
GeneralRe: copying selected items Pin
radhika2813-Oct-06 18:40
radhika2813-Oct-06 18:40 
GeneralRe: copying selected items Pin
Mark Salsbery14-Oct-06 7:18
Mark Salsbery14-Oct-06 7:18 
QuestionI want to open a notepad from my application without disappearing it. Pin
Pham duc an13-Oct-06 2:30
Pham duc an13-Oct-06 2:30 
AnswerRe: I want to open a notepad from my application without disappearing it. Pin
Galatei13-Oct-06 2:55
Galatei13-Oct-06 2:55 
QuestionRe: I want to open a notepad from my application without disappearing it. Pin
David Crow13-Oct-06 3:50
David Crow13-Oct-06 3:50 
QuestionUrgent :Regarding pointer to a pointer Pin
janadhana13-Oct-06 2:22
janadhana13-Oct-06 2:22 

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.