A Simple VC++ 6.0 Starter Guide
A few beginner tips to keep in mind:
In order to successfully compile a program in Visual you must have a
workspace, project, & source file(this is your code) open
you should be using same workspace(notebook) for CS201
you should create a new project(folder) for each hw i.e. hw1, hw2, etc
you should create a new source file for each individual hw problem i.e.
problem1_2, problem1_3
as you learn to use Visual you may find other methods that you prefer,
however, for a beginner I suggest the following steps
To Open Visual:
1. click Start button/Programs/MicroSoft Visual Studio6.0/
MicroSoftVisualC++6.0
Creating a WorkSpace:
Note: you only need to do this ONE time for this class, however, you may
create other workspaces for other classes/projects or whatever.
- click File/New/Workspace tab
- change "Location" box to your personnel directory on the z:\ i.e. z:\mike
- fill in "workspace name" field, I suggest using CS201
- click OK
- workspace name should be listed on left side of screen
You have now created a workspace that is saved in your personnel directory.
The next time you want to use Visual C++ to write a program you will open this
same workspace instead of creating a new one each time.
Creating a Project:
Note: you should create a new project for each hw assignment, not for each hw
problem.
- workspace should be open
- click File/New/Project tab
- select "Add to current workspace", Location path should change to your
personnel directory where you saved your workspace
- fill in "Project Name" i.e. hw1
- select "Win32 Console Application" from list on left of box
- click OK
- click Finish
- click OK
- project "folder" should be listed under workspace on left
side
Creating a Source File from Scratch:
Note: you should create a new source file for each individual hw problem i.e.
chp1 problem 1.3
- click on + next to project name to expand project file listings
- you should see folder for Source, Header, & Resource
- click on Source to select the folder
- click File/New
- verify that "Location" is your personnel directory, should read something
like Z:\fsmdc\workspacename\projectname
- click on "C++ Source File" to highlight
- fill in "File Name", this is name of actual hw problem i.e. 1_3 for
problem 1.3
- click OK
- Source file now open w/ cursor blinking in text area
- Notice on left that Source Folder now contains the source file you just
created. click on + to see Source files
To Compile and Execute your source code file:
- click on Build/Compile or Ctrl+F7
- any errors will be reported in bottom window
- click on Build/Execute or Ctrl+F5 or ! button
- dos shell should pop open with results of program
To Save Output Results:
- in dos shell, click on upper left hand corner for drop down menu
- select Edit/Mark
- cursor now appears as blinking white box
- use mouse to drag and highlight text in program window
- hit enter key(this makes a copy of the highlighted area)
- hit any key again to close output window
- return to Source file in Visual which is still open
- go to bottom of Source file page
- click on Paste button or press Ctrl+V
- output should now be copied to source file(need to comment this out)
- To Print, click File/Print