VC++ problem

Started by
2 comments, last by Zorak 18 years, 7 months ago
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.
Advertisement
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.

class CXyzDlg : public dialogclass{   CXyzApp * mApp;      int getAppVar ( void ) {     return mApp->getVariable();   }}
Domine non secundum peccata nostra facias nobis
i did the same thing but i am getting error of Access voilation (0X000000c).
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.
Domine non secundum peccata nostra facias nobis

This topic is closed to new replies.

Advertisement