Solved

Code resue in VC++

Posted on 2002-03-04
3
194 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now