Board index » cppbuilder » Export C++ class from a Borland DLL and use it in Microsoft VC
Fabry
![]() CBuilder Developer |
Fabry
![]() CBuilder Developer |
Export C++ class from a Borland DLL and use it in Microsoft VC2006-09-28 06:37:32 PM cppbuilder35 Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and I am able to include the lib and use the class that i have exported creating an instance with new etc... I would like to export this class in microsoft VC++ using the same .lib file. Obviously it doesn' t work. Is it possible to generate or convert the import library into a compatible format? Thank you in advance Fabry |
Ed Mulroy
![]() CBuilder Developer |
2006-09-28 09:26:45 PM
Re:Export C++ class from a Borland DLL and use it in Microsoft VC
As you have discovered the import library formats for Borland and for
Microsoft are not the same. There are three common ways in which a DLL created by one compiler is used by an EXE or DLL created by another: - create an import library from the DLL with the tools provided by the compiler which created the using EXE or DLL - create a module definition (*.DEF) file with impdef.exe and use it in the link. - create a module definition file and use the tools provided by the the compiler which created the using EXE or DLL to create an import library from that file In general classes cannot be exported from a DLL except if the EXE or DLL that uses the exported items is - built with the same compiler - built with the same compiler version - depending upon the items in the class or its calling arguments, with the same options settings. The common ways a class in a DLL is used by an EXE or DLL created by a different compiler is by exporting normal functions which use the class in code internal to the DLL or by exporting providing a COM interface to use the class. . Ed QuoteFabry wrote in message |
Harold Howe [TeamB]
![]() CBuilder Developer |
2006-10-03 12:14:10 AM
Re:Export C++ class from a Borland DLL and use it in Microsoft VCQuoteIs it possible to generate or convert the import library into a be able to reverse some of the logic and make it work. COM is probably your best bet. web.archive.org/web/20041017020843/www.bcbdev.com/articles/bcbdll.htm This article explains how to create a DLL in BCB that is called from VC++. It only deals with plain C functions. H^2 {smallsort} |
Pavel Vozenilek
![]() CBuilder Developer |
2006-10-04 09:57:14 PM
Re:Export C++ class from a Borland DLL and use it in Microsoft VC
"Fabry" wrote:
QuoteI'm new of this group and I do not know if this is the correct group Microsoft added to COM over years. If you use some other way it is recomended that all executables use the same memory manager. /Pavel |