I wonder if it is possible to start a function in a running c++ program, from outside the program. For example I have a Labview program, and I would like this program to call a function in the c++ program. Is this possible? What would be a fast way to do this?
calling a function in a running c++ program with another program
Is this possible?
Not directly, no.
It is possible to communicate between processes, and inform the running process, that it should call its own function. Also, abstraction layers have been designed, which allow abstracting away the implementation details and program as if the function is executed locally. For example: CORBA.
Standard C++ has neither a high level IPC (inter process communication) abstraction API, nor even a low level IPC API - although networking is proposed for an upcoming standard.
What would be a fast way to do this?
If your processes run on the same system, then shared memory is a relatively fast IPC mechanism if your system supports it.