CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Explorer Error

Threaded View

  1. #1
    Join Date
    Jul 2006
    Posts
    285

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured