Solved

drawing a line works in CView, but not in CScrollView, why?

Posted on 1998-11-15
1
265 Views
Last Modified: 2013-11-20
While trying something out, I wrote a small program that drew a line from one point to another point, using CView's OnDraw fn.  The code was basically this:

pDC->SelectStockObject(BLACK_PEN);
pDC->MoveTo(10, 10);
pDC->LineTo(100, 100);


This worked, and drew a diagonal line with no problem.
When I then tried to do the same thing, but using a CScrollView, I couldn't get it to do anything.

Any help?
Charles
0
Comment
Question by:lock5000
1 Comment
 
LVL 2

Accepted Solution

by:
wyy_cq earned 50 total points
Comment Utility
CScrollView
you need to call PrepareDC(CDC* ) before using the DC.
but you need call this function in the OnDraw(...).

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now