Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2005
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2005 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 March 23rd, 2008, 07:54 PM
Registered User
 
Join Date: Mar 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH 14 Pages 749-753 Compile Errors

All,

Hi. My issues starts on page 749, Coding the OnMouseMove() Handler and ends on 753, Dealing With WM_LBUTTONUP Messages. When I compile, I get 9 errors:

4 say that m_Color and m_Element are undeclared identifiers. These errors are in the function header for GetElementType() and GetElementColor() in the SketcherView.h file. Both these function header are in the Operations section under public as the book says to do.

// Operations

public:
    unsigned int GetElementType()
    {return m_Element;}
    COLORREF GetElementColor()
    {return m_Color;}


The others say that GetElementType() and GetElementColor() are not members of the CSkethcherDoc.

// Now Select the Element Using the Type Stored in the Document

    switch(pDoc->GetElementType())
    {
    case RECTANGLE:
        return new CRectangle(m_FirstPoint, m_SecondPoint, pDoc->GetElementColor());

    case CIRCLE:
        return new CCircle(m_FirstPoint, m_SecondPoint, pDoc->GetElementColor());

    case CURVE:
        return new CCurve(pDoc->GetElementColor());

    case LINE:
        return new CLine(m_FirstPoint, m_SecondPoint, pDoc->GetElementColor());

    default:
        AfxMessageBox(_T("Bad Element Code"), MB_OK);
        AfxAbort();

    return NULL;
    }

Hopefully, I have not done something stupid. Any help would be appreciated. Thanks in advance.

Razzy
 
Old March 28th, 2008, 10:20 AM
Registered User
 
Join Date: Mar 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I put the function definitions in the wrong class! DOH!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile Errors TadPad BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8 1 March 4th, 2011 08:07 AM
Ch 5 - Errors in all *Rss.aspx pages ewelling BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 September 6th, 2006 09:16 AM
Chap 14 Errors russconnor BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 July 4th, 2006 07:11 AM
ch.14 file errors caseyc BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 10 February 28th, 2006 03:59 PM
Errors in Code; Chapter 14, pages 566-567 ou812 BOOK: Beginning ASP 3.0 10 June 20th, 2004 09:43 AM





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