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: Ivor Horton's Beginning Visual C++ 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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 March 23rd, 2008, 07:54 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
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
  #2 (permalink)  
Old March 28th, 2008, 10:20 AM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


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
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



All times are GMT -4. The time now is 03:28 PM.


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