Solved

Code resue in VC++

Posted on 2002-03-04
3
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

688 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