Jump to content
  • Advertisement


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



This topic is 6292 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

Hi i have 2 questions. #1 = How do i go about drawing a line (that the user didn''t draw) in a multiple Document Inerface. please not that the moveto() lineto() does not work. #2 = My program has several drawing options (circle, line, sqaure, curve, text). how do I set the default one to be chosen? Thank you. ----------------------------- -------Mitch Mulholland------ ----A.K.A.= TwisteR---------- -----------------------------

Share this post

Link to post
Share on other sites

Well, I guess I need to ask where exactly you''re trying to draw stuff.

You see, the actual document is meant for data storage. It''s not really "allowed" to draw stuff, it doesn''t really have a device context that you''re free to use, really.

The thing you want to draw in is a view. You basically need to derive a class from CView, and create an instance of the view when you start up your app. Then you can override the WM_PAINT and various mouse messages for the view. In the OnDraw you can then do whatever line or primitive drawing you want.

There are some good resources on doing this sort of thing on Codeguru. For GDI info, go to:
I would also check out some of the sample apps in the miscellaneous section if you''re having problems figuring out how to implement this.


Share this post

Link to post
Share on other sites
What do you mean moveto lineto doesnt work?

As Felisandria mentioned, make sure that you are attempting to draw inside your CViews OnDraw method or as a response to a WM_PAINT message. Initiating drawing code at any random point will not necessarily work.

Also make sure that you are not drawing with the same color as the background of your window. lol. Obviously this will not produce a visible line...

But MoveTo LineTo works great for drawing lines as long as you are not trying to create a fast 3D wireframe engine using it. lol


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!