Solved

Code resue in VC++

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 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

20 Experts available now in Live!

Get 1:1 Help Now