Re: FreeLibrary()

new topic     » goto parent     » topic index » view thread      » older message » newer message
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...

  • can we add this to the standard library?
  • would it just be a call to dlclose() on UNIX side?
  • should it be called close_dll() instead?

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu