| View previous topic :: View next topic |
| Author |
Message |
Fabry Guest
|
Posted: Thu Sep 28, 2006 3:37 pm Post subject: Export C++ class from a Borland DLL and use it in Microsoft |
|
|
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 |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Thu Sep 28, 2006 6:26 pm Post subject: Re: Export C++ class from a Borland DLL and use it in Micros |
|
|
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
| Quote: | Fabry wrote in message
news:1159439852.118518.47110 (AT) m73g2000cwd (DOT) googlegroups.com...
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 |
|
|
| Back to top |
|
 |
Harold Howe [TeamB] Guest
|
|
| Back to top |
|
 |
Pavel Vozenilek Guest
|
Posted: Wed Oct 04, 2006 6:57 pm Post subject: Re: Export C++ class from a Borland DLL and use it in Micros |
|
|
"Fabry" wrote:
| Quote: | 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?
|
As it was said COM looks as the best option.
It is possible to avoid lot of the complexity
Microsoft added to COM over years.
If you use some other way it is recomended that
all executables use the same memory manager.
/Pavel |
|
| Back to top |
|
 |
|