【发布时间】:2015-03-09 08:02:40
【问题描述】:
LPCTSTR applicationName = NUL // NULL => module name from command line
string argument1 = "something";
string argument2 = "anotherthing";
LPTSTR commandLine = "childpath\\child.exe";
success = CreateProcess(
applicationName,
commandLine,
processSecurityAttrs,etc...)
我在这里尝试做的是尝试将父母的命令行参数传递给孩子。但它是LPTSTR,我不知道如何组合string和LPTSTR类型并传递给孩子。它给了我类型def。错误。我使用 Visual Studio 2013 和 C++。
【问题讨论】:
-
具体描述您想要做什么以及您尝试过的内容。
-
LPCTSTR是一个定义为const char *或const wchar_t *的宏。您可以从std::string或std::wstring获得它,这意味着您不必“组合”任何东西,只需坚持std::string或std::wstring,并在需要时获取一个C 字符串指针。跨度>
标签: c++ windows command-line pipe lptstr