The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: skywalker on May 03, 2007, 01:27:20 AM

Title: No error message displayed
Post by: skywalker on May 03, 2007, 01:27:20 AM
How do I get this to not show an error message when there is no disk in the drive.
I can't find  0000000F returned  in any register either.

Thanks.

  File1 db "a:\", 0 ; file names are case sensitive

.code

start:

main proc

    LOCAL buffer[260]:BYTE
    invoke GetCL,1,ADDR buffer
invoke GetFileAttributes,offset File1
       
Title: Re: No error message displayed
Post by: sinsi on May 03, 2007, 02:11:30 AM
    invoke SetErrorMode,SEM_FAILCRITICALERRORS

CreateFile and GetVolumeInformation both say basically the same thing:
QuoteWhen a user attempts to get information about a floppy drive that does not have a floppy disk, or a CD-ROM drive that does not have a compact disc, the system displays a message box for the user to insert a floppy disk or a compact disc, respectively. To prevent the system from displaying this message box, call the SetErrorMode function with SEM_FAILCRITICALERRORS.
I would assume it works the same for GetFileAttributes.
Title: Re: No error message displayed
Post by: skywalker on May 03, 2007, 02:55:10 AM
Thanks, it worked.