Jump to content
  • Advertisement
Sign in to follow this  
Ninkazu

MFC MDI question

This topic is 4997 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'm writing a map editor and already have the view structure set up, but I want all the data to be handled by the document structure. How do I pass the document data to the view so the map can be rendered as well as serialized through the document? My code so far: http://www.venosoft.com/uploads/njedit.zip I know it isn't much, but I don't want to get so deep that it's impossible to change.

Share this post


Link to post
Share on other sites
Advertisement
Well, when your CMyView::OnDraw(CDC * pDC) function gets called, you can just do CMyDocument * Document = GetDocument();. IIRC the MFC app wizard generates this for you, something like this:

void CMyView::OnDraw(CDC* pDC)
{
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

}

Then you just draw whatever from the data in pDoc to pDC.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!