473,408 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How do I add a class

First excuse my ignorance, but I'm completely new to VS2005 development

I've created a new project and want to add an already written class stored
elsewhere on the computer to the project.

This class will be used by a number of projects.

The problem is, if I right-click on the Project File in the Solution
Explorer and add the class a copy of the class is placed in the projects
folder. Any changes to the original class do seem to be followed through.

If I Add it to the Solution, any changes are followed through here, but I
cannot see how to reference the class in my form.

Can anyone point me in the right direction

TIA

David McCallum
Nov 12 '06 #1
4 1508
David,

Have a look at the reference tabs in your IDE, they are in project and in
the solution explorere under the right mouseclick.

It depends very much if the class is a build Class Libarary or just added
code to your project, but basicely is it the answer above.

Cor

"David McCallum" <dm**********@THISblueyonder.co.ukschreef in bericht
news:fR********************@fe2.news.blueyonder.co .uk...
First excuse my ignorance, but I'm completely new to VS2005 development

I've created a new project and want to add an already written class stored
elsewhere on the computer to the project.

This class will be used by a number of projects.

The problem is, if I right-click on the Project File in the Solution
Explorer and add the class a copy of the class is placed in the projects
folder. Any changes to the original class do seem to be followed through.

If I Add it to the Solution, any changes are followed through here, but I
cannot see how to reference the class in my form.

Can anyone point me in the right direction

TIA

David McCallum

Nov 13 '06 #2
Cor,

I looked there, but cannot find my class. The only likely tab I see as
usable is the Browse tab, but it does not allow me to open a ".cs" file.

Do I need to do something to the file first?

David

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP04.phx.gbl...
David,

Have a look at the reference tabs in your IDE, they are in project and in
the solution explorere under the right mouseclick.

It depends very much if the class is a build Class Libarary or just added
code to your project, but basicely is it the answer above.

Cor

"David McCallum" <dm**********@THISblueyonder.co.ukschreef in bericht
news:fR********************@fe2.news.blueyonder.co .uk...
>First excuse my ignorance, but I'm completely new to VS2005 development

I've created a new project and want to add an already written class
stored elsewhere on the computer to the project.

This class will be used by a number of projects.

The problem is, if I right-click on the Project File in the Solution
Explorer and add the class a copy of the class is placed in the projects
folder. Any changes to the original class do seem to be followed through.

If I Add it to the Solution, any changes are followed through here, but I
cannot see how to reference the class in my form.

Can anyone point me in the right direction

TIA

David McCallum


Nov 13 '06 #3
David,

If it is a cs file than you can just use it in your project or use it in a
Class libary project that you add to your project. In that case you need the
project tab from the references.

Cor

"David McCallum" <dm**********@THISblueyonder.co.ukschreef in bericht
news:Zv********************@fe3.news.blueyonder.co .uk...
Cor,

I looked there, but cannot find my class. The only likely tab I see as
usable is the Browse tab, but it does not allow me to open a ".cs" file.

Do I need to do something to the file first?

David

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP04.phx.gbl...
>David,

Have a look at the reference tabs in your IDE, they are in project and in
the solution explorere under the right mouseclick.

It depends very much if the class is a build Class Libarary or just added
code to your project, but basicely is it the answer above.

Cor

"David McCallum" <dm**********@THISblueyonder.co.ukschreef in bericht
news:fR********************@fe2.news.blueyonder.c o.uk...
>>First excuse my ignorance, but I'm completely new to VS2005 development

I've created a new project and want to add an already written class
stored elsewhere on the computer to the project.

This class will be used by a number of projects.

The problem is, if I right-click on the Project File in the Solution
Explorer and add the class a copy of the class is placed in the projects
folder. Any changes to the original class do seem to be followed
through.

If I Add it to the Solution, any changes are followed through here, but
I cannot see how to reference the class in my form.

Can anyone point me in the right direction

TIA

David McCallum



Nov 13 '06 #4
David McCallum wrote:
I've created a new project and want to add an already written class stored
elsewhere on the computer to the project.
Is the class part of another project? If it is a ClassLibrary project,
you can add that project to your Solution and then reference it on the
Projects tab.
This class will be used by a number of projects.
The best method would be to create a ClassLibrary project, add that
class to the project and then add that project to any Solution that
needs to use it. Any changes you make in one Solution will be
reflected in any other Solution that uses that ClassLibrary.

Nov 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
18
by: John M. Gabriele | last post by:
I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
13
by: Bryan Parkoff | last post by:
I have created three classes according to my own design. First class is called CMain. It is the Top Class. Second class and third class are called CMemory and CMPU. They are the sub-classes....
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
8
by: Bryan Parkoff | last post by:
I find an interesting issue that one base class has only one copy for each derived class. It looks like that one base class will be copied into three base classes while derived class from base...
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.