这个不难吧,调用dcc32.exe就可以uses Registry;function GetCompilerPath: string; // Returns string containing path to Delphi command line compiler var Reg: TRegistry; begin Reg := TRegistry.Create; try with Reg do begin RootKey := HKEY_LOCAL_MACHINE; OpenKey('\SOFTWARE\Borland\Delphi\6.0', False); Result := ExpandFileName(ReadString('RootDir') + '\bin\dcc32.exe'); end; if AnsiPos(' ', Result) <> 0 then Result := ExtractShortPathName(Result); Result := Result + ' "%s"'; finally Reg.Free; end; end; 编译调用:WinExec(PChar(Format(GetCompilerPath, [FFileName])),
// Returns string containing path to Delphi command line compiler
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
with Reg do begin
RootKey := HKEY_LOCAL_MACHINE; OpenKey('\SOFTWARE\Borland\Delphi\6.0', False);
Result := ExpandFileName(ReadString('RootDir') + '\bin\dcc32.exe');
end;
if AnsiPos(' ', Result) <> 0 then
Result := ExtractShortPathName(Result);
Result := Result + ' "%s"';
finally
Reg.Free;
end;
end;
编译调用:WinExec(PChar(Format(GetCompilerPath, [FFileName])),