How to get the screen buffer of a console 
Author Message
 How to get the screen buffer of a console

Hi there,

We (me and a friend) are actually working on a project that needs to use
the command line compiler of Delphi. The idea is to let users without
any knowledge of a programming environment compile some code (that they
type within our application) and create a DLL. Thus, as we don't want to
make ourself the code check and compilation, we are calling the command
line compiler Dcc32.exe using CreateProcess. Everything works fine if
the code can be compiled.

A problem appears if the code can't be compiled. Thus, we have to get
the screen buffer of the compiler console to know where an error has
occured during the compilation process. This will let us warn the user
within our application. We have tried to use CreatePipe, but
successless.

Does another way exist to get the errors description from the Dcc32
compiler and if no, how can we read the screen buffer ?

Jack



Wed, 18 Jun 1902 08:00:00 GMT  
 How to get the screen buffer of a console



[stuff snipped about capturing output from dcc32 compiler]

Quote:
>Does another way exist to get the errors description from the Dcc32
>compiler and if no, how can we read the screen buffer ?

How about doing it the old fashioned way and redirecting the output of the
compiler into a file, and then reading the file contents?

dcc32 test.dpr > dcc32.out

Brian



Wed, 18 Jun 1902 08:00:00 GMT  
 How to get the screen buffer of a console

If you call the command-line compiler you can check the ErrorLevel.

--
Greetings,
ASS-Ware.

           ,,,
          (o o)
 -----oOO--(_)--OOo-----
|       ASS-Ware        |
|    is watching you    |
 -----------------------



Quote:
> Hi there,

> We (me and a friend) are actually working on a project that needs to use
> the command line compiler of Delphi. The idea is to let users without
> any knowledge of a programming environment compile some code (that they
> type within our application) and create a DLL. Thus, as we don't want to
> make ourself the code check and compilation, we are calling the command
> line compiler Dcc32.exe using CreateProcess. Everything works fine if
> the code can be compiled.

> A problem appears if the code can't be compiled. Thus, we have to get
> the screen buffer of the compiler console to know where an error has
> occured during the compilation process. This will let us warn the user
> within our application. We have tried to use CreatePipe, but
> successless.

> Does another way exist to get the errors description from the Dcc32
> compiler and if no, how can we read the screen buffer ?

> Jack



Wed, 18 Jun 1902 08:00:00 GMT  
 How to get the screen buffer of a console

Quote:

> How about doing it the old fashioned way and redirecting the output of the
> compiler into a file, and then reading the file contents?

> dcc32 test.dpr > dcc32.out

We have tried that. It works fine if this line is typed within the
Command prompt window, but not when using CreateProcess.

Jack



Wed, 18 Jun 1902 08:00:00 GMT  
 How to get the screen buffer of a console

Quote:


>> How about doing it the old fashioned way and redirecting the output of the
>> compiler into a file, and then reading the file contents?

>> dcc32 test.dpr > dcc32.out
>We have tried that. It works fine if this line is typed within the
>Command prompt window, but not when using CreateProcess.

In Borland Pascal you can do:
 Exec(GetEnv('COMSPEC'),'/C dcc32 test.dpr > dcc32.out')
or in BP for Windoze something like:
 WinExec(StrCat(GetEnvStr(Buf,'COMSPEC'),' /C ...'),sw_...)

If Delphi doesn't support Exec or WinExec, you should ask in the *Delphi* Newsgroups -
well you should anyway, this is Borland Pascal.

Frank



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Getting the screen buffer of a MSDOS window

2. Getting the screen buffer of a MSDOS window

3. Text screen buffer question

4. screen buffer not in mode 13h

5. Screen Buffer problems

6. Help needed on screen buffer

7. graphics screen buffer

8. Getting Data from Screen in Win 95 with TurboPascal 6

9. "Disablecontols" for screen/console?

10. MSSQL server <-> Delphi console application

11. Help: MS-DOS Screen Capture (in Full-Screen Mode) Under Win 95/98/NT

12. Extrair o nome do executável em aplica??o console

 

 
Powered by phpBB® Forum Software