VC++ problem
i have created VC++ Dialog based application and i have added one member variable in my application class(CXyzApp) now i want to access this vairable through my Dialog class(CXyxDlg) how to do it. Any one.
Like you always do. Its no different from when you use classes in general. Just because its derived from a dialog class.
Either put a pointer to CXyzApp in your class or give it to your class when you construct it.
ie.
Either put a pointer to CXyzApp in your class or give it to your class when you construct it.
ie.
class CXyzDlg : public dialogclass{ CXyzApp * mApp; int getAppVar ( void ) { return mApp->getVariable(); }}
Quote:Original post by sunilsin
i did the same thing but i am getting error of Access voilation (0X000000c).
Then your pointer is not properly setup.
Most likely the pointer never get set before you call the function in the app class.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement