Solved

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

Posted on 1998-11-15
1
266 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
ID: 1324743
CScrollView
you need to call PrepareDC(CDC* ) before using the DC.
but you need call this function in the OnDraw(...).

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Execute multiple curl cmds with sleep and send output to file 10 88
Not needed 13 92
Making an alias 7 77
Is there a simple front-end menu system. 9 69
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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