delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/29/13:46:01

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 29 Oct 2001 13:45:27 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Cc: rdparker AT butlermfg DOT com
Subject: Re: .*Console.* Functions vs. tty
Message-ID: <20011029134527.D14568@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, rdparker AT butlermfg DOT com
References: <E94FF01DFF6CD31186F4080009DC3615035DAEBC AT nttwr2 DOT tower DOT bldgs DOT butlermfg DOT org>
Mime-Version: 1.0
In-Reply-To: <E94FF01DFF6CD31186F4080009DC3615035DAEBC@nttwr2.tower.bldgs.butlermfg.org>
User-Agent: Mutt/1.3.21i

On Mon, Oct 29, 2001 at 12:29:32PM -0600, Parker, Ron wrote:
>I am working on a program that offers a choice of user interfaces at run
>time, similar to what xemacs does.  This application is designed to be
>portable at least between cygwin, Linux, and native Windows.  One of the
>UI's uses the standard console interfaces.  However, when the code runs
>under cygwin with "tty" enabled, I cannot get the console screen buffer
>information.  This is not dependent upon it being a cygwin compiled
>application.  It "malfunctions" if compiled by gcc for cygwin, gcc for
>MinGW, or MSVC.
>
>I have narrowed the problem down to a simple portion of code, which will
>exhibit the same behavior as my application.  The GetConsoleScreenBufferInfo
>function fails with error 6, ERROR_INVALID_HANDLE.  

That would be because stdin is not a console when CYGWIN=tty is
operating.  That's sorta the whole reason for CYGWIN=tty.  It provides
more functionality than a standard Windows console.

>How can I work around this without forcing the user to use "notty"?

You could open a console using 'conin$' as the name or, if it is a
cygwin program, '/dev/conin'.  Use the handle from that as input for
console routines.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019