In an MFC application, the easiest way to copy a file from one directory to another?

Should I create two CFile objects and copy them to another character by character? Or is there something in the library that will do this for me?

+7
c ++ windows file mfc
source share
2 answers

I would just use the CopyFile function of the Win32 API, but the sample code in CFile :: Open shows how to copy files using CFile (using almost the method that you suggest).

+11
source share

It depends on what you want to do. There are several ways to copy files:

  • CopyFile ()
  • CopyFileEx ()
  • SHFileOperation ()
  • IFileOperation (replaces SHFileOperation () in Vista)
+1
source share

All Articles