C
chandra sekhar
Hi All,
I have problem regarding the friend class.
I have a library where the class are declration is follows ( only
example )
class Frame
{
public:
protected:
void printFramemsg()
{
cout << " test... " << endl;
}
private:
// by making this we can access the protected members in the view
friend class View;
};
class View
{
public:
void setFrame(Frame* aFrame)
{
myFrame = aFrame;
}
void print()
{
myFrame->printFramemsg();
}
protected:
Frame* myFrame;
};
Now I want to derive the View class and access the protected and private
members of the Frame class..
class myView : public View
{
public:
void print_1()
{
myFrame->printFramemsg();
}
private:
};
Is any workarround or other way to do this .. ( Here I do not want to
derive a class from Frame ... )
Bye
Chandra
I have problem regarding the friend class.
I have a library where the class are declration is follows ( only
example )
class Frame
{
public:
protected:
void printFramemsg()
{
cout << " test... " << endl;
}
private:
// by making this we can access the protected members in the view
friend class View;
};
class View
{
public:
void setFrame(Frame* aFrame)
{
myFrame = aFrame;
}
void print()
{
myFrame->printFramemsg();
}
protected:
Frame* myFrame;
};
Now I want to derive the View class and access the protected and private
members of the Frame class..
class myView : public View
{
public:
void print_1()
{
myFrame->printFramemsg();
}
private:
};
Is any workarround or other way to do this .. ( Here I do not want to
derive a class from Frame ... )
Bye
Chandra