copy files in MFC app - Programmer

This is a discussion on copy files in MFC app - Programmer ; I'd like to copy files from one directory to another from within an MFC application. At the moment I just use ShellExecute() (in the handler for the button that starts the process off) and fire up xcopy to do the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: copy files in MFC app

  1. copy files in MFC app

    I'd like to copy files from one directory to another from within an MFC
    application. At the moment I just use ShellExecute() (in the handler for the
    button that starts the process off) and fire up xcopy to do the work. This
    works ok but a cmd box flashes up and disappears. I think maybe _spawnl() is a
    similar thing(?). Is there a "native" MFC way to to this OS type thing - or a
    better way than the one I'm using? Please don't say I have to write my own file
    copy :-)
    thanks.


  2. Re: copy files in MFC app

    dave wrote:
    > I'd like to copy files from one directory to another from within an MFC
    > application. At the moment I just use ShellExecute() (in the handler for the
    > button that starts the process off) and fire up xcopy to do the work. This
    > works ok but a cmd box flashes up and disappears. I think maybe _spawnl() is a
    > similar thing(?). Is there a "native" MFC way to to this OS type thing - or a
    > better way than the one I'm using? Please don't say I have to write my own file
    > copy :-)
    > thanks.
    >


    You can the call CopyFile(...) or SHFileOperation(...) Win32 APIs.

    --
    Scott McPhillips [VC++ MVP]


  3. Re: copy files in MFC app

    On Mon, 06 Oct 2003 07:34:34 -0500, "Scott McPhillips [MVP]"
    wrote:

    >dave wrote:
    >> I'd like to copy files from one directory to another from within an MFC
    >> application. At the moment I just use ShellExecute() (in the handler for the
    >> button that starts the process off) and fire up xcopy to do the work. This
    >> works ok but a cmd box flashes up and disappears. I think maybe _spawnl() is a
    >> similar thing(?). Is there a "native" MFC way to to this OS type thing - or a
    >> better way than the one I'm using? Please don't say I have to write my own file
    >> copy :-)
    >> thanks.
    >>

    >
    >You can the call CopyFile(...) or SHFileOperation(...) Win32 APIs.

    Thanks Scott. Just what I needed.



+ Reply to Thread