It instructs the linker that it should export the function
Add
when building a DLL so that it can be called by other programs or DLLs when loading the DLL containing that function.
See also
dllexport, dllimport[
^] in the MSDN.
The
import
attribute is the opposite:
It tells the linker that the function is not located in the program or DLL that is actually build but contained in another DLL.
When buidling a DLL, you can use the
export
attribute to avoid creating a module-definition file. The
import
attribute can then be used in the header file for that DLL to be included when building an application or DLL that loads the DLL.