First Application

This is a brief overview of how to create an application in MicroSoft Visual C++. These are the steps you will follow for most of the assignments. The first step is to start up MSVC++. You can do this from the Start menu. Once it is running, it will look something like this:
You will then select New from the File menu and you get a window where you specify the projects name and such. It looks like:
You will select Win32 Console Application from the list on the left. On the right side, you will give the project a name. I recommend something like 'asgn', where n is the assignment number.

Below that is the location where the project is stored. Following this procedure will create a new folder for each project. This will make it easier for you to keep track of assignments. I suggest you create a folder on your network drive or floppy or zip disk called 'cis270' and specify that in the Location box. Doing this will put all the projects for this class in one place. After this, you click the 'Ok' button.

This will pop up a window where you can specify what kind of initial setup you want.
I have found that for the kinds of applications we will be building, the best choice is a simple application. Once you have selected this, you can click Finish.

The next window just summarizes what you selected, go ahead and click on 'Ok'.

After this, you will see that the left most panel has the name of you project in it. Below this are two tabs, you should select the 'FileView' tab. At the top will be a small box with a '+' in it next to the name of your project. Click on the '+' to expand it. Now you will see a similar line that says 'Source Files'. Expand this as well. There will be a line that says 'yourproj.cpp'. This is the file that contains the source code for you project. MSVC++ has put in the file the beginnings of a program. Click on this file name and it will be opened in the editor window, something like this.

Now edit this to write the program. In this case, we are writing a simple example program that is traditional for new programmers. It will simply print the words 'Hello, World!'. When the editor is first opened, it looks like this:

// yourproj.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main(int argc, char* argv[])
{
	return 0;
}
This will actually compile and run, but we will make some changes first so it looks like this:
// asg1.cpp : Quick check to see if the compiler works
//

#include "stdafx.h"
#include 


int main(int argc, char* argv[])
{
	cout << "Hello, World!" << endl;
	return 0;
}

Now to compile this, select the Build menu at the top of the screen. Under that, select 'build yourproj.exe' or hit F7. This will compile the program. Any errors will appear in the bottom panel. If in the bottom panel you see a message like yourproj.exe - 0 error(s), 0 warning(s) then the program compiled correctly and is ready to run.

To run it, again select the Build menu and this time click on the 'Execute yourproj.exe' option or hit control-F5. You should see a window that looks like this:

When you are finished working on your project, it is best to clean up the build. This will greatly reduce the amount of space the project takes up. To do this, again select Build and choose the 'Clean' option. After this, you can exit MSVC++.

A few other things. While the system saves the code every time you build, you can do this yourself by clicking on the floppy icon at the top or by choosing Save under the File menu, If there are error messages in the bottom panel after a build, double clicking on the message will move the cursor in the editor to the line that has the error.