Board index » delphi » Drive combo box problem

Drive combo box problem

Can somebody tell me how to handle the following error with drive
combo box: When the user selects for example drive A:, and there is
nothing in the drive, program prompts an message box with I/O error.
Is there possiblity to display a messagebox saying drive A is
inaccesible, RETRY, CANEL ?
I can't do that because th OnChange event of the drive combo box
happens after it tries to access the drive.

Hope somebody can help me, Please a-mail me on ivan.a...@zd.tel.hr if
you can.

Thanks.

      Ivan Azic
ivan.a...@zd.tel.hr

 

Re:Drive combo box problem


Quote
> Can somebody tell me how to handle the following error with drive
> combo box: When the user selects for example drive A:, and there is
> nothing in the drive, program prompts an message box with I/O error.
> Is there possiblity to display a messagebox saying drive A is
> inaccesible, RETRY, CANEL ?
> I can't do that because th OnChange event of the drive combo box
> happens after it tries to access the drive.

I believe ONCLICK is executed before the change, irregardless of whether
a mouse click or a keypress causes the change.  Do you know what you
need to do from there?  If not, mail me..

--
--------------------------
Eric Lawrence
Delta Programming Group
Delta...@juno.com

Re:Drive combo box problem


Ivan Azic wrote

Quote
> Can somebody tell me how to handle the following error with drive
> combo box: When the user selects for example drive A:, and there is
> nothing in the drive, program prompts an message box with I/O error.
> Is there possiblity to display a messagebox saying drive A is
> inaccesible, RETRY, CANEL ?
> I can't do that because th OnChange event of the drive combo box
> happens after it tries to access the drive.

> Hope somebody can help me, Please a-mail me on ivan.a...@zd.tel.hr if
> you can.

> Thanks.

>       Ivan Azic
> ivan.a...@zd.tel.hr

A solution is to disable critical I/O Errors being displayed and handle the
error yourself.
To disable critical I/O Errors use the following code:

var ErrorMode : word

{ Get the current ErrorMode to restore it afterwards }
ErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS);

{ Put your own code here }

{ Reset ErrorMode to its original value }
SetErrorMode(ErrorMode);

Sander Carmiggelt
carmi...@xs4all.nl

Other Threads