Prerequisites 2

Setting up Visual Studio for a Windows project

Windows based applications require a slightly different set up to console applications due to the 'behind the scenes' compiler configuration. These compiler options could be set manually. But, to save the headache it is just as easy to let Visual Studio do the hard work for you.

Once again, you should take note of the 'Prerequisites' section of the tutorials to make sure that you are configuring your project to suit the tutorial.

A Windows based tutorial will have a 'Prerequisites' section that looks similar to the following;


Project type: Windows
Include files: windows.h
Library files: N/A

Configuring the 'Windows' project

Start Visual

Select 'File', then 'New Project'

Creating a console project

Choose 'Win32 Project' and choose a name for the project. Then select OK.

You will see the following screen.

Creating a console project

Select 'next'

Creating a console project

Select 'Empty project' and click 'Finish'

Creating a console project

Right click on 'Source files' and select 'Add -> New Item'

Creating a console project

Choose 'C++ File' and enter 'main.cpp' into the name field.

Creating a console project

Select 'Project' and click on the projects properties.

Creating a console project

Select 'Configuration Properties' and change 'Character Set' from 'Use Unicode Character Set' to 'Use Multi-Byte Character Set'. Click apply.

Creating a console project

Do the same for the release configuration.

The reason these tutorials are based on multi-byte instead of Unicode character set is to avoid casting issues that can arise from trying to convert char to LPWSTR and back again (relating to later tutorials), to save frustrations to those whore are new to Win32 Windows programming.

Visual Studio is now set up and ready to go for the 'Windows' based tutorials.

Next tutorial

Back to the tutorials