Intercepting DOS Error Message

This is a discussion on Intercepting DOS Error Message within the A Brief History of Cprogramming.com forums, part of the Community Boards category; How do I prevent the MS-DOS message "Disk is Not Ready", when there is no floppy in the drive? My ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    1

    Cool Intercepting DOS Error Message

    How do I prevent the MS-DOS message "Disk is Not Ready", when there is no floppy in the drive? My eventual target is an embedded system that is using a flash card as drive E:. I need to be able to some know if the card is there (is the drive valid or not) or prevent the MS-Dos message from appearing on the screen. I am looking for a solution that really works.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    There are several ways to do this. Just hook the correct int 21h DOS handler. For info on this consult the RBIL.

    Some errors automatically use the critical error handler which is on int 24h

  3. #3
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    I don't know if C++ does anything similar, but Java (which, instructure and syntax, is very similar to C++ (becasue it is derived from C also)) has a system where you label a section try, and catch. You try it, if anything goes wrong, you "catch it". Noodle with it - see what you can came up with.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Most DOS compilers did not support the try/catch mechanism. My BC 4.52 does, but it is a Windows-based IDE. I have Turbo C++ 3.0 and it does not support the try/catch. For other versions I'm really not sure

    Again it is not hard to setup error mechanisms in C compilers that do not support try/catch. It is interrupt driven and exception driven but it still works, just not as nice and neat as try/catch blocks.

  5. #5
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    I just had an idea. you write that part of the code in java, partially compile it(like into a library or object code or something), and then incorporate it into your code like you would with every other library and stuff.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 08:08 PM
  2. winver, winminor, winmajor can it be found from dos?
    By ronin in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-02-2002, 10:32 AM
  3. real mode dos & win dos
    By scott27349 in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-19-2002, 06:15 AM
  4. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 12:42 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 06:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21