Next: GNAT and Windows Resources, Previous: Using DLLs with GNAT, Up: Microsoft Windows Topics
This section explains how to build DLLs containing Ada code. These DLLs will be referred to as Ada DLLs in the remainder of this section.
The steps required to build an Ada DLL that is to be used by Ada as well as non-Ada applications are as follows:
C
or
Stdcall
calling convention to avoid any Ada name mangling for the
entities exported by the DLL (see Exporting Ada Entities). You can
skip this step if you plan to use the Ada DLL only from Ada applications.
adainit
generated by gnatbind
to perform the elaboration of
the Ada code in the DLL (see Ada DLLs and Elaboration). The initialization
routine exported by the Ada DLL must be invoked by the clients of the DLL
to initialize the DLL.
adafinal
generated by gnatbind
to perform the
finalization of the Ada code in the DLL (see Ada DLLs and Finalization).
The finalization routine exported by the Ada DLL must be invoked by the
clients of the DLL when the DLL services are no further needed.
gnatdll
to produce the DLL and the import
library (see Using gnatdll).