Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

My code is old. I have accumulated many lines of (useful) VC++ code for the last 15 years. Some libraries are great and work fine.

I am starting a new program. I'd like to use VS2010. Unfortunately, 2 of the libraries that I'd like to use are compiled with VC6 (6 or so years ago). Those libraries are big. (not giant but big enough to make me think :-) )

Is it a big deal to make the port of this source code to VS2010 (both are 32b and will remains like that)? What is your advice to do this operation? And to add some difficulties, I don't know at all Visual Studio releases post 2003! (I only used VS 6 Pro for ages and it was ok: but things change.... ;-) )

Many thx in advance for the advice
Best regards
Guy
Posted

My advice would be to move it to VS2010.

Start out by planning - it just might be that you would like to refactor some of your code, and if you're moving the code to a more modern version of C++, you should proably think things through.

Before you start, there are a few libraries that I would investigate (whether you use them or not is up to you, but they are well worth investigating):
1 Boost C++ library[^]

2 ICU - International Components for Unicode[^]

3 Xerces C++ XML Parser[^]

4 ACE/TAO[^]

These libraries have been ported to a wide range of compilers and platforms, and they are thoroughly tested.

Consider using/replacing parts of your library with functionality from libraries that you do not have to maintain.

Think in terms of header only libraries, this often makes it easier to use you code.

Use namespaces :)

Best regards
Espen Harlinn
 
Share this answer
 
Comments
thatraja 1-Feb-12 12:03pm    
I think this may be useful for next revision(update) of my blogpost :Doh:
5!
Espen Harlinn 1-Feb-12 16:28pm    
Thank you, thatraja!
Sergey Alexandrovich Kryukov 1-Feb-12 14:03pm    
Nice set of links, my 5.
--SA
Espen Harlinn 1-Feb-12 16:29pm    
Thank you, Sergey!
Apart from having to fix a few bugs and changes the process should not be too painful. In order to ease yourself into it you may want to try the free Visual C++ Express[^]. It's a cut down version but includes the compiler and libraries but not MFC. I have a feeling Microsoft also offer a trial version of VS2010 Pro, which may help you.
 
Share this answer
 
Comments
thatraja 1-Feb-12 12:03pm    
5!
Espen Harlinn 1-Feb-12 16:29pm    
5'ed!
The first thing to do would be to try to compile it to get an idea of the problem you might have.

If you have the professionnal version of Visual Studio and there are a lot of errors, then you should compile file one by one and fix errors.

Same thing for project. Build them one by one. It is much easier that way when you have a lot of compilation errors.

Something that can also really help the conversion is to exclude and/or comment out most problematic area and then once it compile (and build) add back those part progressively.

The final trick is to write some helper code if you have problematic case that opccurs a lot. In some case, find&replace might also be useful.

Having source control is also a plus particulary if you have a lot of changes to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900