Setting up Visual Studio for a Windows projectWindows 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;
PrerequisitesProject type: Windows
Include files: windows.h
Library files: N/A
Configuring the 'Windows' projectStart Visual Studio.net.
Select 'File', then 'New Project'
Choose 'Win32 Project' and choose a name for the project. Then select OK.
You will see the following screen.
Select 'Empty project' and click 'Finish'
Right click on 'Source files' and select 'Add -> New Item'
Choose 'C++ File' and enter 'main.cpp' into the name field.
Select 'Project' and click on the projects properties.
Select 'Configuration Properties' and change 'Character Set' from 'Use Unicode Character Set' to 'Use Multi-Byte Character Set'. Click apply.
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.