Originally Posted By: MasterQ32
I don't think LoadLIbrary will work if the library has already loaded before.


you can load a library as often as you want, you just need to unload it by the same amount of calls. It's reference counted.

If the dll was loaded before, LoadLibrary does not load anything, it just returns the already existing handle and increases ReferenceCounting by 1.

Same goes for FreeLibrary. It first Decrements the referencecount by 1, and if it reaches 0, it unloads the library. So if you "load" a library 3 times, you have to "Unload" it 3 times. Otherwhise it's keept until your process exits.


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development