I did some C++ programming about 10 years ago and wanted to get back into it to write a simple game program so I bought the Microsoft Visual Studio package and its nothing like Borland.  What did they do and how do I get started?  Programming is not a problem for me but I am just so lost with all this windows BS that has been tacked on before you can write a single piece of your own application.  Any suggestions?

First let me say that this is _not_ a C++ question. It is a product support question. Lucky for you I actually use the product in question...

You do not say which MS VS version you have, so I will presume it is the current version - the .NET 2003 edition.

As to "its nothing like Borland" - what did you expect? Its like buying a Porsche and saying it nothing like a Ferrari !

If you wanted the Borland style of doing things then why did you get the MS product?

I am sorry but I do not know what you are asking when you say "What did they do" - they - MS - improved on the previous version of Visual Studio which improved the old version 6 (pre .NET) offerings.

As to all the new .NET stuff - ignore it unless you need it. I stick with straight C++ using VS.NET 2003 and ignore the .NET stuff when doing so. If I want to play with .NET I'll use C# thank you very much!

Getting started entails creating a project and adding files to it, writing the code and building it etc. Project are now organised into Solutions which is just a silly name for a collection of projects (it used to be called a workspace in version 6, but I suppose someone let the marketing people loose at some point...)

So to run through creating a project for the classic Hello World program. Start by creating the project - try New -> Project from the File menu or just click the New Project button on the start up screen. In the Project types list select Visual C++ Projects then on the right hand side in Templates try selecting Win32 Console Project. Fill in the name and location for the project, click OK and on the wizard for this project type select the Application Settings view and select the options you wish - I suggest you start by leaving the console application selected, with no MFC or ATL support and maybe check the empty project box.

If you do this the project is created and opened for you but no files are created for you. Note the project is contained in a Solution.

Next you create a source file - for example by right clicking on the Source Files project "folder" (its not a file system folder at all - its just a way of organising the files in the project for you in Visual Studio) and selecting Add then New Item and selecting a C++ file and entering the name will create and open the file for you (e.g. HelloWorld.cpp)

You can then enter your program - a classic hello world in our example:

       #include <iostream>

       int main()
         std::cout << "Hello World!\n";

Build it using Build from one of the menus and run it under the debugger using Debug -> Start (possibly F5 will also start it under the debugger - depending on your command - key bindings) - which will run the program in a console then close it down again when the program terminates - add a break point on the last line - in my key board setup for VS using F9 toggles break points on and off on the current line in the editor.

If you wish to know more then try reading the documentation - Visual Studio comes with three disks of MSDN Library and this is also online at http://www.msdn.microsoft.com/. Maybe obtain one of the books on the subject - I am sure Amazon and the likes have many such titles but the only book in this area I have read was intended for those wishing to extend VS .NET using macros and add ins - which is probably not what you want at this time.

As to the Windows BS - well you _are_ using the Windows OS so there is _some_ justification. Unless you are writing a game that is to be run in console (DOS) mode then you will have to get to grips with Windows application programming at some point.

If you do not like Windows then switch to another system - Mac OS X or Linux or something and use another set of tools such those from Borland, Metrowerks or the good old GNU tools - however if your application is graphical you will have to get to grips with similar techniques on these systems.

The only light at the end of the tunnel is that there are third party libraries around like wxWidgets (http://www.wxwidgets.org) and Qt from Trolltech (http://www.trolltech.com/) - both of which happen to be cross platform in that they support the X windows system and Mac as well. So if you do not like the MS supplied frameworks and libraries - namely the MFC and the ATL - then you can use someone else's!

Of course your game may require sophisticated graphics and sound in which case you will have to look at DirectX under Windows, or its counter parts on other platforms.  


All Answers

Answers by Expert:

Ask Experts


Ralph McArdell


I am a software developer with more than 15 years C++ experience and over 25 years experience developing a wide variety of applications for Windows NT/2000/XP, UNIX, Linux and other platforms. I can help with basic to advanced C++, C (although I do not write just-C much if at all these days so maybe ask in the C section about purely C matters), software development and many platform specific and system development problems.


My career started in the mid 1980s working as a batch process operator for the now defunct Inner London Education Authority, working on Prime mini computers. I then moved into the role of Programmer / Analyst, also on the Primes, then into technical support and finally into the micro computing section, using a variety of 16 and 8 bit machines. Following the demise of the ILEA I worked for a small company, now gone, called Hodos. I worked on a part task train simulator using C and the Intel DVI (Digital Video Interactive) - the hardware based predecessor to Indeo. Other projects included a CGI based train simulator (different goals to the first), and various other projects in C and Visual Basic (er, version 1 that is). When Hodos went into receivership I went freelance and finally managed to start working in C++. I initially had contracts working on train simulators (surprise) and multimedia - I worked on many of the Dorling Kindersley CD-ROM titles and wrote the screensaver games for the Wallace and Gromit Cracking Animator CD. My more recent contracts have been more traditionally IT based, working predominately in C++ on MS Windows NT, 2000. XP, Linux and UN*X. These projects have had wide ranging additional skill sets including system analysis and design, databases and SQL in various guises, C#, client server and remoting, cross porting applications between platforms and various client development processes. I have an interest in the development of the C++ core language and libraries and try to keep up with at least some of the papers on the ISO C++ Standard Committee site at http://www.open-std.org/jtc1/sc22/wg21/.


©2016 About.com. All rights reserved.