Solved

Code resue in VC++

Posted on 2002-03-04
3
213 Views
Last Modified: 2010-04-01
There is a set of classes and some functions that I use for most of my projects, and I'm trying to find an easy method to add them to a new project.

Other then the Custom AppWizard, does VC have any type tools for code reuse?

Is there a way to create a project template for VC++ other then the Custom AppWizard?

I'll raise the points up to 300, if I can get some type of working method.
0
Comment
Question by:MakeItWork614
3 Comments
 
LVL 8

Expert Comment

by:mnashadka
ID: 6840650
I think that probably your best bet is to create a static library.  Just add a new Win32 Static Library (under File/New).  Then add your files into this project.  After that, you can link the library into your projects (under the Link project tab or just adding the .lib file to your project).  You will still need to provide the header files though, however you can make one header file that include all of the others and add the directory with that header file to your list of standard include directories (under Tools/Options/Directories).  Hope this helps.
0
 

Author Comment

by:MakeItWork614
ID: 6840771
mnashadka,
Thanks for the info, but I don't like using libraries, and I'm really looking for something like a VC++ AddIn.
0
 
LVL 30

Accepted Solution

by:
Axter earned 300 total points
ID: 6841211
Instead of using an AddIn, you can use the Gallary function that VC++ has built into it.

To add an item to the Gallary, click the ClassView tab, and then RIGHT click the class you want added to your Gallary.
Then select [Add To Gallary]

The next time you need to use the class on another project, and all you have to do is go to the main menu and click on:
Project->[Add To Project]->[Components and Controls]

You can then select the item from teh Gallary to add to your current project.

I believe this adds Resources as well as the *.h and *.cpp files.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question