Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to share data between DLLs

How to share data between DLLs

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yanping wang
    wrote on last edited by
    #1

    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?

    D B 2 Replies Last reply
    0
    • Y yanping wang

      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?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • Y yanping wang

        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?

        B Offline
        B Offline
        Blake Miller
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups