- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm calling a fortran routine from a c++ menu. The fortran routine simply asks the user a question, but makes use of getcharqq() to intercept the keyboard strokes and echo them as "*" to the screen like a typical passwork entry.
The first time I call the routine, the getcharqq() routine works as programmed. If I exit the fortran and return to the C++ menu, and invoke the fortran code again, the getcharqq() command no longer waits for the user to strike a key, but returns character 255 ( ANSI char code, it's a y with two dots over it ) in an infinite loop.
Background: The C++ routine calls a fortran subroutine that opens a console window (error1 = AllocConsole() ), and subsequently closes the console window ( freeconsole() ) after the fortran returns.
What can I do to fix this? Is there a way to flush the keyboard buffer? Is that even the right question?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may want to consider an alternate approach to this input, such as a dialog box. I'm sure that the Win32 API experts here (I'm not one of them) may have additional thoughts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page