File classes under MFC

Source: Internet
Author: User

 

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.