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 June 20th, 2004, 01:49 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
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))





  #2 (permalink)  
Old September 15th, 2004, 09:21 PM
Registered User
 
Join Date: Sep 2004
Location: , , Brazil.
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.


  #3 (permalink)  
Old October 1st, 2004, 06:58 PM
Registered User
 
Join Date: Oct 2004
Location: Union, MI, USA.
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.

  #4 (permalink)  
Old May 7th, 2006, 05:08 PM
Registered User
 
Join Date: May 2006
Location: CHAPEL HILL, North Carolina, USA.
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.

  #5 (permalink)  
Old May 7th, 2006, 05:31 PM
Registered User
 
Join Date: May 2006
Location: CHAPEL HILL, North Carolina, USA.
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"


  #6 (permalink)  
Old September 24th, 2006, 04:11 PM
Registered User
 
Join Date: Nov 2005
Location: , , .
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.


 


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



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


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