Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
consider two processes that need to load some DLLs. If both of them load these DLL's they take a lot of memory. How can I load these DLL's in just one of the processes and be able to use them in another process too? Can these DLL's load in a shared memory between two process?
Posted
Comments
enhzflep 14-May-14 7:51am    
A closer look at the documentation for LoadLibrary reveals the following (which is in agreement with Rage's answer)

"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."

1 solution

Hmmm... AFAIK, the code is only loaded once, that is precisely the idea behind a dll.

If you want to share data between them, have a look at:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366551%28v=vs.85%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900