ExitUserDLL and Old Style MFC Extension DLLs
In SOLIDWORKS 2006 and later, the return value of the exported function ExitUserDLL() is checked to see if an add-in allows or disallows unloading
by SOLIDWORKS. The return value is of type BOOL,
where:
Add-ins should typically disallow unloading when there are pending references
on automation objects managed by the add-in. Continuing the unload process
will typically crash SOLIDWORKS if an attempt to free these objects occurs
after the add-in has been unloaded.