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 in a same dll loaded by different process?

How to share data in a same dll loaded by different process?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
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.
  • B Offline
    B Offline
    Best Kiluyar
    wrote on last edited by
    #1

    Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.

    D B 2 Replies Last reply
    0
    • B Best Kiluyar

      Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.

      D Offline
      D Offline
      Don Fletcher
      wrote on last edited by
      #2

      Hi, You should look into "shared memory" - it is relatively easy and will accomplish what you want. Try this one: http://www.codeproject.com/threads/sm.asp[^]

      1 Reply Last reply
      0
      • B Best Kiluyar

        Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.

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

        You can place the data into a shared data segment. Be sure to protect access to it with some sort of thread-safe synchronization mechanism.

        Any sufficiently gross incompetence is nearly indistinguishable from malice.

        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