On 8 Oct 2005, at 22:45, Dennis Crawley wrote:I'm changing old code =20 in favor to WinAPIs. > I'm taking a "C" course and the professor doesn=92t like my UART =20 > routines > because they "touch" the hardware directly. :) > For example, we have to use: > CreateFile, WriteFile, ReadFile > from windows.h That's fair enough - direct access to hardware devices won't work in =20 any operating system that makes a distinction between user mode code =20 and kernel mode code - generally speaking only kernel code will be =20 able to touch the hardware directly. Direct hardware access will also =20 mean your program would fail with, for example, a USB to serial =20 converter instead of a real serial port. > They say is in favor of portability (I assume MS portability and =20 > something > to do with permissions), anyway I'm learning a lot. But I got stuck =20 > in a > terminal program. I hope I can use kbhit. Forgot to mention this is a > console32 application. I'm not 100% certain about the history of kbhit() but it was there in =20 the DOS days and if it's still there for XP I think it's reasonable =20 to assume it's been there through all the intermediate operating =20 systems - it's not the kind of function they'd re-introduce just for XP. I've just had a quick Google. I think this page is useful: http://lyxus.net/rw Unfortunately it doesn't display in Safari (nice one MS :) but from =20 what I can see in Google's synopsis it implies that kbhit() has =20 always been available but that they're now deprecating it in favour =20 of _kbhit() (with an underscore). --=20 Andy Armstrong, hexten.net --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist