createprocess

CreateProcess and CreatePipe to execute a process and return output as a string in VC++

送分小仙女□ 提交于 2019-11-29 10:26:30
问题 I am trying to use CreateProcess and CreatePipe to execute a process from within a Windows Forms C++/CLR application in Visual Studio 2010. From within my Windows forms app I want to execute a child process (console app) and return the output as a std::string , std::wstring , or System::String^ within my Windows forms app. Additionally, I do not want the newly created child process to spawn a window. The console application is of my own creation, so I have control of it's source too. I have

CreateProcess with new console window, but override some std i/o handles

廉价感情. 提交于 2019-11-29 05:06:01
If you use CreateProcess with the flag CREATE_NEW_CONSOLE, the new process has its standard input, output, and error handles directed to the new console window. If you want to override the I/O streams, you can do so by setting the handles in STARTUPINFO fields hStdOutput, hStdInput, and hStdError and setting the flag STARTF_USESTDHANDLES. But what if you want to override only one of the handles? For example, I might want to redirect stderr to a file while leaving the stdout and stdin connected to the new console window. The STARTF_USESTDHANDLES flag tells CreateProcess to replace all of the

Intellij IDEA错误“CreateProcess error=2, 系统找不到指定的文件”完美解决

我的梦境 提交于 2019-11-29 03:41:44
Error:Cannot run program "F:\WINDOWS应用安装\IntelliJ IDEA 2018.1\jre\bin\java" (in directory "C:\Users\李俊德\.IntelliJIdea2018.1\system\compile-server"): CreateProcess error=2, 系统找不到指定的文件。 错误解决办法: File-Project Structure Project- JDK一定不能是红色的,否则就会出现上述的错误 正确安装最新的JDK和JRE后,点击 New... 选择“正确安装最新的JDK”的路径,即可 OK后再次编译Run便可正常运行 来源: CSDN 作者: 萌新李同学(李俊德-大连理工大学) 链接: https://blog.csdn.net/wq6ylg08/article/details/80523082

Access Violation in function CreateProcess in Delphi 2009

China☆狼群 提交于 2019-11-28 21:38:44
In my program I've the following code: //Code if not CreateProcess(nil, NonConstCmd, nil, nil, True, NORMAL_PRIORITY_CLASS or CREATE_NEW_PROCESS_GROUP, nil, PCh, SI, P) then //Code And I keep getting Access violation error. By the way, in Delphi7 the same code works perfectly. I've read MSDN and found that CreateProcess function in Delphi can modify the second argument. Inititally It was const, that's why I create a new variable with the same value. But it takes no effect. The question is: why doesn't this code work? The problem is in the lpCommandLine parameter. I suspect you are doing

Linux CreateProcess?

旧时模样 提交于 2019-11-28 12:10:16
I develop on the linux platform. I want to create a new proccess in my library without replacing the current executing image. Because I am developing a library, I don't have a main function. And I want to continue the new process after the invoker application closes (Just like CreateProcess Windows API). Is it possible in Linux or not? something like this function: void Linux_CreateProcess(const char* app_name) { // Executing app_name. // ???????? what is the code ?????? // app_name is running and never close if current application close. return; } Note: system() blocks the current process, it

Making CreateProcess inherit the console of the calling process

烂漫一生 提交于 2019-11-28 11:21:31
When I call CreateProcess in Windows, the new process doesn't seem to inherit the console of the calling process. I made a test program that runs "ruby xtest", xtest being a script that writes "hello" to standard output. I ran this test program from Emacs, and get no output. I also tried the following code calling GetStdHandle, but again, no output. Then I tried passing CREATE_NEW_CONSOLE in dwCreationFlags to CreateProcess, which made a whole new window with the Ruby output. Finally, I made a simple fork/exec test program and compiled it using Cygwin's GCC. This program worked: the Ruby

Is it possible to execute a .NET dll without an exe to load it?

核能气质少年 提交于 2019-11-28 08:09:34
I'm curious if there's a way to execute a static .DLL method in a new process without having to create an .EXE for it? AFAIK, this isn't possible with native Win32/64 DLLs. How about .NET DLL assemblies? UPDATE : I forgot to mention I'm primarily interested in doing this programmatically (from C# code, to be specific). Thanks! CONCLUSION : Although no one "dared" to spell it out, the answers all seem to lean towards 'no'. One needs to start a process through one of the conventional ways (EXE, PowerShell, etc.) then convince that process to load the DLL and execute the code within. I guess I

How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits

六眼飞鱼酱① 提交于 2019-11-28 07:39:24
Q: I have a windows service that spawns a lot of child processes. There seems to be some limit, around 100, where the process cannot be launched. The CreateProcess() call comes back with a pid, but then the process just fails to materialize. If I run our server as a console application instead, this limit goes away. Also, If I set the DETACHED_PROCESS flag, this limit more than doubles. However, I get failures if I set DETACHED_PROCESS and call CreateProcesssWithLogonW(). This is a "desktop heap" problem. A very good discussion can be found here: Desktop Heap Overview Note that this only

Unhandled Error with CreateProcess [duplicate]

雨燕双飞 提交于 2019-11-28 04:31:03
问题 This question already has an answer here: CreateProcess method ends up with an error 1 answer I was reading about CreateProcess function in c++ and I wanted to try it. Basic idea of the code is to have my main execute another process (notepad). Really, it’s just the basic code. When I run the program, I get: First-chance exception at 0x752bb763 in createprocess.exe: 0xC0000005: Access violation writing location 0x00be57b8. Unhandled exception at 0x752bb763 in createprocess.exe: 0xC0000005:

Ndk-build: CreateProcess: make (e=87): The parameter is incorrect

狂风中的少年 提交于 2019-11-28 04:23:09
I get an error when build static lib with NDK on Windows platform: process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed. make (e=87): The parameter is incorrect. make: *** [obj/local/armeabi-v7a/staticlib.a] Error 87 make: *** Waiting for unfinished jobs.... All source files build successfully, and this error occur when compose object files. I don't get this error when build this project in Ubuntu, it occur only on Windows. I suppose I found the issue : second parameter of