This page describes the issues you may face when migrating code from Borland C++ 5.02 to Visual C++.
Modern versions of Visual C++ are much better than Borland C++ 5.02 at enforcing const-correctness of code. If your program was properly written, then no problems will be encountered, but if not, be prepared to have to correct it.
In Borland C++ a function exported from a DLL is declared as
void __export MFunc()
In Visual C++ it must be declared as
__export void MFunc()
In Borland C++ the construct is
try/__except
In Visual C++ it is
__try/__except
See Structured Exception Handling. Also, you cannot nest C++ exception handling with try/catch
and SEH with __try/__except
. See Compiler error C2713.
Replace with the corresponding _MAX_DIR, _MAX_FNAME, _MAX_PATH, _MAX_EXT, INT_MAX, etc.
Replace with _splitpath and _makepath.
In Borland C++ the following code works fine:
unsigned long mytime = time(NULL);
...
tm* pTime = localtime((time_t*)&mytime);
when compiled with Visual C++, the call to localtime returns nullptr, as time_t is defined as __int64
. The workaround (if you really needed to store the time as unsigned long) is to first convert to a variable of type time_t and then to pass the address to localtime:
time_t t = static_cast<time_t>(mytime);
tm* pTime = localtime(&t);
See Converting Borland C++ Resource Files to Visual C++.
See How do I resolve error "CVT1100 duplicate resource. type:STRING"?. Also, if the duplicate resource in the reported error is of type ICON and you have multiple resource files in the project, make sure that all ICON resources are defined in the same resource file.
If the project is split in multiple DLLs and the code in one DLL includes a header with a class declaration from a DLL further down the dependencies, if the class is not really used in this DLL, then it will link fine with Borland's linker, but Microsoft's linker will report that the class methods are unresolved externals. The solution is to replace the class header with simple class forward declarations, or to refactor the code to use a base interface for that class.
For projects that use Borland Database Engine (BDE), the alternatives are:
Wiki: Convert_Borland_C++_resource_files_to_Visual_C++
Wiki: Knowledge_Base
Wiki: Supported_Compilers
Wiki: Upgrading_from_OWL
Wiki: Upgrading_from_OWL_1.0