Ewan
Ewan

Reputation: 357

Attaching 2 applications

I have Program A running with some variables. I wish to have a second program - Program B - that can be run seperately and when run will attach itself to Program A. From within Program B I'd like to be able to modify and change certain variables in Program A. Both programs have been written by me.

I have seen this happen with the likes of Dwarf Fortress and Dwarf Therapist which allows you to change various variables in one program which will make the changes in another.

I assume you setup an area of shared memory and reference the variables with pointers but is this possible with C#.Net and if so - how?

Upvotes: 1

Views: 60

Answers (1)

alex
alex

Reputation: 12654

You can use memory-mapped files to create an area of memory, shared between applications.

But the cleaner and more reliable solution would be to introduce an API in your program, so that other programs could interact with it. You can use WCF, Thrift, or other technologies for that.

Upvotes: 2

Related Questions