|
|
Line 20: |
Line 20: |
| Sorry, no idea. Please ask this question on the forum or mailing list... much more chance of knowledgeable people responding. | | Sorry, no idea. Please ask this question on the forum or mailing list... much more chance of knowledgeable people responding. |
| --[[User:BigChimp|BigChimp]] 12:37, 12 July 2012 (UTC) | | --[[User:BigChimp|BigChimp]] 12:37, 12 July 2012 (UTC) |
− |
| |
− | = Old stuff =
| |
− | If nobody objects, I'm going to delete this, because it is not relevant anymore for the current page...
| |
− | --[[User:BigChimp|BigChimp]] 12:37, 12 July 2012 (UTC)
| |
− |
| |
− | == Improved example didn't work for me ==
| |
− |
| |
− | I copied the improved example and tried to compile it in lazarus 0.9.7 beta (Date: 22-05-05), using fpc version 2.0.0 [2005/05/16] for i386 - linux, and it gave me this error:
| |
− |
| |
− | project1.lpr(44,15) Error: identifier idents no member "Lines"
| |
− | project1.lpr(44,35) Error: Illegal expression
| |
− | project1.lpr(44,35) Fatal: Syntax error, ";" expected but "(" found
| |
− |
| |
− |
| |
− | The line with error is:
| |
− | AStringList.Lines.ReadFromStream(AProcess.Output);
| |
− |
| |
− | What's wrong ?
| |
− |
| |
− | : I fixed the example. [[User:Vincent|Vincent]] 04:57, 23 May 2005 (PDT)
| |
− |
| |
− | It compiles now, but when I run it freezes. Running step by step I found that it freezes at the line:
| |
− | AProcess.Execute;
| |
− |
| |
− | From a console window, I saw the ppc386 process still running. Then I run 'killall ppc38' and the lazarus program unfroze, and the output.txt file had the right content.
| |
− |
| |
− | I searched the web a little, and found and alternative way to set WaitOnExit, by changing it this way:
| |
− | // AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
| |
− | AProcess.WaitOnExit;
| |
− |
| |
− | Now, when I run it raises an error window with the saying:
| |
− | Project projet1 raised exception class 'External: SIGSEGV'
| |
− | ----
| |
− | :: If you don't give the option ''poUsePipes'', there are no streams to read from. [[User:Vincent|Vincent]] 02:16, 25 May 2005 (PDT)
| |
− |
| |
− | When I click "OK", this windows opens:
| |
− | Execution Paused
| |
− | Adress: $08064782
| |
− | Procedure: CLASSES_TSTRINGS_$__LOADFROMSTREAM$TSTREAM
| |
− | File:
| |
− | (Some day an assembler window might popup here:)
| |
− |
| |
− | I click "OK" again and it shows that the execution stopped at the line:
| |
− |
| |
− | AStringList.LoadFromStream(AProcess.Output);
| |
− |
| |
− | Running step by step I confirm that it's this line that raised this excecption.
| |
− | What can I do ?
| |
− | : I added an example to read more output from the pipe. Tests on my computer indicated a buffer of 64 KB, so unless the output was more then 64 KB, I did not run into trouble. Maybe the pipe buffer on your computer is smaller, so the deadlock occurs for smaller output too. [[User:Vincent|Vincent]] 04:56, 25 May 2005 (PDT)
| |
− |
| |
− | The large output example worked perfectly ! Excelent work!
| |
− | And by the way, excelent support too.
| |
− | Thank you very much !
| |
− |
| |
− | I tried to catch an exception when someone tries to execute an external program, that doesn`t exists.
| |
− | I wasn't able to get the exception on Linux (gtk).
| |
− | If i compiled the Test-App for Win32 the Exception was catchable.
| |
− | What can i do to grap the Exceptions that should come from TProccess under Linux ?
| |
− | Thanks in advance
| |
− | Tanila
| |
− |
| |
− | I wanted to execute a dos batch file from Lazarus.
| |
− |
| |
− | Exec (GetEnv('COMSPEC'), ' /C Kmd.bat');
| |
− |
| |
− | works where Kmd.bat is the required batch file to run
| |
− | and "DOS" is included under the "uses" section.
| |
− |
| |
− | Is this the correct way to do it ?
| |
− |
| |
− | Does anyone know of a better way ?
| |
Not fount examples for started aplications windows managing
I'm seek examples for managen started applications.
My test example not work on Win XP :(
Var
P1 : TProcess;
BEGIN
P1 := TProcess.Create(nil);
P1.CommandLine := 'C:\Windows\notepad.exe';
P1.Options := P1.Options + [poWaitOnExit];
P1.Desktop := '\\.\DISPLAY2';
\\ or
\\P1.Desktop := '2';
END.
How to start or move started application to second display?
Reply
Sorry, no idea. Please ask this question on the forum or mailing list... much more chance of knowledgeable people responding.
--BigChimp 12:37, 12 July 2012 (UTC)