We have an application written in C / C ++, which is divided into one EXE and several DLLs. Each of these dlls uses the same static library ( utilities.lib).
Any global variable in the static utility library will actually have multiple instances at runtime. There will be one copy of the global variable for each module (for example, DLL or EXE) with which it was associated utilities.lib.
(All of this is known and good, but it's worth mentioning how static libraries behave in the context of a DLL.)
Now my question is .. We want to change it utilities.libso that it becomes a DLL. It becomes very large and complex, and we want to distribute it in a DLL form instead of a form .lib. The problem is that for this single application we want to keep the current behavior that each application DLL has its own copy of global variables in the utility library. How would you do that? In fact, we do not need this for all global variables, only for some; but it doesn’t matter if we get it for everyone.
Our thoughts:
- , , - , , DLL . ,
HMODULE , , utilities.dll. DLL. - , (, )
utilities.dll. DLL . utilities.dll . , , DLL DLL . DLL , , " " - utilities.lib, utilities.dll.