How to share HGLOBAL with another application?

后端 未结 4 1653
遇见更好的自我
遇见更好的自我 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:14

    Read the documentation. With the introduction of 32-bit processing, GlobalAlloc() does not actually allocate global memory anymore.

    To share a memory block with another process, you could allocate the block with GlobalAlloc() and put it on the clipboard, then have the other process retreive it. Or you can allocate a block of shared memory using CreateFileMapping() and MapViewOfFile() instead.

提交回复
热议问题