Results 1 to 3 of 3

Thread: Explorer Copy Dialog Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    6

    Post Explorer Copy Dialog Box

    I am using the SHFileOperation function to copy files so I can display the explorer copy dialog box.
    However, I am having a problem trapping an error. I am copying the same file to a number of different folders, which normally works fine. But when I attempt to copy the file to a folder where the user has the file open I get the "Cannot Access File" error dialog box. How can I trap this error? I have the flags set to:
    .fFlags = FOF_SIMPLEPROGRESS Or FOF_NOCONFIRMATION
    I have the NoConfirmation flag set because I want the new file to have the same name as the existing file, but do not want the "Do you want to replace......." dialog box to appear. The program runs as a scheduled event so user intervention is not an option. Prior to using the explorer copy I just used the file copy statement and used the err.number to determine how to handler the error.
    Thanks for any help.
    Jack

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I suggest you go back to the old method as at least you can trap the error without too much hassle...

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Include the FOF_NOERRORUI Flag and the Error dialog should not be displayed, then you can use the return value of the function to determine if an error occured and handle it accordingly.
    VB Code:
    1. Private Const FOF_NOERRORUI = &H400

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