我的部分代码:
Prog := 'p.exe'
FileName := 'a.txt'
CommandLine := Prog + ' ' + FileName;
Dir := 'c:\temp';
.......
B := CreateProcess(Nil, PChar(CommandLine), nil, nil, True, CREATE_NEW_CONSOLE, nil, PChar(Dir), StartInfo, ProceInfo ); Showmessage(CommandLine);
ShowMessage(GetCommandLine);
.......第一个显示 'p.exe a.txt'
第二个显示 'c:\temp\Project1.exe'为什么阿,CommandLine要什么内容阿,不是DOS下输入的命令行么?
在线等
Prog := 'p.exe'
FileName := 'a.txt'
CommandLine := Prog + ' ' + FileName;
Dir := 'c:\temp';
.......
B := CreateProcess(Nil, PChar(CommandLine), nil, nil, True, CREATE_NEW_CONSOLE, nil, PChar(Dir), StartInfo, ProceInfo ); Showmessage(CommandLine);
ShowMessage(GetCommandLine);
.......第一个显示 'p.exe a.txt'
第二个显示 'c:\temp\Project1.exe'为什么阿,CommandLine要什么内容阿,不是DOS下输入的命令行么?
在线等
解决方案 »
- fastreport如何让设计页面中文化
- 在DELPHI7中把一个窗口的formstyle改为MDI后,再改回成NORMAL
- 如何在打开的Excel中增加一个新的sheet4,并将数据写入新的sheet4,如何保存数据(Excel文件名保持不变)??
- 自己写的控件,换了目录后,exe编译提示找不到编译后的单元(.dcu)?
- 使用case of判断字符串出错,如何解决
- 诚招南京地区成熟程序员2名
- 有关SQLConnection(SqlExpr)组件的应用问题。
- 一个菜鸟的问题
- 怎么注册一个COM+服务器,客户端怎么连接COM+服务器~
- 请问哪位大侠知道如何使用TeamSource??谢谢!!
- 求助谁能帮我翻译一下Asta的帮助
- 救助一个很菜的窗体问题!
如果Dos下输入p.exe a.txt 可以执行,为什么用Delphi 调用会死机阿?
commandline :='a.txt'
createProcess(pchar(prog), Pchar(commandLine)......
和
Commandline :='p.exe a.txt';
CreateProcess (nil, Pchar(CommandLine)...
有什么区别阿?
请高人指点
大把的关于CreateProcess的内容。