GUIDE FOR VISUAL C++ 6.0
A few tips for new VC++ users 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 one workspace(notebook) for all programs in a class
you should create a new project(folder) for each program, i.e. p1, p2, etc
you should create a new source file for each individual program, i.e. p1, p2, etc
as you learn to use Visual to create a workspace and project, you may
find other methods that you prefer.
However, the following steps are suggested for new users of VC++:
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, I'll explain why it is more convenient to have one workspace per class
- click File/New/Workspace tab
- change "Location" box to your personal directory on the c:\ i.e. c:\ASRA
- fill in "workspace name" field, I suggest using ASRA
- click OK
- workspace name should be listed on left side of screen
You have now created a workspace that is saved in your personal 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 program.
- workspace should be open
- click File/New/Project tab
- select "Add to current project", Location path should change to your personnel directory where you saved your workspace
- fill in "Project Name" i.e. program_1
- 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 program.
- 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 personal directory, should read something like Z:\ASRA\workspacename\projectname
- click on "C++ Source File" to highlight
- fill in "File Name", this is name of actual program, i.e. program_1.
- 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
"SPAWNING ERROR" FIX ON VISUAL 6.0
In order for MS Visual to work on all the computers in this lab, you must do the following: (if your not sure how to do this please ask the consultant on duty)
- Open MS Visual C++ 6.0
- Go to Tools/ Options/Directories tab
- Depending upon your account, you will be missing either the C: path or the D: path listed below. You need to add the missing path under "Show Directory for"
Include files:
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE AND
D:\Microsoft Visual Studio\VC98\INCLUDE
Executable files:
C:\Program Files\Microsoft Visual Studio\VC98\BIN AND
D:\Microsoft Visual Studio\VC98\BIN
Library files:
C:\Program Files\Microsoft Visual Studio\VC98\LIB AND
D:\Microsoft Visual Studio\VC98\LIB