Board index » cppbuilder » LIB to DLL

LIB to DLL


2004-05-08 10:16:38 PM
cppbuilder47
I have some LIB files that I would like to use from a Win 32
application. Is there a way I can convert or encapsulate the LIB file
into a DLL? I have Borland C++ 4.52 if this will do the job.
--
Regards,
Richard Beilby.
 
 

Re:LIB to DLL

The easiest way is to write a DLL using the source code for the items
in the libraries.
If you do not have source:
I assume that you are speaking of static libraries containing 32 bit
code that was compiled with Borland's compiler. You can get a list of
the object file that each library contains and the public symbols it
supplies with a command like this.
tlib /C libname.LIB , libname.LST
You can extract object files from the library like this:
tlib /C libname.LIB *objname1 *objname2 *objname3
You will need to write a small source file in which the function
DllEntryPoint is supplied. The Windows help, win32.hlp, describes
what that function must do.
Write a module definition file in which the functions that the DLL is
to export are listed in the EXPORTS section.
You will need to decide if you wish the DLL to use the static or
dynamic versions of the runtime library.
Create a DLL project listing the source file, all the object files and
the module definition file and build it.
. Ed
Quote
Richard Beilby wrote in message
news: XXXX@XXXXX.COM ...

I have some LIB files that I would like to use from a
Win 32 application. Is there a way I can convert or
encapsulate the LIB file into a DLL? I have Borland
C++ 4.52 if this will do the job.
 

Re:LIB to DLL

Ed,
Thanks for your reply. The libraries are old and 16-bit. They were
compiled using Borland C++. Will your procedure still work in this
instance?
--
Regards,
Richard Beilby.
 

{smallsort}

Re:LIB to DLL

No. You cannot make a 32 bit DLL from them.
16 bit code cannot be used as if it were 32 bit code.
. Ed
Quote
Richard Beilby wrote in message
news: XXXX@XXXXX.COM ...

Thanks for your reply. The libraries are old and 16-bit.
They were compiled using Borland C++. Will your
procedure still work in this instance?