473,498 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Peek keyboard-buffer OR a problem with _getts

Hello all,

I'm experiencing weird behaviour of _getts. I've written a rather
simple testclient (console-based) for an OPC-Server. On the first call
of _getts after a connection, the function always returns immediately,
returning an empty string. Every subsequent call to _getts is
successful as long as I don't disconnect and reconnect. However, I
can't identify any code in the (re-)connect-section that might cause
this behaviour.

In order to track this behaviour, I decided that I want to watch the
keyboard-buffer for input in order to check when exactly the suspected
"enter" is inserted into the buffer. Any ideas how that can be
accomplished? Any other ideas on the above problem?

Thanks in advance,
regards,
Carsten.
Jul 19 '05 #1
5 3445
Pelle wrote:
Hello all,

I'm experiencing weird behaviour of _getts. I've written a rather
simple testclient (console-based) for an OPC-Server. On the first call
of _getts after a connection, the function always returns immediately,
returning an empty string. Every subsequent call to _getts is
successful as long as I don't disconnect and reconnect. However, I
can't identify any code in the (re-)connect-section that might cause
this behaviour.


This _getts function (as its underscore shows) is not a standard C++
function. Furthermore standard C++ has no support for keyboard or keyboard
buffers. Unfortunately you will need to ask this question in a group
dedicated to the OS/library giving _getts. This group is for C++ _language_
issues as it is written in the welcome message:

http://www.slack.net/~shiva/welcome.txt

--
Attila aka WW
Jul 19 '05 #2

Attila Feher wrote:
[...]
This group is for C++ _language_ issues as it is written in the
welcome message:

http://www.slack.net/~shiva/welcome.txt


Attila, this "welcome.txt" isn't a charter. At best, it's just a
bunch of electrons. http://www.lyricscafe.com/m/marque/012.htm

regards,
alexander.
Jul 19 '05 #3
Alexander Terekhov wrote:
Attila Feher wrote:
[...]
This group is for C++ _language_ issues as it is written in the
welcome message:

http://www.slack.net/~shiva/welcome.txt


Attila, this "welcome.txt" isn't a charter. At best, it's just a
bunch of electrons. http://www.lyricscafe.com/m/marque/012.htm


Unless of course we handle it as one.

--
Attila aka WW
Jul 19 '05 #4
> > Attila, this "welcome.txt" isn't a charter. At best, it's just a
bunch of electrons. http://www.lyricscafe.com/m/marque/012.htm


Unless of course we handle it as one.


If you call a tail a leg, how many legs does a dog have?
Jul 19 '05 #5
Buster wrote:
Attila, this "welcome.txt" isn't a charter. At best, it's just a
bunch of electrons. http://www.lyricscafe.com/m/marque/012.htm


Unless of course we handle it as one.


If you call a tail a leg, how many legs does a dog have?


What is a leg is a definition. So if *everyone* calls a tail a leg the dog
will have 5 legs (assuming it has four conventional ones). I suggest you
learn to read:

Unless of course *we* handle it as one.

The *we* means *we*. And that is not Alexander and I, but people using this
newsgroup. And OTOH I really do not give a damn what we call that file.
This, and the FAQ-lite together lay down the rules and the purpose for this
newsgroup. Call them green book if you want.

--
Attila aka WW
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
10513
by: les_ander | last post by:
Hi, suppose I am reading lines from a file or stdin. I want to just "peek" in to the next line, and if it starts with a special character I want to break out of a for loop, other wise I want to...
9
5418
by: wizofaus | last post by:
Is the any reason according to the standard that calling tellg() on an std::ifstream after a call to peek() could place the filebuf in an inconsistent state? I think it's a bug in the VC7...
0
1987
by: Ray | last post by:
I have English Windows XP Pro and Office 2003 Pro on my computer. When I enter data into fields of tables, queries and forms of Access 2003, it automatically switches to Chinese keyboard input. ...
11
4877
by: Jeffrey Hiess | last post by:
Something like getchar() doesn't work, since it "waits" for input. #include <stdio.h> while (1) { if (getchar()) /* break if any key is pressed */ { break; }
6
12980
by: daFritz | last post by:
Hi! I need to prevent Task-Switching in my App, so I tried to implement a low level keyboard hook in a extra class. But it seems that the Parameters are not passed correctly to my Hook function....
7
10595
by: Don Riesbeck Jr. | last post by:
I'm working on an application (OEM) using C# that utilizes input from a keyboard, and USB Barcode Scanner. The scanner is a HID Keyboard device, and input from it is sent to the system as if it...
1
15483
by: Shawn | last post by:
Hi. I'm using this code to loop through all the lines in a text field: While myStreamReader.Peek() > -1 myStreamReader.ReadLine() i = i + 1 End While Now, what I need to do is to loop through...
4
4480
by: Manfred Braun | last post by:
Hi All ! I think, there is a bug in the System.Console class related to use the STDIO streams. I am doing a very simple thing in a console-based program named CS Console.In.Peek(); and...
1
4874
by: blahblahblahCCCC | last post by:
This is one of those brain farts i always get.. but i need a peek method in this stack class and am having horrible time figuring out how to do it correctly can someone help me out plz i think it...
14
5229
by: Bob Nelson | last post by:
After completing a good book on C (KNK's 2nd edition), I dusted off an oldie for a good laugh or two. It's Traister's ``Mastering C Pointers'' and I am aware of just how bad this book it. See my...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.