Dlls Regarding
-
Will a Separate copy of Dll be loaded for each application reference? If so, How can I share the same data between applications? could anyone explain please. Shenthil
-
Will a Separate copy of Dll be loaded for each application reference? If so, How can I share the same data between applications? could anyone explain please. Shenthil
You can also mark certain data segments in a DLL as shared. From the MSDN docs:
#pragma section ("mysectionname", read, write, shared)
__declspec(allocate("mysectionname")) int my_shared_variable = 0;This will create a section within your DLL called mysectionname. It will be shared among the processes which loads the DLL. By using
__declspec(allocate)
you advise the compiler to put the variable in that section instead of it's private data segment. -- You're entertaining at least.