say i have this class with two pointers to objects of other classes as it's members
then i haveCode:class cLoginManager { public: cLoginManager(); ~cLoginManager(); cInformationWindow* InformationWindow; cLoginWindow* LoginWindow; };
andCode:class cInformationWindow { public: cInformationWindow(); ~cInformationWindow(); bool getVisible(){return m_Visible;}; bool m_Visible; };
Code:class cLoginWindow { public: cLoginWindow(); ~cLoginWindow(); void ControlClick(int id) { //here i want to be able to access the cInformationWindow's getVisible() }; };
I am not sure how i can access the the cInformationWindow's getVisible() function from inside cLoginWindow::ControlClick(int id)
I could do it by delcaring a pointer to the cWindowManager class and then extern the pointer at the top of the file holding the declaractions of the cLoginWindow class and then in the cLoginWindow::ControlClick(int id) access the getVisible() using the pointer.
Though i dont really want to do that as that requires the class to know of an object inorder to be useable.
So is there a way for the cLoginWindow, which is a member of cWindowManager to access the function of another member of cWindowManager?



LinkBack URL
About LinkBacks




thanks everyone