Inter-application communication via shared memory RRS feed

  • Question

  • Hello all,

    How do I get a C# application to read/write to a shared memory variable that is also visible to a VB.NET application?

    Here's what I'm trying to do bear with me guys; I have two applications running in parallel: one written in C# and one written in VB.NET. The C# application is a background windowless application that simply monitors the keyboard and mouse for activity (using a workaround of .NET's no global hooks policy - see previous post for reference); should there not be any user activity for a specified time period, then the C# application should write to a boolean stored in memory. On the other hand, the VB.NET application has a background form with a timer that every x seconds should check the aforementioned boolean residing in memory calling a given function if the boolean is true (meaning there has been no user actiivty in y minutes). At the moment, the communication is done via  a file on the hard-disk; the C# app writes to that file and the VB.NET app reads from that file, but obviously this is not ideal; I would like the variable be stored in memory, not on disk.

    Thanks all.

    N. Farr

    PS. Also posting in the VB forum.

    Tuesday, October 31, 2006 2:42 PM

All replies

  • If I understand your problem correctly, you may want to look at the EventWaitHandle class instead.
    Tuesday, October 31, 2006 4:07 PM