Re: CopyFile inexplicably fails to work

From: Peter Below (TeamB) (100113.1101_at_compuXXserve.com)
Date: 01/23/04

  • Next message: Peter Below (TeamB): "Re: WinExecAndWaitV2, ok but a question:"
    Date: Fri, 23 Jan 2004 19:43:10 +0100
    
    

    In article <401142A3.21F96215@intermediainternational.com>, Intermedia
    International Inc wrote:
    > Any suggestions about the problem or an avenue for testing/debugging?

    You are not closing the find handle you get from FindFirstFile. Use
    Windows.FindClose for that. You are not freeing the memory for the message
    buffer FormatMessage returns to you.

    You are making your life unduely difficult by using API routines where there
    are equivalent Delphi routines (FindFirst, SysErrorMessage).

    You may want to look at the ShFileOperation API function for the copy
    operation. It allows you to copy several files in a single call, to use
    wildcards, and to (optionally) show a progress dialog.

    --
    Peter Below (TeamB)  
    Use the newsgroup archives :
    http://www.mers.com/searchsite.html
    http://www.tamaracka.com/search.htm
    http://groups.google.com
    http://www.prolix.be
    

  • Next message: Peter Below (TeamB): "Re: WinExecAndWaitV2, ok but a question:"