Board index » delphi » compiling 16-bit dll

compiling 16-bit dll

When trying to build a 16-bit dll the exported functions
in the cpp file do not appear in the completed dll file

I am using the LibMain entrypoint for a 16-bit dll.
The names of the exported functions are in my def file.

I think I need to know the correct project options to build
a 16-bit dll.

No sure about the IMPLIB function. Is it needed to created the dll?

 

Re:compiling 16-bit dll


Add the keyword _export to the functions in the DLL source.

To see the exported functions in a DLL, use IMPDEF and look in the module
definition (*.DEF) file that it creates.  For instance:
  impdef DllName.DEF DllName.DLL

Implib is used to create an import library to be used by another DLL or EXE
that uses this one.  It is not used to create this DLL.

.  Ed

Re:compiling 16-bit dll


"Ed Mulroy (TeamB)" <e...@mulroy.org> wrote in message
news:3b61855f_2@dnews...

Quote
> Add the keyword _export to the functions in the DLL source.

> To see the exported functions in a DLL, use IMPDEF and look in the module
> definition (*.DEF) file that it creates.  For instance:
>   impdef DllName.DEF DllName.DLL

> Implib is used to create an import library to be used by another DLL or
EXE
> that uses this one.  It is not used to create this DLL.

> .  Ed

Thank you Ed
    _export keyword worked. Functions now show up in created dll.
    If you use the _export keyword to create exported functions in a dll do
you still need the LibMain entrypoint in a 16-bit dll?

   If you want another EXE  to use the created dll
does the import library file and the created dll have to be in the EXE
directory?

Albert Winter

Re:compiling 16-bit dll


LibMain is the function in a DLL which Windows calls when the DLL is loaded
so that it can initialize.  There is no relationship between if other
functions are exported and if you need a LibMain.  You always need a LibMain
in a 16 bit DLL.

If you want to use an import library to implicitly link to a DLL then add
the library to your project list.  It doesn't matter where it is located.
Highlight the EXE line in the project window.  Press the Ins key and a file
selection dialog will appear.  Use that dialog to select the import library.

.  Ed

Other Threads