|
-
February 1st, 2007, 12:57 AM
#1
Explorer Error
Hi!!
I have made an explorer in C++Borland Builder 6...I used components DriveComboBox,DirectoryListBox and FileListBox and i connnect them.... But when i go to other drives than 'c' with DriveComboBox that dont have anything inside(empty) it brings me an expection: "EInOutError with message I/O error 21". I used the above code to correct it and bring a message to user that the drive is empty but no luck.... If anyone have any ideas on the above code or some new please send some help......
Code:
TDriveComboBox *Control = (TDriveComboBox*)Sender;
AnsiString strRoot = (AnsiString)(char)Control->Drive+":\\";
DWORD dwOldErrorMode;
try
{
dwOldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
try
{
DirectoryListBox1->Drive = Control->Drive;
if(!DirectoryExists(strRoot))
throw EInOutError("");
}
catch(EInOutError &Error)
{
MessageDlg("Drive not ready!",mtError,TMsgDlgButtons()<<mbOK,0);
Control->Drive = 'C';
}
}
__finally
{
SetErrorMode(dwOldErrorMode);
}
Last edited by Ejaz; February 1st, 2007 at 01:50 AM.
Reason: Code tag added
-
February 1st, 2007, 01:03 AM
#2
Re: Explorer Error
You mean the DriveCombo dont have other drives in the list ?
Regards,
Ramkrishna Pawar
-
February 1st, 2007, 03:45 AM
#3
Re: Explorer Error
what you mean drivecombobox is a component where you can see the drives("c:\\,d:\\,) etc. I want some code that when i move in an empty component get a message the user("Drive not ready");
-
February 1st, 2007, 03:49 AM
#4
Re: Explorer Error
What is contents of 'DirectoryExists' ?
What control calls the method you listed? Is it used for callback of several controls since the first line (which seems quite useless to me otherwise)? (TDriveComboBox *Control = (TDriveComboBox*)Sender; )
'You help me, and I, in turn, am helped by you!'
-H.S.
-
February 1st, 2007, 06:35 AM
#5
Re: Explorer Error
My code is OnDriveComboBoxChange event the DirectoryListBox contains folders, the FileListBox contains files and the DriveComboBox contains the drives ofcourse!!!! I cant be more specifiec!!!!!!Sorry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|