createprocess

Why CreateProcess must not be called from a DllMain function?

心不动则不痛 提交于 2019-12-10 23:15:26
问题 I've read in several sources that CreateProcess must not be called from a DllMain function. CreateProcess : Do not call CreateProcess from a DllMain function. This causes the application to stop responding. Dynamic-Link Library Best Practices: You should never perform the following tasks from within DllMain: Call CreateProcess. Creating a process can load another DLL. Question Why is that? it states that it causes the application to stop responding but this is just a symptom. what is the real

CreateProcess and strange nslookup error

孤街浪徒 提交于 2019-12-10 18:47:08
问题 I have this api routine that I use regularly to capture dos output. Recently a strange bug has been found where it doesn't seem to allow dns calls. For instance nslookup will return the "No response from server" error with Server: UnKnown. Ping will work if you supply it an IP address, but not if it has to make a dns call. This problem is completely isolated to this code. Any insight into this problem would be appreciated. Winapi isn't my strongest area. Edit: Sorry for adding all of the

java - Selenium WebDriver failed to create chrome process

守給你的承諾、 提交于 2019-12-10 17:26:51
问题 So I have been trying to make a program that can interact with a webpage to input data. I ideally wanted to use Chrome so I tried to set up Selenium WebDriver and ChromeDriver. import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; public class Chrome { public static void main(String[] args) { //Set chromedriver path System.setProperty("webdriver.chrome.driver","C:/Users/Username/Desktop/Comp Sci work/chromedriver

How to use win32 CreateProcess function to wait until the child done to write to file

扶醉桌前 提交于 2019-12-10 16:58:03
问题 Hello im not win32 programmer and its all new to me. i like to open process from my parent win32 application ( ok this is i know how to do) the child process then write to text file and close it self . how can i detect in the parent application that the child application done writing to the text file . and then from the parent app to read the text file . this is all in win32 c++ Thanks 回答1: A slight modification of Benoits answer. You can create an event in the parent process and wait for

notepadd++配置Scala运行环境

杀马特。学长 韩版系。学妹 提交于 2019-12-10 16:35:54
Window7 下 notepadd++配置Scala运行环境 1、安装notepad++ 2、在notepad++中安装nppexec插件 3、下载Scala最新版,解压到某目录,在环境变量中加入 SCALA_HOME,在控制台验证 scala 4、在notepad++ 中编辑一段Scala 代码,保存然后一次点击 插件 -》 NppExec -》 Execute... F6 在弹出窗口中写入: scala.bat $(FULL_CURRENT_PATH) 使用scala.bat是因为直接使用 scala会报如下错误 scala C:\Users\qingfeng\AppData\Roaming\Notepad++\contextMenu.xml CreateProcess () failed with error code 2: 系统找不到指定的文件。 点击 保 取名scala 然后可以在NppExec 的高级选项中将 刚刚保存的exec 添加到 宏 也可以“设置 -》 编辑弹出菜单”中加入以下代码 <Item id="0"/> <Item FolderName="Run as" PluginEntryName="NppExec" PluginCommandItemName="scala" /> <Item FolderName="Run as" PluginEntryName

How can I start explorer.exe via C++?

不羁的心 提交于 2019-12-10 14:34:12
问题 I'm trying to programmatically start explorer.exe but I'm not having any luck. This is my code: cout << pName << "died, lets restart it." << endl; STARTUPINFO startupInfo = {0}; startupInfo.cb = sizeof(startupInfo); PROCESS_INFORMATION processInformation; if(CreateProcess(pName, NULL, NULL, NULL, false, NORMAL_PRIORITY_CLASS, NULL, NULL, &startupInfo, &processInformation) == 0){ cout << "Error starting " << pName << ": " << GetLastError() << endl; } and pName is explorer.exe Can someone tell

Start a process not as a child

十年热恋 提交于 2019-12-10 14:23:39
问题 I need to start a process and run it as a detached process. I have some sort of starter application which purpose is to run another exe and immediately exit. What is a best way to achieve that? I read CreateProcess documentation several times but still have questions. Documentation says that I need to call CloseHandle after I finish. But my parent app shouldn't wait for a child to exit. Another part of documentation says that I can leave handles alone - the system will close them when the

error C3861: '_tcsdup': identifier not found

蓝咒 提交于 2019-12-10 13:57:35
问题 This is my first time and I'd like to make a parallel process using the windows CreateProcess function. Based on the example at MSDN I created a LPTSTR "(non-const) TCHAR string" command line argument like this LPTSTR szCmdline[] = _tcsdup(TEXT("\C:\\MyProgram_linux_1.1\\MyProgram.exe") ); The LPTSTR and other char and string types are discussed here The command line argument is passed to CreateProcess like this if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout << "ERROR: cannot start

Creating hidden processes (window not visible)

折月煮酒 提交于 2019-12-10 10:02:43
问题 I'm using CreateProcess() with startup flags set to STARTF_USESHOWWINDOW and SW_HIDE to start an application in the background with its window hidden. I'm doing this to run a scheduled maintenance tasks and i don't want to be bothered with windows. In most cases the windows are hidden but there are cases where the program's window pops right out in front of you (for example Google's Chrome - i started testing with different apps to see whether this was a once time problem but nope...). This

Why is %1 rarely substituted in “%1 is not a valid Win32 application.”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 09:41:48
问题 I'm sure most Windows developers are familiar with this error message, usually when trying to mix 32- and 64-bit executables. In particular Python and Java can both get it. %1 is not a valid Win32 application. It's clear that %1 represents the first argument to the failing command - i.e. the executable that is trying to be loaded - but why does it not get filled in with the actual path? Is it something that the caller is doing wrong, or is it a basic failing of some Windows subsystem that