I isapi creating an isapi extension. It is necessary to organize a timer in dll in order to unload not the entire library, but to release unused resources created by the library.

Thank.

    1 answer 1

    You can guaranteed unload the library only if you loaded it yourself with the help of LoadLibrary , and you are sure that no other code of your process loaded it again. In this case, FreeLibrary unload your library.

    Please note that you must ensure that no one uses the functions of this library after unloading, otherwise problems cannot be avoided.

    Note that it is better to use CreateTimerQueueTimer for the timer, rather than SetTimer , since SetTimer requires a message queue.

    • rather, not load the entire library, but free up unused resources created by the library. - i_slayer
    • uh ... and how the unfortunate library finds out if someone uses its resources or not? The library itself can clean its caches, of course, but no more. - VladD
    • I create a library and when a user (many users) accesses the library, it allocates memory for user data, and when a user has a long time (it all depends on the settings of my timer, for example 10 minutes), the library does not access the library then I delete the user data (I write isapi extension for iis server based on odbc drivers - access to any database in mssqlserver) - i_slayer
    • one
      @i_slayer: Ah, well, then everything is simple, it's like cleaning the internal cache. - VladD