Buffer Interaction

  • Thread starter Thread starter Vikram
  • Start date Start date
V

Vikram

Hi,

I would like to make a dos program which can directly
interact with the buffer. I mean that there will be a loop
which will constantly check the the buffer for any pressed
key and if there was a key pressed then store it's value.
I tried to use streambuf class but was unable to do so.

Basically I have made a graphical clock(In Dos) and Dos
does not have multithreading capability. So I want to
press the 's' key to stop the clock or erase the clock and
goto some other menu. The problem is that the clock is
itself in a loop state so I have to put the check for
pressed key in the loop. Now cin>> or cin.getline cannot
be used as it will hault the loop until an input is given
and I don't want the clock to stop. I think that this can
only be done if you can directly access the buffer, which
I'm unable to do.

Please do help and if you have a method which does not
require direct buffer accessing then please post it too.

Thanks,
Vikram.
 
Hi Vikram,

Are you sure you asking this to the right newsgroup?
Dotnet can not run on a Dos computer.
I think you have a better change in a C++ newsgroup (I saw your previous
message).

Cor
 
Hi Cor,

I posted this question because actually I was working with
a Dos program on Visual Studio 6. So I thought that some
other facility of Visual Studio might come into help.

I will look for a C++ Newsgroup.

Thanks,
Vikram.
 
Unless you're using Visual Studio 6 with a different C++ compiler than it
comes with, then I don't think what you're actually making *IS* a DOS
program. As far as I know, Visual Studio 6 only compiles 32-bit Windows
programs. If you are writing a console program, then it is still a Windows
program, and therefore it WILL support multi-threading. There are several
Windows programs that look like DOS programs, like NET, IPCONFIG, START,
etc. But I don't think they'll actually run in DOS.

Remember, DOS isn't the only OS with a console. It's just an OS with ONLY a
console.

Now I've heard of DOS-extenders which can run a simple Win32 console program
under DOS, but that's another story.

--Matthew W. Jackson
 
Back
Top