[Lazarus] TProcess

Sven Barth pascaldragon at googlemail.com
Fri Feb 22 13:32:42 CET 2013


On 22.02.2013 11:16, Antonio Fortuny wrote:
>
>
> Le 21/02/2013 16:58, Sven Barth a écrit :
>> On 21.02.2013 14:54, Antonio Fortuny wrote:
>>> I have found one way to launch a new process and it works. The solution
>>> uses CreateProcess whose parameters are set accordingly to MS
>>> specifications: read
>>> http://msdn.microsoft.com/en-us/library/ms885182.aspx
>>>
>>> In the TProcess.Execute, the parameters build for the call to
>>> CreateProcess must be adapted for WinCE. This function works either for
>>> Win32 or WinCE
>>
>> In that case you should be able to use TProcess if you set the Options
>> accordingly (no poNewProcessGroup, but poNewConsole instead). You can
> With these parameters, launching of the new process still fails with
> same error code: 87
>      with TProcess.Create(nil) do try
>        ApplicationName := Config.PocketProgramName;
>        Parameters.Clear;
>        CommandLine := EmptyStr;
>        Environment.Clear;
>        Options := [poNewConsole];
>        InheritHandles := False;
>        try
>          Execute;
>        except
>          got the exception error 87
>        end
>
>> see the WinCE implementation for TProcess in
>> $fpcsrc/packages/fcl-process/src/wince/process.inc
> I've seen that FInheritHandles is forced to true in the first line of
> the Execute method whatever value is set in the property, while MS says
> it is not supported and shlould be false.

Ah, ok. Then this could be the reason for the error. Could you please 
report a bug so that it isn't forgotten? (preferrably with a little test 
program)

Regards,
Sven





More information about the Lazarus mailing list