怎么调用delphi的编译功能,通过外部命令??????

解决方案 »

  1.   

    这个不难吧,调用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])),
      

  2.   

    FFileName  需要编译的delphi文件名称
      

  3.   

    解决了就好,zhiwuyang602(寇仲) 乖,那你赶紧结贴吧,好久没人给我分分了