Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Beginning Visual C++ 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 3rd, 2005, 11:56 AM
Registered User
 
Join Date: Jan 2005
Location: , NJ, .
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;
}
  #2 (permalink)  
Old January 3rd, 2005, 12:55 PM
Registered User
 
Join Date: Jan 2005
Location: , NJ, .
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!

  #3 (permalink)  
Old June 19th, 2005, 05:48 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
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().
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:57 AM.


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