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

Thread: Explorer Error

  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

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Explorer Error

    You mean the DriveCombo dont have other drives in the list ?
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Jul 2006
    Posts
    285

    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");

  4. #4
    Join Date
    Oct 2005
    Posts
    199

    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.

  5. #5
    Join Date
    Jul 2006
    Posts
    285

    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
  •  





Click Here to Expand Forum to Full Width

Featured