[fpc-devel] Console IO revisited

Thaddy thaddy at thaddy.com
Fri Dec 3 13:38:05 CET 2010


On 3-12-2010 13:22, Thaddy wrote:

---

CreateFile;

/lpFileName/

	

Use the CONIN$ value to specify console input.

Use the CONOUT$ value to specify console output.

CONIN$ gets a handle to the console input buffer, even if the 
*SetStdHandle* 
<http://msdn.microsoft.com/en-us/library/ms686244%28v=VS.85%29.aspx> 
function redirects the standard input handle. To get the standard input 
handle, use the *GetStdHandle* 
<http://msdn.microsoft.com/en-us/library/ms683231%28v=VS.85%29.aspx>function.

CONOUT$ gets a handle to the active screen buffer, even if 
*SetStdHandle* 
<http://msdn.microsoft.com/en-us/library/ms686244%28v=VS.85%29.aspx>redirects 
the standard output handle. To get the standard output handle, use 
*GetStdHandle* 
<http://msdn.microsoft.com/en-us/library/ms683231%28v=VS.85%29.aspx>.

//



This behaveour is broken in FPC without intervention from the programmer 
in a very "unusual" way. (i.e. without hacks)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20101203/a9b362da/attachment.html>


More information about the fpc-devel mailing list