Creating and using DLLs and shared objects


Creating a DLL/shared object with the environment is very easy. A DLL needs a main program module. The main program module can have any name. To create a DLL use the following steps

Note: Sometimes a module will not be called and/or usedin any way in the DLL code itself, but its functions still need to be exported fromthe DLL. The module needs to be imported by something in the DLL to be linked intothe DLL. If you are using the EXPORTS declaration you need not worry about this sinceyou will be importing all modules that are exporting procedures from the DLL intothe main program module to list them in the EXPORTS declaration.


Using a DLL is easier than creating a DLL, in fact it is no differentthan using a normal code library project. The development environment handles thelow level details for you. To use a DLL you simply import the DLL project whereveryou need to access the DLL. When running your program remember that the operatingsystem is going to need to load the DLL and you need to make sure the DLL is found.You may need to copy the DLL to your application project, or some other directorywhere you run your applications.