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 January 1st, 2008, 05:57 AM
Authorized User
 
Join Date: Oct 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 911

On page 911 he says: "Note that the variable VERSION_NUMBER is used exclusively by the IMPLEMENT_SERIAL() macros in the shape classes, so you could delete it from the OurConstants.h file used in the Sketcher program".

However, when I do delete it, it doesn't compile, because it's used in Elements.cpp:

// Elements.cpp : implementation file
//

#include "stdafx.h"

#include "Elements.h"
#include <math.h>
#include "OurConstants.h"

IMPLEMENT_SERIAL(CElement, CObject, VERSION_NUMBER)
IMPLEMENT_SERIAL(CLine, CElement, VERSION_NUMBER)
IMPLEMENT_SERIAL(CRectangle, CElement, VERSION_NUMBER)
IMPLEMENT_SERIAL(CCircle, CElement, VERSION_NUMBER)
IMPLEMENT_SERIAL(CCurve, CElement, VERSION_NUMBER)
IMPLEMENT_SERIAL(CText, CElement, VERSION_NUMBER)

...

So what gives?

Dan Crossley
__________________
Dan Crossley
 
Old January 22nd, 2008, 05:50 PM
Authorized User
 
Join Date: Feb 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dan,

You've probably worked this out by now, but I thought I'd post a few words just in case.

It's been a while since I worked through the sketcher program, but reading that paragraph on page 911 it seems that in the initial creation of the .dll project Ivor's telling you to create a copy of the 'Our Constants.h' file to reside in the .dll project. Once you've done that you'll have one copy of the header file in the .dll project and a duplicate (for the time being) in the Sketcher project.

I think what Ivor is saying is that since the VERSION_NUMBER constant is only used in the IMPLEMENT_SERIAL macro, which itself is only used in the .dll, you can remove the VERSION_NUMBER declaration in the original 'Our Constants.h' file in the Sketcher project. As you've found, you can't delete it from the header file in the .dll project because it's still needed there. But in the Sketcher project it's no longer required.

Hope that helps.

Dan

 
Old January 24th, 2008, 12:14 PM
Authorized User
 
Join Date: Oct 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dan6,

Thanks for clearing that up.

Dan Crossley





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to prevent a web page/window page from copying pradeeppatnaik81 C# 2 April 9th, 2008 03:36 AM
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM
How to create HTML page from a dynamic ASP page musharaf Classic ASP Professional 2 March 18th, 2004 09:31 PM





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