Jump to content
  • Advertisement
Sign in to follow this  

VC++ problem

This topic is 4638 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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();
}
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!