Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Beginning Visual C++ 6
|
BOOK: Beginning Visual C++ 6
This is the forum to discuss the Wrox book Beginning Visual C++ 6 by Ivor Horton; ISBN: 9780764543883
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C++ 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2005, 11:56 AM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 - Drawing does not show up on screen

I have copyright version 2003 of the Beginning Visual C++ book from Ivor Horton. I've completed chapter 14 and have a working application with menus and toolbars just as shown in the book. The next chapter, Chapter 15 continues this program and instructs one to enter the following 2 code segments to draw a rectangle and then to draw 2 arcs. Neither the rectangle nor the arcs are drawn. Anyone else having this problem? Is there a Windows API function call missing to instruct Windows to update the display?

Thanks in advance,
Dan

void CSketcherView::OnDraw(CDC* pDC)
{
    CSketcherDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);

    pDC->MoveTo(50, 50);
    pDC->LineTo(50, 200);
    pDC->LineTo(150, 200);
    pDC->LineTo(150, 50);
    pDC->LineTo(50, 50);
}

It then provides examples for drawing 2 arcs as follows:

void CSketcherView::OnDraw(CDC* pDC)
{
    CSketcherDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);

    pDC->Arc(50,50,150,150,100,50,150,100);

    // Define the bounding rectangle for the 2nd (smaller) circle
    CRect* pRect = new CRect(250,50,300,100);
    CPoint Start(275,100);
    CPoint End(250,75);
    pDC->Arc(pRect,Start,End);
    delete pRect;
}
 
Old January 3rd, 2005, 12:55 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Assure that the base class for the class CSketcherView is derived from CView and not CEditView!

 
Old June 19th, 2005, 05:48 PM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How did you solve this? It would help to see the entire SketcherView.cpp and SketcherView.h files. Did you include the <math.h> in the .cpp file. I can't remember if it is required there for the ARC().





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 15: WSAT doesn't show up RobRob BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 27th, 2008 06:42 AM
chapter 15 help kyledonmoyer BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 June 30th, 2007 08:06 AM
Chapter 15 rrlevron BOOK: Beginning ASP 3.0 0 November 17th, 2005 03:38 PM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 0 April 22nd, 2005 02:23 PM
Chapter 15!! studentinpain BOOK: Beginning ASP 3.0 16 March 12th, 2004 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.