How to share data between DLLs
-
I coded like this: #pragma data_seg("Shared") HWND g_hWndCaller = NULL; HHOOK g_hHook = NULL; #pragma data_seg() #pragma comment(linker, "/SECTION:Shared, RWS") but it does not work, why?
-
I coded like this: #pragma data_seg("Shared") HWND g_hWndCaller = NULL; HHOOK g_hHook = NULL; #pragma data_seg() #pragma comment(linker, "/SECTION:Shared, RWS") but it does not work, why?
Do MSDN articles Q100634 or Q125677 help?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
I coded like this: #pragma data_seg("Shared") HWND g_hWndCaller = NULL; HHOOK g_hHook = NULL; #pragma data_seg() #pragma comment(linker, "/SECTION:Shared, RWS") but it does not work, why?
Just in case it is sotehing as STUPID as this.. I notice the documentation shows /INCLUDE, but the sample shows this: #pragma comment(linker, "include:__mySymbol") So, as a suggestion, why don't you try using all lowercase for the word 'section': #pragma comment(linker, "/section:Shared, RWS") Also, you might want to call your section something besides 'Shared' so you don't confuse the compiler or linker over another keyword. Use your company initialz in front of it or something.. #pragma data_seg("YCIShared") HWND g_hWndCaller = NULL; HHOOK g_hHook = NULL; #pragma data_seg() #pragma comment(linker, "/section:YCIShared, RWS")