I'm writing a DLL that initialises its internal object etc. based on an data held in an INI file - when the the DLL is loaded by an application (using LoadLibrary) initialization section code for various units in the DLL is executed.
However, I want to be able to handle cases where the INI file is missing or its data invalid. So far I raise an exception if any of these values are invalid but a run-time 217 error is generated by doing this. Is there a more graceful way of handling errors when a DLL is being loaded. Should I be raising exceptions in a DLL when it is loaded / freed.