external-process

Create a WPF “control” that is run in an external process

落花浮王杯 提交于 2019-12-12 09:15:00
问题 I have a WPF app which contains a number of child controls. One of these controls hosts a third party library which underneath the covers runs some native code which throws access violations and crashes the application. Unfortunately removing the library is not an option. What I'd like to do is spin up a new windows process, host the third party library inside that, and somehow communicate with it. Much in the same way that Google Chrome and IE8 handle browser plugins. The issue is that the

How to handle different stdout behaviour in external program?

若如初见. 提交于 2019-12-12 04:45:40
问题 Hi I am trying to execute external program from Java program and read the stdout message in real time , without waiting for the program to exit. However, i found that there are different stdout behaviour in different .exe program, and I don't know how to handle it. Example 1: server1.exe is a console program. When i run it, it will continuously listening on a port. When a client is connected to it, it will generate 1 line of stdout output every 1 second. It will not exit unless i press "ctrl

C - going from ncurses ui to external program and back

旧街凉风 提交于 2019-12-10 13:59:20
问题 I'm making a program that displays some info in ncurses, and then opens vim (using system ) to allow the user to edit a file. After vim is exited, though, the ncurses screen won't redraw. refresh and wrefresh don't do anything, resulting in the complete trashing of my beautiful menu. So, I get sent back to the command line. The menu items redraw when I move to them. Moving around a bit results in something that looks like this: As you can see, I no longer am in my pretty ncurses environment,.

Running a program from within Java code

徘徊边缘 提交于 2019-12-08 04:13:19
问题 What is the simplest way to call a program from with a piece of Java code? (The program I want to run is aiSee and it can be run from command line or from Windows GUI; and I am on Vista but the code will also be run on Linux systems). 回答1: Take a look at Process and Runtime classes. Keep in mind that what you are trying to accomplish is probably not platform independent. Here is a little piece of code that might be helpful: public class YourClass { public static void main(String args[])

Lauch external program in firefox or chrome

让人想犯罪 __ 提交于 2019-12-07 10:54:43
问题 We have a custom web app in our intranet that allow users to browse and search our shared file system in a way more appropriate for our organization. as compared to windows explorer/mac finder. However, when the users click on, for example, a link pointing to a word document the document is downloaded by the browser and then opened. I am trying to provide a better way, namely that the file is opened directly from the shared folder that each user has mapped in his own computer. This will make

Is there a good way to stream the results from an external process into a Visual Studio output pane?

只谈情不闲聊 提交于 2019-12-05 14:47:36
I have a custom output pane set up in a VsPackage similar to the following: ///-------------------------------------------------------------------------------- /// <summary>This property gets the custom output pane.</summary> ///-------------------------------------------------------------------------------- private Guid _customPaneGuid = Guid.Empty; private IVsOutputWindowPane _customPane = null; private IVsOutputWindowPane customPane { get { if (_customPane == null) { IVsOutputWindow outputWindow = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; if (outputWindow != null) { // look

Debugging when my code is started by external program with Process.Start()

▼魔方 西西 提交于 2019-12-03 20:32:36
Suppose I have a C# WinForms application and it is started by external program simply by using Process.Start(MyModule.exe) . I've tried to debug my code by using My project properties -> Debug -> Start Action -> Start external program (with setting proper Working directory of course). My enother attempt was Debug -> Attach to process UPDATE: Both my module and external program use one resource. So external program releases it, then calls Process.Start(), waits for my process to exit ans then capture the resource again. So I can't attach when your program is already running. Both of them failed

system() and CreateProcess() / CreateProcessW()

≯℡__Kan透↙ 提交于 2019-12-03 18:10:05
问题 I want to execute a TEST.exe in a C program. While I use system( "TEST.exe <input-file> output-file" ); I can get what I expected. But CreateProcessW() didn't work properly when I use the following code (see How do I run an external program?): if (CreateProcessW(const_cast<LPCWSTR>(FullPathToExe.c_str()), pwszParam, 0, 0, false, CREATE_DEFAULT_ERROR_MODE, 0, 0, &siStartupInfo, &piProcessInfo) != false) { /* Watch the process. */ dwExitCode = WaitForSingleObject(piProcessInfo.hProcess,

python: run a process with timeout and capture stdout, stderr and exit status [duplicate]

北城余情 提交于 2019-12-03 09:45:34
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: subprocess with timeout What is the easiest way to do the following in Python: Run an external process Capture stdout in a string, stderr, and exit status Set a timeout. I would like something like this: import proc try: status, stdout, stderr = proc.run(["ls", "-l"], timeout=10) except proc.Timeout: print "failed" 回答1: I hate doing the work by myself. Just copy this into your proc.py module. import subprocess

Haskell: How to timeout a function that runs an external command

故事扮演 提交于 2019-12-03 05:10:00
I call an external program inside a function. Now i would like to timeout this function and not just the external program. But after the function times out, the external program is still running on my computer (i'm using debian) until it finishes its computation, after that its thread still remains in the process table as a subthread of my main program until the main program terminates. Here are two minimal examples which illustrates what i would like to do. The first uses unsafePerformIO, the second is completely in the IO monad. I don't really depend on the unsafePerformIO but would like to