Wrox Programmer Forums
|
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 June 20th, 2004, 01:49 PM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with chapter 16

hello, i'm french and i 'm learning programation with visual c++6 by ivor horton.

I have a problem in chapter 16.

here is the error i have in elements.cpp and elements.h

in compilation
Compiling...
Elements.cpp
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2143: syntax error : missing ';' before '<'
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2501: 'CList' : missing storage-class or type specifiers
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2059: syntax error : '<'
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2238: unexpected token(s) preceding ';'
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(13 5) : error C2065: 'm_PointList' : undeclared identifier
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(13 5) : error C2228: left of '.AddTail' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(13 6) : error C2228: left of '.AddTail' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(14 7) : error C2228: left of '.AddTail' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(17 2) : error C2228: left of '.GetHeadPosition' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(17 6) : error C2228: left of '.GetNext' must have class/struct/union type
E:\C++\Chapitre16\Exemple\Sketcher\Elements.cpp(18 0) : error C2228: left of '.GetNext' must have class/struct/union type
SketcherView.cpp
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2143: syntax error : missing ';' before '<'
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2501: 'CList' : missing storage-class or type specifiers
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2059: syntax error : '<'
e:\c++\chapitre16\exemple\sketcher\elements.h(82) : error C2238: unexpected token(s) preceding ';'
Generating Code...
Error executing cl.exe.

Sketcher.exe - 15 error(s), 0 warning(s)


and in files

elements.h

    CList<CPoint, const CPoint&> m_PointList; // Liste de points Type safe


elements.cpp

    m_PointList.AddTail(FirstPoint); // Ajoute le 1er point dans la liste
    m_PointList.AddTail(SecondPoint); // Ajoute le 2nd point dans la liste

    m_PointList.AddTail(Point); // Ajoute le point à la fin

    POSITION aPosition = m_PointList.GetHeadPosition();

    pDC->MoveTo(m_PointList.GetNext(aPosition));


    pDC->LineTo(m_PointList.GetNext(aPosition))





 
Old September 15th, 2004, 09:21 PM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Colleague:

I am not sure whether or not you found the problem yet.

I would like to say that the code in chapter 16 works fine, the main problem to us that are starting programming is that we make a lot of typing error. So I recommend you to check carefuly the code you typed in.

I got many error messages like the ones you are presenting here and I solved every one by checking and fixing the code I typed in according to the book text.

I hope this may help you to fix your problem.

Alex.


 
Old October 1st, 2004, 06:58 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

andarius40,
I am having the same errors. Iam trying a couple of solutions, will let you know if they work.

 
Old May 7th, 2006, 05:08 PM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello I have the same problem in chapetr 15.
Please let me know if someone come accross something.

 
Old May 7th, 2006, 05:31 PM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello All
Problem fixed:


Edit Element.h file as follows......

#pragma once
#include "afxtempl.h"

Add
#include "afxtempl.h"


 
Old September 24th, 2006, 04:11 PM
Registered User
 
Join Date: Nov 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's easy to mistake afxtempl.h and afxtem1.h (the second having a one (1.h) and the first having an L (l.h)). I made the mistake but caught it quickly. I wish I could say the same about the first time I tried setting up a linux box with a modem! It took me days to realize that ethl vs eth1 was my problem. l and 1 are dangerous.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 16 Fig 16-11 krsouthern BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 July 8th, 2008 12:11 PM
Chapter 16 yspider BOOK Beginning CSS: Cascading Style Sheets for Web Design, 2nd Ed; ISBN: 978-0-470-09697-0 1 June 19th, 2008 10:27 AM
Chapter 16 boyce0324 VB.NET 2002/2003 Basics 1 June 5th, 2007 01:59 AM
Problem with code from chapter 16 earlsinclair2001 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 December 5th, 2005 01:58 AM
Problem with book code of Chapter 16 legendofzelda2000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 6 July 13th, 2005 02:12 PM





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