inter-process-communicat

C++: Communication with elevated child process on Windows

别说谁变了你拦得住时间么 提交于 2019-12-22 11:02:25
问题 I'm having the following setup: The DLL I'm writing is loaded dynamically at runtime and offers some API-like functionality to the host application. The host application is not running with admin rights (and therefor my DLL isn't either). Some tasks my DLL needs to fulfill need admin rights though, specifically I have to save and copy files to the program files folder. My current approach is to launch external applications via ShellExecute and the "runas" verb, which triggers the UAC prompt.

How do i run a program from another program and pass data to it via stdin in c or c++?

安稳与你 提交于 2019-12-22 06:28:15
问题 Say i have an exe, lets say sum.exe. Now say the code for sum.exe is void main () { int a,b; scanf ("%d%d", &a, &b); printf ("%d", a+b); } I wanted to know how i could run this program from another c/c++ program and pass input via stdin like they do in online compiler sites like ideone where i type the code in and provide the stdin data in a textbox and that data is accepted by the program using scanf or cin. Also, i wanted to know if there was any way to read the output of this program from

communication between child and parent processes in C linux: parent process not blocking

前提是你 提交于 2019-12-22 01:34:26
问题 I want parent and child processes to communicate in C linux using pipes. First I want parent to pass a string and then child to acknowledge it. I have created two file descriptors. one for parent to child i.e. readpipe and other writepipe for viceversa. The problem is its not taking my data as input. Also I want the printf statements such as "Enter your data" to be printed once but since after fork, there are two processes so they are being displayed twice. Any alternative to that?? /

How do I read and write repeatedly from a process in vim?

北战南征 提交于 2019-12-14 02:10:11
问题 It was hard to phrase this as a question, but here is what I want to do: I want vim to execute a process and to write to its stdin and read from its stdout file descriptors repeatedly. In other words, I want a back-and-forth dialogue between vim and another program. I'll use cat as a simple example. If you run cat with no command-line arguments, then whatever you type on stdin is output to stdout after each newline character. What I would like is to have a vim window which displays the most

WP7 inter process communication

心不动则不痛 提交于 2019-12-11 11:18:31
问题 I am building an music player using Background audio player agent on WP7. I want to enable communication between the UI part and the agent part. Many guides suggest using isolate storage, but I think that is not a good way Is there any way to enable inter-process communication in Windows Phone 7 回答1: In Windows Phone 8 SDK, we can now use system-wide Mutex object. It seems the foreground App and Background Agent run as separate processes on the phone. So even when you instantiate the same

EXC_BAD_INSTRUCTION when sending message to XPC Service

余生长醉 提交于 2019-12-11 00:42:57
问题 I'm trying to use an XPC Service for inter-process communication. I've added an XPC service target to my project, and then when I try doing a xpc_connection_send_message I get EXC_BAD_INSTRUCTION . As far as I can tell, I am correctly initializing and starting the connection. serviceConnection = xpc_connection_create("com.foo.bar.MyService", dispatch_get_main_queue()); xpc_connection_set_event_handler(serviceConnection, ^(xpc_object_t event) { xpc_type_t type = xpc_get_type(event); if (type =

Send data to WPF singleton application from other process

元气小坏坏 提交于 2019-12-10 22:21:24
问题 I have a WPF singleton application, wherein only one instance is running at any time, if user tries to launch another instance, we check if its already running then we kill this new process and bring to front the existing one. Now, we have a requirement to open/access and send message (set of arguments) to this WPF application from another process which can be xls, word, or another standalone application. We also want to make sure that if the process is already running, that process should

Executing an in memory jar

邮差的信 提交于 2019-12-10 14:41:11
问题 Suppose I have a java process that is receiving a runnable jar file from a trusted process in the form of a byte [], is there a way to invoke it without having to write the jar file to disk and then invoke it(start a new process that is running the jar)? 回答1: Here is one way you can accomplish it: Create a ByteArrayInputStream from the byte [] received. Now use JarInputStream to create in-memory representation of the jar file. ByteArrayInputStream bis = new ByteArrayInputStream(byteArray);

C++: Communication with elevated child process on Windows

落花浮王杯 提交于 2019-12-05 22:54:53
I'm having the following setup: The DLL I'm writing is loaded dynamically at runtime and offers some API-like functionality to the host application. The host application is not running with admin rights (and therefor my DLL isn't either). Some tasks my DLL needs to fulfill need admin rights though, specifically I have to save and copy files to the program files folder. My current approach is to launch external applications via ShellExecute and the "runas" verb, which triggers the UAC prompt. This especially means that multiple subsequent actions triggered by the user will always result in an

How do i run a program from another program and pass data to it via stdin in c or c++?

北慕城南 提交于 2019-12-05 10:34:30
Say i have an exe, lets say sum.exe. Now say the code for sum.exe is void main () { int a,b; scanf ("%d%d", &a, &b); printf ("%d", a+b); } I wanted to know how i could run this program from another c/c++ program and pass input via stdin like they do in online compiler sites like ideone where i type the code in and provide the stdin data in a textbox and that data is accepted by the program using scanf or cin. Also, i wanted to know if there was any way to read the output of this program from the original program that started it. How to do so is platform dependent. Under windows, Use CreatePipe