Part 3: Running your application

In this stage, we will create a simple window, and show you how to run it just like any of your other applications.
 

Stage 1: Create a project

This was covered in tutorial 1, so we'll assume you have a dialog box with (at least) "Ok" and "Cancel" buttons.
 

Stage 2: Drop on some controls

Click on the "Month calendar" control in the toolbox

Click in the centre of your dialog box.  A calendar should appear in the dialog box.


 

Stage 3: Build your project

Press Ctrl-F5 (Execute program.)  A prompt will appear asking if you wish to build the files. Click "Yes".

Lots of messages will appear in the debug window at the bottom of the screen, telling you exactly what the compiler is doing.
Then the window you've just designed will appear on screen, just like a real windows application.  This is your program running!

Stage 4: Looking around

First of all, notice that your program has an entry in the taskbar at the bottom of the screen.  The program running has been compiled, and is now running independantly of the Visual C++ environment.
Try out some of the calendar controls.  The calendar has already been programmed for you, so no extra code is needed to make it work.

Click on the system menu (top left corner) and click on "About..."  A dialog box appears with program information. (This dialog box was created automatically by Visual C++)

Click on either OK or Cancel, or the X (top right) to close your window.

Stage 5: Running the program directly

Go to the directory in which your project was stored. (By default, this is "my programs\visual studio\my projects\...", so you may like to change it to something more convenient)
Go into the directory with the same name as your project.
Go into the "Debug" directory.


Visual C++ has created a number of files in this directory, all related to program output.  The one EXE file should have the same name as your project, and double-clicking on it will run your program.

You can now create a shortcut to this program, and place it on the desktop, in another directory, or on the start menu.

Next: Designing a window