Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

default code in Visual C++ 2008 Express

Posted on 2008-11-01
10
Medium Priority
?
989 Views
Last Modified: 2013-12-16
Starting a new Console Application project in Visual C++ 2008 Express Edition creates the following code:
// boggs1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
      return 0;
}

How can I change this default?
0
Comment
Question by:highwray
[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
  • 6
  • 4
10 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858365
Silly question one my part - Why?
There is nothing that makes sense to remove from that code.  It is a safe default for you to build upon.
0
 

Author Comment

by:highwray
ID: 22858380
I am a very new begginner and I would like to have a default that agrees with the book I am learning from (SAMS Teach yourself C++ 2008 edition)
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858424
What you want is possible but I haven't ever tried it and it is probably a lot more work than you would care for.

Simplest is for you to make a copy of that default code in a txt file somewhere.
Once you make a new project just copy/paste the default you want over that made by the wizard.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:highwray
ID: 22858450
Thank you for your advice.  It is just frustrating to have to change it every time I start.  I also (apparently) need to add "char response;   cin >> response;" before the final "return 0;" so that it stops when I test the code I am learning.
I had hoped there was a file somewhere that contained this default code or perhaps an option somewhere to change it.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858463
Possible alternative - likely further in the book when you meet debugging tools/options.
In debug mode you could put a breakpoint on the 'return' line (Press the F9 key when the cursor is on that line).  The program will then halt at that line when being run from the debugger.  (Press F5 key when in the debugger to continue)
0
 

Author Comment

by:highwray
ID: 22858478
I see what you are getting at but I do not feel that that is the sort of solution I want.  All I hope to do is to edit the default code as necessary.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 2000 total points
ID: 22858508
OK, there is a way, I just don't know how.  (And it probably isn't so easy to do safely)
0
 

Author Comment

by:highwray
ID: 22858522
I do appreciate your help but I'm the sort of idiot that will spend hours to find an answer just for the fun, and satisfaction, of finding it.  I'll plod on and if I find a solution I'll let you know.  Having looked at your profile, though, I doubt that will be necessary.

Thanks again for you help (I've reached page 56 fairly easily so far.)
Regards
Michael
0
 

Accepted Solution

by:
highwray earned 0 total points
ID: 22858870
OK!  I've found it.  It is file root.cpp and on my laptop it is in folder "C:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz\Generic\Application\templates\1033\"


0
 

Author Comment

by:highwray
ID: 22859133
closed
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

660 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