File Operation Method
UseVisual C ++Programming:
(1) Usage standardsCRun library functions, includingFopen,Fclose,Fseek.
(2) UseWin16File and directory operation functions, suchLopen,Lclose,Lseek. HoweverWin32These functions are mainly usedWin16Backward compatible.
(3) UseWin32File and directory operation functions, suchCreateFile,CopyFile,DeleteFile,FindNextFileAnd so on.
Win32To open and create filesCreateFileComplete. If the operation is successful,Win32Which is different fromC"FopenThe returned handle. InWin16The handle andCThe operating functions of the running library file are compatible. HoweverWin32Under,"CThe file operation function cannot use this handle. If necessary, you can use the Function_ Open_osfhandleSlaveWin32Handle to get a"C"File handle that can be used by file functions.
Disable File UsageWin32OfCloseHandle.
InWin32,CreateFileObjects that can be operated include not only disk files, but also device files such as communication ports, pipelines, console input, and email slots.
(4) UseCFileAnd its derived class to perform file operations.CFileSlaveCObject