Here are some basic instructions to get started using Microsoft's cut down Visual Studio.NET 2005. It's a truly excellent free compiler and IDE.
First of all, you need to be able to do big downloads. For doing Windows development you need both Visual Studio Express and the Platform SDK which in total are around 900Mb.
Microsoft's own instructions for installation are actually very good, so you might just want to follow those. The home page for Express is
here*** Update 20/11/08 *** The instructions for patching VS2005 to make Win32 Applications have moved to
hereFirst of all, you need to download Visual C++ 2005 Express Edition. Its homepage is
hereAs with many Microsoft downloads, the initial part of the install only downloads a small installer which grabs the rest of the software off the net while it's installing. I don't like this, personally, so I went to the manual install page and downloaded the .ISO file which is 474,686Kb. The big advantage here is you get everything in one hit.
Once you have that installed, you are able to develop command line programs and not much else. To develop Windows applications and DLLs you need the Platform SDK. This is all the headers and libs to develop Windows programs (except DirectX which is a separate download).
So to install the Platform SDK and patch VSE2005 to use it, go
here.
Again, the default download is tiny, and you can download the entire SDK via a link at the end of
this page. It's 409Mb.
Once you have the Platform SDK installed you need to follow instructions 3,4 and 5 on the usingpsdk page.
In section 3, the Options page it is talking about is
Tools->Options->Projects and Solutions->VC++ Directories
Click the New Folder icon top right to create a new line, and either paste in the lines from the website or browse to the files if you didn't install them in the default location.
Follow options 4 and 5 closely. Once you've done that, close and reopen Visual Studio Express for the changes to take effect.
Finally, back
here again, you should install the Visual Studio Express Editions 2005 Service Pack 1.
To create a new Windows project, go to File->New->Project.
Choose
Visual C++->Win32->Win32 Console Application
And type in the name of the Solution and Project. Click OK.
A Solution can contain more than one project, to keep all your related work together.
Choose
Application Settings at the left hand side of the dialog.
Choose
Windows Application radio button.
Select
Empty Project and click Finish.
This will create an empty Windows project.
If you already have source code, in the solution explorer you can right click the project name and select
Add->Existing Item
if not you can choose
Add->New Item
I suggest you make a copy of any code you port into Visual Studio, since you might have to change it a little if you're moving from another compiler like devc.
Once you have some buildable code, you will probably want to turn off Unicode support. Most code isn't Unicode, but Microsoft are (probably correctly) defaulting their tools to support character sets with more than 256 characters in.
To do this, choose
Project->Properties->Configuration Properties->General->Character Set->Use Multi-Byte Character Set
Click OK.
Finally you can use
Build->Build Solution (F7) to build your code
and
Debub->Start Debugging (F5) to start running it in the debugger.
If the code doesn't build, click on the error message and it will take you to the line the error occurred. If you don't understand anything F1 always brings up related help (I choose not to use online help, since it's all in the Platform SDK you installed).
To change to a Release build instead of Debug, choose the drop down box on the toolbar that says 'Debug' and choose 'Release'. You will need to change the Unicode setting again since project properties are specific to each configuration. You can have as many configurations as you want using the Configuration Manager which is also in that drop down box.
There are loads of other useful features in the editor and the debugger is excellent.
Please correct, update or reply to this article if you see mistakes or omissions.
Jim