Board index » cppbuilder » Porting from MS Visual C++ to Borland C++ Builder?

Porting from MS Visual C++ to Borland C++ Builder?


2004-07-07 12:23:58 PM
cppbuilder57
I have some files that presumably compile and run flawlessly
under MSVC++, a program that I have never used -or plan to use.
The full project in question can be found here:
www.codeproject.com/shell/shellextguide1.asp
I took only the *.cpp and *.h files and created a new project
with BC++. There's tons of error messages and the only solution
that I have been able to fix is this:
Change:
#include <atlbase.h>
#include <atlcom.h>
to
#include <atl/atlbase.h>
#include <atl/atlcom.h>
There are other files: *.def, *.dsp, *.idl, *.mk, *.opt,
*.rc and *.rgs which I didn't include in the Borland project.
Do these files have any meaning of usefulness in the world
of C++ Builder X?
Is there some guideline somewhere on how to port from
MSVC++ to BC++B?
Thanks,
-Ramon F. Herrera
 
 

Re:Porting from MS Visual C++ to Borland C++ Builder?

First of all, C++BuilderX (CBX) and C++Builder (BCB)
are 2 different products that have very little in common.
If you are interested in tinkering with MSVC++ projects,
the enterprise version of BCB6 has a project import facility. For best
results, start the installer and make sure that MFC/ATL is installed in
BCB6 as well.
Then Tools | Visual C++ conversion utility.
This will create a .bpr from .dsw/.dsp files (Visual Studio's project
format) .
This should also set the compiler switches for bcc32 to increase MS
compatibility.
Then cross your fingers and compile. There are 2 problems.
The first is that MS allows a more lax non-ANSI compliant C++ syntax
that bcc32 frequently has trouble with. But the main problem is the
difference between RTLs.
It should be possible to get the converted projects running through some
hacking of the code, frequently by performing explicit casts to make the
code more ANSI compliant.
there is a borland.public.cppbuilder.mscompatability newsgroup
( which is archived by google groups IIRC ) which focuses on such issues
and offers some help.
Ramon F Herrera wrote:
Quote

I have some files that presumably compile and run flawlessly
under MSVC++, a program that I have never used -or plan to use.

The full project in question can be found here:

www.codeproject.com/shell/shellextguide1.asp

I took only the *.cpp and *.h files and created a new project
with BC++. There's tons of error messages and the only solution
that I have been able to fix is this:

Change:

#include <atlbase.h>
#include <atlcom.h>

to

#include <atl/atlbase.h>
#include <atl/atlcom.h>

There are other files: *.def, *.dsp, *.idl, *.mk, *.opt,
*.rc and *.rgs which I didn't include in the Borland project.
Do these files have any meaning of usefulness in the world
of C++ Builder X?

Is there some guideline somewhere on how to port from
MSVC++ to BC++B?

Thanks,

-Ramon F. Herrera