Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to change VC++ Default Console Project?

Posted on 2002-06-24
10
Medium Priority
?
336 Views
Last Modified: 2010-04-01
I often make small Win32 Console Projects, for test purposes.
I want to change the way VC++ creates the Hello World! application.

How can I change it so that when the project is created, it has addtional #include's, and a getch() function call before {return 0}?
0
Comment
Question by:CuriousGeorge916
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7103394
What do you mean by the "Hello World!" application?
0
 
LVL 3

Expert Comment

by:Crius
ID: 7104214
In the MSDN help files is a topic "Creating Custom AppWizards" that is likely what you are looking for.

Unfortunately, numerous attempts to get to msdn.microsoft.com is failing, so I can't provide you with a link to the online MSDN library entry yet. :(

Anyway, here's some information on the page:

Creating Custom AppWizards
Home |  Overviews |  How Do I |  Details | Sample

Feature Only in Professional and Enterprise Editions   Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, seeVisual C++ Editions.

Using the standard MFC AppWizard as a reference, you can create Custom AppWizards that will create programs appropriate for your work environment. The topics listed below describe what custom AppWizards are, when they are useful, and how you create them.



From here, you get a link to more information, one of which is "Understanding Custom AppWizards" where there is a paragraph:


Possibilities for custom AppWizards:

Create a custom AppWizard that is based on the code and resources in an existing project.


Modify code in the standard MFC AppWizard templates.


Add one or more steps to the standard MFC AppWizard’s steps.


Create a custom set of steps.

0
 

Author Comment

by:CuriousGeorge916
ID: 7109188
>>What do you mean by the "Hello World!" application?
I'm talking about the application that is created when you create a Win32 Console Application via VC++ 6.0.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:CuriousGeorge916
ID: 7109193
>>In the MSDN help files is a topic "Creating Custom
>>AppWizards" that is likely what you are looking for.

Thanks Crius, but that's not what I'm looking for.
0
 
LVL 3

Expert Comment

by:Crius
ID: 7109207
Hmm, then I am not understanding your question. It is stated right in the documentation I pulled out (and displayed above):

*Possibilities for custom AppWizards: *

Create a custom AppWizard that is based on the code and resources in an existing project.


*Modify code in the standard MFC AppWizard templates.*


and Hello World! is a standard MFC AppWizard template, no?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7109321
You cannot change what you get when you aske for a 'Hello World' application from the AppWizard.  But you CAAN create your own Custom AppWizard that will do what you want.  It is actually quite easy... you make a project just the way you want it, then you tell the CustomAppWizard Wizard to use that as a template.  

WHen you are finished, your new Wizard will be listed right ther wher it says MFC Appwizard (Exe) and Win32 Concole App, etc.

It is covered in great detail in MDSN or you can also look at it on the Internet -- a useful place to find information!  See: http://search.microsoft.com/gomsuri.asp?n=1&c=rp_Results&siteid=us/dev&target=http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_understanding_custom_appwizards.asp

-- Dan
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7109325
In my above post, I forgot to add..

     "Just as Crius has said"

So I am posting this additional comment to atone for that mistake!

-- Dan
0
 

Author Comment

by:CuriousGeorge916
ID: 7109868
I'm sorry, but I'm not looking for an AppWizard method.

>>You cannot change what you get when you aske for >>a 'Hello World' application from the AppWizard.
I'm sure there has to be some back door method.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 800 total points
ID: 7110026
Well CuriousGeorge916,
That is really a less than optimal attitude since it is very easy to define a custom appwizard (I just did one in under 30 seconds.  In fact I did two in under 10 seconds).  And it does EXACTLY what you say you want to do.

HOWEVER, there is a kludgy way to hack the standard Console AppWizard.
1) In the IDE, Select File/Open
2) Navigate to
    C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin

3) Click the file named CONWZ.AWX
4) At the bottom of the dialog, select Open As: 'Binary'
5) click OK.  It opens in a hex editor.

Now Press Ctrl+F and type this in:

    Defines the entry point for the console application

It will highlight the start of the text that is included in the Xxxx.cpp file.  You can start hacking away.  But you will notice that the AWX file contains not just plain text, but special commands like
   $$IF(MFC)
becasue this template is used for all of the various types of console apps that it generates.

I'm sure that you will be able to puzzle out what can and cannot be modified safely.  And I know that you will remember to backup the original file before you begin hacking.  I have great respect for you as a programmer and a person.

-- Dan
0
 

Author Comment

by:CuriousGeorge916
ID: 7110468
Ok Dan,
That's the information that I was looking for.

Thanks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

604 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