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#
  4. two appilcations accessing the same memory

two appilcations accessing the same memory

Scheduled Pinned Locked Moved C#
c++performancehelpquestion
5 Posts 2 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
    Yitzchok Dev
    wrote on last edited by
    #1

    I have one program(app_1) that has only read access to drives and write access only to memory. the second program(app_2) has access to memory and write access to drive. How can I load a file or whatever in to memory (buffer) with app_1 and get that file or whatever in app_2 ********************* no access to clipboard, app_2 can't access the file from app_1 on disk(thats fact) most be done thru memory and please don't send me to c++:doh: If you can help then please do Thanks a Bunch

    L 1 Reply Last reply
    0
    • Y Yitzchok Dev

      I have one program(app_1) that has only read access to drives and write access only to memory. the second program(app_2) has access to memory and write access to drive. How can I load a file or whatever in to memory (buffer) with app_1 and get that file or whatever in app_2 ********************* no access to clipboard, app_2 can't access the file from app_1 on disk(thats fact) most be done thru memory and please don't send me to c++:doh: If you can help then please do Thanks a Bunch

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, I am not sure what your app(s) are trying to achieve; maybe this is useful: Windows supports the concept of "memory mapped files". They are very good at sharing data between two processes. They support the situation where multiple processes can read/write the same file, where the file is actually in memory (so it gets mapped in the address space of each participating process). I dont think .NET supports this directly; but applying P/Invoke on Win32 functions such as CreateFile, OpenFile, WriteFile etc. solves this. I have used this for logging: one app logs to memory, another process actually consumes the log information and processes it. :)

      Luc Pattyn [My Articles] [Forum Guidelines]

      Y 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, I am not sure what your app(s) are trying to achieve; maybe this is useful: Windows supports the concept of "memory mapped files". They are very good at sharing data between two processes. They support the situation where multiple processes can read/write the same file, where the file is actually in memory (so it gets mapped in the address space of each participating process). I dont think .NET supports this directly; but applying P/Invoke on Win32 functions such as CreateFile, OpenFile, WriteFile etc. solves this. I have used this for logging: one app logs to memory, another process actually consumes the log information and processes it. :)

        Luc Pattyn [My Articles] [Forum Guidelines]

        Y Offline
        Y Offline
        Yitzchok Dev
        wrote on last edited by
        #3

        do you have a small code snippet?

        L 1 Reply Last reply
        0
        • Y Yitzchok Dev

          do you have a small code snippet?

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, I dont have it at hand, and I am not sure anymore about the Win32 function names; it may well be things like CreateFileMapping, MapViewOfFile, etc. And it would not be "a small code snippet", it really requires some setup code. I suggest you search around (Google) for MMF or memory-mapped file. :)

          Luc Pattyn [My Articles] [Forum Guidelines]

          Y 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, I dont have it at hand, and I am not sure anymore about the Win32 function names; it may well be things like CreateFileMapping, MapViewOfFile, etc. And it would not be "a small code snippet", it really requires some setup code. I suggest you search around (Google) for MMF or memory-mapped file. :)

            Luc Pattyn [My Articles] [Forum Guidelines]

            Y Offline
            Y Offline
            Yitzchok Dev
            wrote on last edited by
            #5

            ok I'll check it out

            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