Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Ivanko B
The debugged application where MSEgui has *no* control. === But MSEide may enforce using some tweaks in apps created within it :) 2012/7/13, Martin Schreiber : > On Thursday 12 July 2012 19:43:53 Ivanko B wrote: >> Must be done on child side >> >> Who

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Martin Schreiber
On Thursday 12 July 2012 19:43:53 Ivanko B wrote: > Must be done on child side > > Who is the child ? GDB (we can't rebuild it in order that to taste the > change) ? Or the debugged MSEgui application (we have the full control > of ) ? > The debugged application whe

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Ivanko B
Must be done on child side Who is the child ? GDB (we can't rebuild it in order that to taste the change) ? Or the debugged MSEgui application (we have the full control of ) ? And how to write to si.hStdInput from the parent side?

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Martin Schreiber
On Thursday 12 July 2012 14:33:41 Ivanko B wrote: > Also: > > http://dslweb.nwnexus.com/~ast/dload/guicon.htm > http://www.open-chess.org/viewtopic.php?f=5&t=597&start=10 > http://msdn.microsoft.com/en-us/library/ms682499(v=VS.85).aspx > http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/redi

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Martin Schreiber
On Thursday 12 July 2012 13:29:50 Ivanko B wrote: > Realy, FPC file I/O uses CreateFIle (API in win-32) and > syscall_nr_open(kernel service in LINUX) . > > Me dont' know if it will relate to our issue but there's a discussion > at http://www.rsdn.ru/forum/winapi/2541428.all.aspx > There's a soluti

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Ivanko B
Also: http://dslweb.nwnexus.com/~ast/dload/guicon.htm http://www.open-chess.org/viewtopic.php?f=5&t=597&start=10 http://msdn.microsoft.com/en-us/library/ms682499(v=VS.85).aspx http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/redirecting-standard-io.html Disabling buffering is consider not

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-12 Thread Ivanko B
Realy, FPC file I/O uses CreateFIle (API in win-32) and syscall_nr_open(kernel service in LINUX) . Me dont' know if it will relate to our issue but there's a discussion at http://www.rsdn.ru/forum/winapi/2541428.all.aspx There's a solution - creating a console + getting its stdhandle + killing the

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Thursday 12 July 2012 00:19:46 Ivanko B wrote: > It's a regular MSVCRT/LIBC (importable to FPC via the LIBC units) > procedure, AFAIK. > > http://msdn.microsoft.com/en-us/library/aa272909(v=vs.60).aspx > It works on C-streams (FILE struct). FPC text files are no C-streams. And I don't think it

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Ivanko B
It's a regular MSVCRT/LIBC (importable to FPC via the LIBC units) procedure, AFAIK. http://msdn.microsoft.com/en-us/library/aa272909(v=vs.60).aspx 2012/7/11, Martin Schreiber : > Am 11.07.2012 16:02, schrieb IvankoB: >>> Although I can't believe that Windows does not provide a solution. >>> >>

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
Am 11.07.2012 16:02, schrieb IvankoB: >> Although I can't believe that Windows does not provide a solution. >> > > Working in win-9x as well :) > > PS: > "setvbuf(stdout,0,_IONBF,0)" is a solution - "switch buffering off if it > harms". > How can "setvbuf(stdout,0,_IONBF,0)" be called from pascal o

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Ivanko B
So that not to affect all types of programs it looks best to implement MSEgui version of WRITELN (MWRITELN etc ) - improved by FLUSHing & changing the "File not open" exception with "Console unavailable for this non-console application" or so on. 2012/7/11, IvankoB : >> Although I can't believe t

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
> Although I can't believe that Windows does not provide a solution. > Working in win-9x as well :) PS: "setvbuf(stdout,0,_IONBF,0)" is a solution - "switch buffering off if it harms". -- Live Security Virtual Confere

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
>> Then we should include "TextRec(Output).FlushFunc:= >> TextRec(Output).InOutFunc;" into the GUI program template, sure with >> win32-debug-time-only DEFINEs & short explanations "why" around. >> Oops..And every unit calling WRITELN should include {$apptype console}. -

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 16:43:13 IvankoB wrote: > > setvbuf(stdout,0,_IONBF,0); ? > > The C-stream function called on child side? This is the C equivalent of > > TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc; > > Then we should include "TextRec(Output).FlushFunc:= > TextRec(Output).InOutF

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
> setvbuf(stdout,0,_IONBF,0); ? > The C-stream function called on child side? This is the C equivalent of > TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc; > > Then we should include "TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc;" into the GUI program template, sure with win32-

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Graeme Geldenhuys
Hi IvankoB, On 11 July 2012 11:57, IvankoB wrote: >> or use debugwriteln(). >> > > Excellent option but not too convinient. Could You extend it to be > all-eating (accepting input params of the regular "writeln" - any data > type & arbitrary number of) ? You could also try the dbugintf (debug i

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 16:19:58 IvankoB wrote: > Some advices from the russian site > http://www.rsdn.ru/forum/winapi/2066867.flat.aspx (translated): > > CRT just check the output type with GetFileType and if the result differs >from FILE_TYPE_CHAR then it activates the full buffering STDOUT

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 16:03:22 IvankoB wrote: > > How can one setup a pipe on Windows so that > > getfiletype(handle) > > on the other side of the pipe returns 2? > > " > > Nowbody knows? > > Also some info from ones to blame on : > > http://support.microsoft.com/kb/190351/en-us?fr=1 > Here get

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 15:57:37 IvankoB wrote: > > Jup. Which text? > > //-- > > In wn-32, WRITELN called from within a program won't be printed in the IDE > internal console (because of some STDIO flushing issues) unless the below > code is inserted at beginning of t

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
Some advices from the russian site http://www.rsdn.ru/forum/winapi/2066867.flat.aspx (translated): CRT just check the output type with GetFileType and if the result differs from FILE_TYPE_CHAR then it activates the full buffering STDOUT. The solution for child program: 1) call (stdout,0,_IO

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
> How can one setup a pipe on Windows so that > getfiletype(handle) > on the other side of the pipe returns 2? > " > Nowbody knows? Also some info from ones to blame on : http://support.microsoft.com/kb/190351/en-us?fr=1 -

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
> Jup. Which text? //-- In wn-32, WRITELN called from within a program won't be printed in the IDE internal console (because of some STDIO flushing issues) unless the below code is inserted at beginning of the startup file of the program: {$ifdef mswindows} TextR

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 15:08:16 IvankoB wrote: > >> What's the unit name for TextRec ? > > > > sysutils. > > Now it works. To the "README.DEBUG" ? > Jup. Which text? I can ask here the primary question again: " How can one setup a pipe on Windows so that getfiletype(handle) on the other side o

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
>> What's the unit name for TextRec ? >> > sysutils. > Now it works. To the "README.DEBUG" ? PS: What's the DEFINE to determine that program is in the debug state in order that the below code {$ifdef mswindows} TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc; {$endif was compiled o

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 14:40:33 IvankoB wrote: > > TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc; > > What's the unit name for TextRec ? > sysutils. -- Live Security Virtual Conference Exclusive live event will

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
> TextRec(Output).FlushFunc:= TextRec(Output).InOutFunc; What's the unit name for TextRec ? -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has chan

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Graeme Geldenhuys
Hi Ivanko, On 11 July 2012 11:57, IvankoB wrote: >> or use debugwriteln(). >> > > Excellent option but not too convinient. Could You extend it to be > all-eating (accepting input params of the regular "writeln" - any data > type & arbitrary number of) ? You could also try the dbugintf (debug in

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 13:35:52 IvankoB wrote: > >> Barely usable in stepping since the (external) console hides when me > >> refocus to the IE to press F8. > > > > Use the internal console window. > > It only flushes (shows) written-ln data after the program exits. > http://www.mail-archive.com

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
>> Barely usable in stepping since the (external) console hides when me >> refocus to the IE to press F8. >> > Use the internal console window. > It only flushes (shows) written-ln data after the program exits. -- Live S

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 12:57:11 IvankoB wrote: > >> Neither "Show console on Run" or "Use external console" help to beat the > >> "File not open" exception. > > > > {$apptype console} > > Barely usable in stepping since the (external) console hides when me > refocus to the IE to press F8. > Use

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
>> Neither "Show console on Run" or "Use external console" help to beat the >> "File not open" exception. >> > {$apptype console} Barely usable in stepping since the (external) console hides when me refocus to the IE to press F8. > or use debugwriteln(). > Excellent option but not too convinien

Re: [MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread Martin Schreiber
On Wednesday 11 July 2012 09:34:33 IvankoB wrote: > Neither "Show console on Run" or "Use external console" help to beat the > "File not open" exception. > {$apptype console} or use debugwriteln(). Martin -- Live Security

[MSEide-MSEgui-talk] win-32: how to use "writeln" (writting to a cosnole window)

2012-07-11 Thread IvankoB
Neither "Show console on Run" or "Use external console" help to beat the "File not open" exception. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape