Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


MDI drawing problems

This topic is 6200 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 am using Microsoft Visual C++ 6.0 and have made a MDI and I want to display a line on the screen.....I have tried several ways and the all have failed..They compile fine, but, no line...........Please try to help me!!! I will give you examples of what i tried = C_____View::Draw(CDC* pDC) { .......compiler givin code here.......... pDC->MoveTo(100,200); pDC->LineTo(200,200); .......here to............ } BOOL C____Doc::OnNewDocument() { ..compiler givin code.... CLine *pLine = new CLine(CPoint(100,200), CPoint(200,200)); m_oaLines.Add(pLine); return TRUE; } Those are just two.. i have tried many more!!!!! Please help!!!!!!!!!!!!!!! ----------------------------- -------Mitch Mulholland------ ----A.K.A.= TwisteR---------- ----------------------------- Edited by - felisandria on July 31, 2001 11:41:24 AM

Share this post

Link to post
Share on other sites
First off you really should get an MFC book and learn how to make the compiler do all the work for you. You''re going about it all wrong. You''re supposed to work with the IDE, not just try to do it from scratch

That being said: CDocument doesn''t draw stuff. It has nowhere to do so, it has no device context.

I''m assuming your C___View is derived from CView. You need to message map (MFC''s expected message map, between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP) ON_WM_PAINT() and use OnDraw as your function rather than just Draw. Your C__View also has to be template defined to be the original view template for the document, or explicitly created as a frame/view pair.

Final point: stop yelling and use a title that makes sense.


Share this post

Link to post
Share on other sites

  • 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!