As I work to port a large application system to VC++ 6.0, I encounter
things that don't - the latest is a simple function that determines if a
named floppy drive (A or B) contains a disk. Using _chdir and other
calls I've found don't work, because either a failure produces a system
message error or it doesn't work.
Surely there must be some code that does this. I'd prefer seeing
something that's C-based, as my applications are currently 32 bit DOS
programs (I don't know how to write Windows applications...).
TIA

Re: Detecting Disk in Floppy Drive by William

William
Thu Apr 21 20:24:25 CDT 2005

"Michael R. Copeland" <mrc2323@cox.net> wrote in message
news:MPG.1cd1f8a18e7993ca9896a1@news.west.cox.net...
> As I work to port a large application system to VC++ 6.0, I encounter
> things that don't - the latest is a simple function that determines if a
> named floppy drive (A or B) contains a disk. Using _chdir and other
> calls I've found don't work, because either a failure produces a system
> message error or it doesn't work.
> Surely there must be some code that does this. I'd prefer seeing
> something that's C-based, as my applications are currently 32 bit DOS
> programs (I don't know how to write Windows applications...).

OK. The simplest solution to your problem may be to bracket the code that
checks for the presence of the disk with some like this:

UINT uErrMode = SetErrorMode(SEM_FAILCRITICALERRORS |
SEM_NOOPENFILEERRORBOX);

// Test what you must here, perhaps GetVolumeInformation()?

...

// Restore the old error mode

SetErrorMode(uErrMode);

Regards.
Will



RE: Detecting Disk in Floppy Drive by IceColdFire

IceColdFire
Thu Apr 21 22:54:03 CDT 2005

Hi,

Perhaps I am unaware with the solution...I just need to ask that what do you
mean when you say "32 bit DOS programs"....I think DOS is 16 bit ....also if
you have something as 32 bit DOS , a brief explanation or a link would be
very kind...
Thanks.
a.a.cpp

"Michael R. Copeland" wrote:

> As I work to port a large application system to VC++ 6.0, I encounter
> things that don't - the latest is a simple function that determines if a
> named floppy drive (A or B) contains a disk. Using _chdir and other
> calls I've found don't work, because either a failure produces a system
> message error or it doesn't work.
> Surely there must be some code that does this. I'd prefer seeing
> something that's C-based, as my applications are currently 32 bit DOS
> programs (I don't know how to write Windows applications...).
> TIA
>