I got this code from a customer of Egrid32, in firefly,
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
FF_Result = LoadLibrary("EGRID32PRO.DLL")
IF FF_Result = 0 THEN MSGBOX "Could not LoadLibrary 3rd party custom control: EGRID32PRO.DLL", %MB_ICONWARNING, "FireFly Error"
Seems like he has several Egrids on the same dialog, the question is, is it
safe to load several libraries of a dll without saving the handle to the
module, in order to be able to close it later?? that does seem safe, but who knows...
Thanks in advance.
Elias :)
From the Win32 API Help file for LoadLibrary:
Quote
Once the function obtains a fully qualified path to a library module file, the path is compared (case independently) to the full paths of library modules currently loaded into the calling process. These libraries include those loaded when the process was starting up as well as those previously loaded by LoadLibrary but not unloaded by FreeLibrary. If the path matches the path of an already loaded module, the function just increments the reference count for the module and returns the module handle for that library.
FreeLibraryQuote
The FreeLibrary functiondecrements the reference count of the loaded dynamic-link library (DLL) module. When the reference count reaches zero, the module is unmapped from the address space of the calling process and the handle is no longer valid.
So, if FireFly is calling a matching number of FreeLibrary's for the LoadLibrary's then the DLL should correctly unload from the current process. If this is not happening, then please let me know.