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
Solved

Code resue in VC++

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 clear a vector as well as how to detect empty vectors in C++.

791 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