tags:

views:

79

answers:

3

Please guide me, as how to convert a C++ code of Borland 2007 in to Visual Studion 2010 code. I just need to ask, whether to write all th code again for 2010 or is there any shortcut for this conversion/migration.

+1  A: 

If the code was written portably to begin with, there should be no issues. Other than that, all I can say is to run the code through Visual Studio's compiler and see if you get errors or anything of that nature.

After that, test the output to ensure you're getting correct behavior.

Billy ONeal
This is always my go-to approach. Although, this can be VERY depressing if there are a lot of incompatibilities...
Chris Thompson
I have checked the code by compiling and executing it on VS 2010, but it was nor compiled nor executed.Infact, after loading the old project of 2007, Debug and Run option goes disable.Need help. I am new to VS environment and using it first time.I have exposure of C/C++ only.Plz guide
Asad
@Asad: AFAIK you'll need to create a new Visual Studio solution and add the actual .h and .cpp files to it in order to compile. AFAIK Visual Studio does not understand Borland's file format.
Billy ONeal
+1  A: 

Are you using any Borland proprietary components?

If so, I'd say you're out of luck. You'd have to replace those components, and this is likely not to be easy. I should say you may not find a tool that can automatically "translate" these.

If not, it should be easier. But be aware that Borland compiler has support for many things that are not C++ standard. If your code is portable enough, you'll be fine just recompiling it under VS. You might have to change some header files, replace some pragmas, but nothing too complicated.

jweyrich
I donot know , what is Borland Proprietary components?I have checked the code by compiling and executing it on VS 2010, but it was nor compiled nor executed.Infact, after loading the old project of 2007, Debug and Run option goes disable. the project is a simple windows form, with few controls on it. My boss ask me to migrate this old code to VS 2010 (C++).As mentioned above, I am completely new to VS environment and have exposure of C/C++ only. Plz guide accordingly.
Asad
@Asad: every component that is part of the CLX, which is based on VCL (obj pascal), is tightly coupled to the Borland C++. For e.g: TForm and TButton are part of CLX. Every component inherits a TObject. So it isn't easy to replace them. Face it as switching the GUI library entirely.
jweyrich
Thanx dood!Appreciate your reply. Even donot know most of your Jargons.Any final solution, or suggestion to me. Redo all programming for 2010??? Also can i install MSDN help,if i forgot to install it while installing VS express edition?????You are good!!
Asad
@Asad: unfortunately, you'll need to replace all the components and rewrite/adapt your code accordingly. You may pick a GUI library like WFC (Windows Forms Controls), QT, OWLNext, etc. I guess MSDN won't help in this decision. For Windows Forms, see http://msdn.microsoft.com/en-us/library/ettb6e2a.aspx
jweyrich
A: 

If you're using the Borland GUI (TButton, etc) then you have some real work to do. Every one of them will need to be replaced with something Visual Studio knows - most probably MFC. About the time Visual C++ 4 was released I actually wrote a giant set of scripts (mostly using sed and awk) to convert a large codebase - it was not pleasant, the parameters are in different orders and the methods return slightly different types. It was worth it in that case - tens of thousands of lines of code and a strong business desire to switch tools. In your case since you say you have a "simple windows form with new controls" I would say start a new project, build the form, then copy your old code in - entire files for classes and business logic, clumps of lines for event handles in the gui. Test very carefully.

Also, the default MFC look and feel isn't the same as the Borland default look and feel. On that long ago project we had to look identical so we had to play with a lot of properties and options. Be sure to ask your bosss if this matters.

Kate Gregory
Really thanx for your reply. Now i have started making it from scratch for VS C++.
Asad