GUIDE FOR VISUAL C++ 6.0

A few tips for new VC++ users to keep in mind:

  1. In order to successfully compile a program in Visual you must have a workspace, project, & source file(this is your code) open
  2. you should be using one workspace(notebook) for all programs in a class
  3. you should create a new project(folder) for each program, i.e. p1, p2, etc
  4. you should create a new source file for each individual program, i.e. p1, p2, etc
  5. 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

  1. click File/New/Workspace tab
  2. change "Location" box to your personal directory on the c:\ i.e. c:\ASRA
  3. fill in "workspace name" field, I suggest using ASRA
  4. click OK
  5. 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.

  1. workspace should be open
  2. click File/New/Project tab
  3. select "Add to current project", Location path should change to your personnel directory where you saved your workspace
  4. fill in "Project Name" i.e. program_1
  5. select "Win32 Console Application" from list on left of box
  6. click OK
  7. click Finish
  8. click OK
  9. 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.

  1. click on + next to project name to expand project file listings
  2. you should see folder for Source, Header, & Resource
  3. click on Source to select the folder
  4. click File/New
  5. verify that "Location" is your personal directory, should read something like Z:\ASRA\workspacename\projectname
  6. click on "C++ Source File" to highlight
  7. fill in "File Name", this is name of actual program, i.e. program_1.
  8. click OK
  9. Source file now open w/ cursor blinking in text area
  10. 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:

  1. click on Build/Compile or Ctrl+F7
  2. any errors will be reported in bottom window
  3. click on Build/Execute or Ctrl+F5 or ! button
  4. DOS shell should pop open with results of program

To Save Output Results:

  1. in DOS shell, click on upper left hand corner for drop down menu
  2. select Edit/Mark
  3. cursor now appears as blinking white box
  4. use mouse to drag and highlight text in program window
  5. hit enter key(this makes a copy of the highlighted area)
  6. hit any key again to close output window
  7. return to Source file in Visual which is still open
  8. go to bottom of Source file page
  9. click on Paste button or press Ctrl+V
  10. output should now be copied to source file(need to comment this out)
  11. 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)

  1. Open MS Visual C++ 6.0
  2. Go to Tools/ Options/Directories tab
  3. 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