Wrox Programmer Forums
|
BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3
This is the forum to discuss the Wrox book Beginning C# 3.0 : An Introduction to Object Oriented Programming by Jack Purdum; ISBN: 9780470261293
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 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 October 23rd, 2010, 05:17 PM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH10 - How to reference an existing class

I'm working on the second card game exercise - pg 263 and I'm getting a message that the type or namespace clsCardDeck could not be found. I know I have to reference it somehow. I tried adding a reference but couldn't find it then I tried adding using clsCardDeck; at the top of the code but nothing works and I've run out of steam and ideas. Any and all help appreciated...
 
Old October 30th, 2010, 09:10 AM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Class reference

Hi Tararak:

I'm assuming that you added the new class to the project in the standard manner. If not, you can use the Project->Add Exiting Item to add the class source code file to the project. Once you have done that, you can create an instance of the object using the syntax shown in the book, such as:

clsCardDeck myDeck = newclsCardDeck();


From that definition, you can use myDeck to reference the CardDeck object. See if that fixes your problem.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using class reference getting error rojiin ASP.NET 2.0 Basics 2 July 6th, 2007 01:53 PM
Reference to existing attribute value shumba XML 1 March 15th, 2006 02:53 PM
Passing a class by reference James Diamond VB How-To 13 February 16th, 2004 06:07 AM
Reference a class within ocx shahpragnesh_p Pro VB Databases 1 August 28th, 2003 08:31 AM





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