怎样用命令方式编译delphi工程(50分)

  • 主题发起人 wanghaiou3310
  • 开始时间
W

wanghaiou3310

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样用命令方式编译delphi工程,也就是说在delphi编辑器外面编译工程。
 
DCC32 应用程序名
 
DCC32,可以看他的帮助说明
 
各位仁胸能不能给个例子
 
dcc32 dpr(路径+名称)
 
只适合于控制台程序:
If you have Delphi installed and your Path includes the Delphi/Bin directory (where DCC32.EXE and DCC32.CFG reside), you can type this program into a file called GREETING.PAS or GREETING.DPR and compile it by entering
DCC32 GREETING
 
如果我编一个程序用来编译其他delphi工程,我怎样能返回编译信息在一个memo中
 
124. 获得Dos程序的输出屏幕内容
在Delphi程序中如何获得Dos程序的输出屏幕内容(像Delphi编译器 后台执行Dos编译程序,而在IDE界面下给处系统的编译器输出信息)
利用DOS程序的输出重定向功能 dir >> aa.txt 将DOS程序的输出内容生成临时文件aa.txt,使用DELPHI的FileOpen、FileRead等函数取得aa.txt文件的内容,即可。
Delphi6 Win2k:
procedure TForm1.btnRunClick(Sender: TObject);
var
hReadPipe,hWritePipe:THandle;
si:STARTUPINFO;
lsa:SECURITY_ATTRIBUTES;
pi:pROCESS_INFORMATION;
mDosScreen:String;
cchReadBuffer:DWORD;
ph:pChar;
fname:pChar;
i,j:integer;
begin
fname:=allocmem(255);
ph:=AllocMem(5000);
lsa.nLength :=sizeof(SECURITY_ATTRIBUTES);
lsa.lpSecurityDescriptor :=nil;
lsa.bInheritHandle :=True;
if CreatePipe(hReadPipe,hWritePipe,@lsa,0)=false then
begin
ShowMessage('Can not create pipe!');
exit;
end;
fillchar(si,sizeof(STARTUPINFO),0);
si.cb :=sizeof(STARTUPINFO);
si.dwFlags :=(STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW);
si.wShowWindow :=SW_HIDE;
si.hStdOutput :=hWritePipe;
StrPCopy(fname,'CMD.EXE /c dir/w');
if CreateProcess( nil, fname, nil, nil, true, 0, nil, nil, si, pi) = False then
begin
ShowMessage('can not create process');
FreeMem(ph);
FreeMem(fname);
Exit;
end;

while(true)do
begin
if not PeekNamedPipe(hReadPipe,ph,1,@cchReadBuffer,nil,nil) then
break;
if cchReadBuffer<>0 then
begin
if ReadFile(hReadPipe,ph^,4096,cchReadBuffer,nil)=false then
break;
ph[cchReadbuffer]:=chr(0);
Memo1.Lines.Add(ph);
end
else
if(WaitForSingleObject(pi.hProcess ,0)=WAIT_OBJECT_0) then
break;
Sleep(100);
end;
ph[cchReadBuffer]:=chr(0);
Memo1.Lines.Add(ph);
CloseHandle(hReadPipe);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
CloseHandle(hWritePipe);
FreeMem(ph);
FreeMem(fname);
end;


 
手头上有一个 delphi 编译机代码,要吗?留个箱子。
 
我的邮箱是 wanghaiou3310@yahoo.com.cn
 
顶部