Error using CreateFileMapping - C

后端 未结 6 1978
梦谈多话
梦谈多话 2021-01-24 20:38

I am using the tutorial on this MSDN link to implement a way of transferring data from one process to another. Although I was advised in an earlier question to use the Pipe meth

6条回答
  •  失恋的感觉
    2021-01-24 21:26

    Your code for the producer works for me. What version of Windows are you using? In newer versions (like Vista and 7) there are additional security restrictions placed on accessing shared memory. There is a note about this in the MSDN article you referenced above, saying that you must be an Administrator to create global shared memory objects in Windows Vista/7.

    You should also make a call to GetLastError() to see which error code is actually returned from CreateFileMapping(), that may be helpful in determining the root cause of the problem.

提交回复
热议问题