How to share HGLOBAL with another application?

后端 未结 4 1705
遇见更好的自我
遇见更好的自我 2021-01-27 00:12

I\'m trying to understand something about HGLOBALs, because I just found out that what I thought is simply wrong.

In app A I GlobalAlloc() data

4条回答
  •  梦谈多话
    2021-01-27 00:19

    Each process "thinks" that it owns the full memory space available on the computer. No process can "see" the memory space of another process. As such, normally, nothing a process stores can be seen by another process.

    Because it can be necessary to pass information between processess, certain mechanisms exists to provide this functionality.

    One approach is message passing; one process issues a message to another, for example over a pipe, or a socket, or by a Windows message.

    Another is shared memory, where a given block of memory is made available to two or more processes, such that whatever one process writes can be seen by the others.

提交回复
热议问题