Board index » cppbuilder » Directory list choosing cd rom

Directory list choosing cd rom

Hi

I read the post about filelistbox exception handling, but in DirectoryList,
i try to handle the exception on DirectoryList::OnChange, any ideas how to
check if the drive has the floppy or the cdrom so that it cant cause an
exception?

Thanks

 

Re:Directory list choosing cd rom


Call the Win32 API function SetErrorMode() with the SEM_NOOPENFILEERRORBOX
flag, that will prevent the exception (which is coming from the system
itself) and allow your code to handle the error.  The exception only occurs
when you don't have any disk in the drive.

Gambit

Quote
"Nylren" <nogue...@sj.univali.br> wrote in message news:3c2200d9_1@dnews...
> I read the post about filelistbox exception handling, but in
DirectoryList,
> i try to handle the exception on DirectoryList::OnChange, any ideas how to
> check if the drive has the floppy or the cdrom so that it cant cause an
> exception?

Other Threads