"cannot access private member declared in class"
its probelm related to friend function and i m use only one firend funcation and its run in vS2003 but not in VS 2008
class CP;
friend BOOL CIP::SDP(BOOL bDStaee);
CP,CIP both are class name class and SDP is Method which we want as friend.
=====================================================
pise of code :
we want CP class mthod SDP is friend of CIP class.
// first file
class CPI : public CWnd
{
public :
friend BOOL CIP::SDP(BOOL bDraftPrintState);
// THis line show the error
}
//another file
class CPI;
class CIP: public CSDChildWnd
{
private:
BOOL SDP(BOOL bDraftPrintState);
}
BOOL CIP::SDP(BOOL bDraftPrintState)
{
//CPI::sm_bDraftPrintState = bDraftPrintState;
return TRUE;
}
ok you are right ,i think same
but this code is run in VS2003 so i put this Senario on forms
ok if u have any best Example for friend fun so let ke know.
i had read kanetkar Book its wirttern in both funcation declearation we need friend KEYWORD
its trate like a friend .