How to upgrade a VC ++ 6.0 project to VS2010?

I have MFC Dialogue based applications written in VC ++ 6.0. Due to the requirements of my work environment, I need to switch to Visual Studio 2010. I don't need to add a new feature, just compile it with the updated visual studio.

Can anyone help me with this?

What are all the basic requirements and how to get them started?

+3


source to share


2 answers


From the VC ++ Team Blog and Visual Studio 2010 C ++ Project Upgrade Guide :

With Visual Studio 2010, the C ++ build system moved from a VCBuild system to an MSBuild based build system . The C ++ project system is also built on top of the MSBuild build system. There are some limitations, known issues, or design changes that may arise during the upgrade process. VS2010 supports upgrades from VC6, VS2002, VS2003, VS2005 and VS2008.
As with previous versions of Visual Studio, the upgrade can be done either using the IDE's conversion wizards or from the command line ( Devenv.exe /upgrade

).

Here are the guidelines for updating your apps:

1) Set up your update environment the same as your build environment

The upgrade process will try to download files and evaluate the values ​​during the upgrade. If your projects use values ​​that are not defined by the project files themselves, such as those defined by environment variables, you need to have those environment variables set before performing an upgrade. Without proper settings for these environment variables, you can get conversion warnings or errors caused by unvalued values.

2) Make sure you have the required platforms installed before upgrading



Converting a project on a machine without all available platforms for the project will result in a conversion error. For example, if you try to convert an Itanium project to a Visual Studio Professional SKU that does not support Itanium, you will see a conversion error as shown below:

Failed to upgrade 'Debug|<Itanium>'. Please make sure you have the corresponding platform installed under
'%vctargetspath%\platforms\Itanium'. Cannot load the project due to a corrupt project file. The following error
has occurred during XML parsing:
File: D:\Sample\ConsoleApp\ConsoleApp.vcproj
Line: 28
Column: 5
Error Message:
System error: -2147154677.
The file 'D:\Sample\ConsoleApp\ConsoleApp.vcproj' has failed to load.

      

This is by design as the conversion requires evaluating properties on missing platforms in order for the conversion to succeed. You can check which platforms are installed on your machine by looking at the following directories: %ProgramFiles%\MSBuild\Microsoft.cpp\V4.0\Platforms

(or %ProgramFiles(x86)%\MSBuild\Microsoft.cpp\V4.0\Platforms

on an x64 machine) for platforms installed on the machine.

3) Use native Multi-Targeting to build using VS2008 toolbox if possible

VS 2010 adds Native multitagging that allows you to create Visual Studio 2008 toolboxes from ID VS2010 using the new MSBuild-based design system. I recommend you take advantage of this opportunity by using VS2010 to build using the VS2008 toolkit on upgrade. This can help isolate any system / system related issues due to tool issues that might arise after the upgrade. This will make the navigation to the VS2010 toolbox smoother. After the upgrade, the properties files (.vsprops) are converted to their new format (.props). Likewise, project files (.vcproj) are converted to their new format (.vcxproj). Please note that new project files are created along with old project files. Conversion also creates a new file type (.filter.vcxproj). Filter files contain information that is used to display folders in the solution explorer. This filter information was originally part of the project file. This change was necessary because MSBuild asks for a rebuild whenever the project files change. By storing filter information in a separate file, the filter can be changed without initiating a rebuild of the entire project.

Note. The upgrade process will not convert the .user file. As a result, your debug and deployment settings will not be retained after conversion. VS2010 introduces a new command line upgrade tool, VCUpgrade.exe. This command line tool is suitable for updating applications with only one project, as it cannot accept a solution file as input and parse solution information into project files. VCUpgrade.exe is located at: $ (VSInstallDir) \ common7 \ Tools. This tool will also be shipped in the next version of WinSDK so that users can upgrade from the command line of project files loaded in WinSDK without Visual Studio IDE.

+2


source


Just open your project / solution in VS-2010. Convert it and compile it.

You may get some warnings or compiler errors depending on your code, because the newer compiler is more accurate.



But most conversions only lead to warnings of the kind, such as safety materials and others, and should work directly.

+3


source







All Articles