Importing and Exporting You can import public symbols into an
application or export functions from a DLL using two methods:
Use a module definition (.def) file when building the DLL Use
the keywords __declspec(dllimport) or __declspec(dllexport) in a
function definition in the main application Using a .def file A
module-definition (.def) file is a text file containing one or
more module statements that describe various attributes of a
DLL. If you do not use __declspec(dllimport) or
__declspec(dllexport) to export a DLL's functions, the DLL
requires a .def file. Visual C++ uses __declspec(dllimport) and
__declspec(dllexport) to replace the __export keyword previously
used in 16-bit versions of Visual C++. You do not need to use
__declspec(dllimport) for your code to compile correctly, but
doing so allows the compiler to generate better code. The
compiler is able to generate better code because it can
determine whether a function exists in a DLL or not, which
allows the compiler to produce code that skips a lev