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. Shared memory

Shared memory

Scheduled Pinned Locked Moved C#
csharpc++wpfperformance
4 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.
  • M Offline
    M Offline
    manoharbalu
    wrote on last edited by
    #1

    I have an application in MFC which creates shared memory using CreateFileMapping where I share a Struct object. In another console application in C++, I am accessing the shared memory using OpenFileMapping function and so the struct object is changed/accessed in both the applications. Now, I want to redevelop my MFC Application in WPF C#. Is it possible to share the memory with the same console application as I have done earlier in MFC. Please advise

    Richard Andrew x64R R 2 Replies Last reply
    0
    • M manoharbalu

      I have an application in MFC which creates shared memory using CreateFileMapping where I share a Struct object. In another console application in C++, I am accessing the shared memory using OpenFileMapping function and so the struct object is changed/accessed in both the applications. Now, I want to redevelop my MFC Application in WPF C#. Is it possible to share the memory with the same console application as I have done earlier in MFC. Please advise

      Richard Andrew x64R Online
      Richard Andrew x64R Online
      Richard Andrew x64
      wrote on last edited by
      #2

      I know that the latest .Net frameworks offer classes for file mapping. Search "C# File mapping"

      The difficult we do right away... ...the impossible takes slightly longer.

      M 1 Reply Last reply
      0
      • M manoharbalu

        I have an application in MFC which creates shared memory using CreateFileMapping where I share a Struct object. In another console application in C++, I am accessing the shared memory using OpenFileMapping function and so the struct object is changed/accessed in both the applications. Now, I want to redevelop my MFC Application in WPF C#. Is it possible to share the memory with the same console application as I have done earlier in MFC. Please advise

        R Offline
        R Offline
        Richard Deeming
        wrote on last edited by
        #3

        Memory-mapped files have been supported in .NET Framework since 4.0: Memory-Mapped Files | Microsoft Docs[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        1 Reply Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          I know that the latest .Net frameworks offer classes for file mapping. Search "C# File mapping"

          The difficult we do right away... ...the impossible takes slightly longer.

          M Offline
          M Offline
          manoharbalu
          wrote on last edited by
          #4

          Is it possible that the 2 applications that share the memory (File mapping) be developed in C# and C++ respectively. Example: One application in C# to create shared memory Other application 2 in C++ opens and shares the memory file mapping.

          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