Re: FreeLibrary()
- Posted by jimcbrown (admin) Sep 28, 2012
- 1958 views
ghaberek said...
mattlewis said...
include std/dll.e constant KERNEL32 = open_dll( "kernel32.dll" ), FREELIBRARY = define_c_func( KERNEL32, "FreeLibrary", { C_POINTER }, C_INT ) public function free_library( atom dll ) return c_func( FREELIBRARY, { dll } ) end function
This should work with dlls opened with open_dll(), as we simply return the value returned by LoadLibrary.
I'm sure it's a rare use case, but I can see this being quote useful for a larger program that had to dynamically load modules in and out of memory.
And so...
I agree - it's a rare case.
ghaberek said...
- would it just be a call to dlclose() on UNIX side?
Yes.
ghaberek said...
- should it be called close_dll() instead?
-Greg
Yes.
ghaberek said...
- can we add this to the standard library?
Yes!