简体   繁体   中英

How to change variables in a running program?

For example I have a vector in my c++ program:

vector<string> files;

And this program is already running.

I want to invoke my other program to dynamically add a string to files vector (in already running program).

Should I make a client-server application on localhost for that?
Or are there other methods? (how to send message with params to the running program)

I can't give a great answer because I'm not experienced, but these are a few of the things I'm planning to look into:

Maybe something in there will be useful for you. Interprocess communication is the term you want to search for (IPC).

There are quite a few ways to do this. Google for Inter process communication. http://en.wikipedia.org/wiki/Inter-process_communication

On Windows I would use something like that: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366551(v=vs.85).aspx

Or just a temporary file if I you want to be quick and dirty about it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM