In the sample listing from class CStdioFile , in An example of the comments , the list includes three member functions under this comment: WriteString and two overloads of ReadString. They're typically named starting with "On", although it's not strictly necessary. Functions here are designed to be overridden, and often implement or provide some sort of "callback" or "hook. In MFC itself, pure virtual functions are always placed in this section. In the sample listing from class CStdioFile , in An example of the comments , the list includes no overridables section.
Class CDocument , on the other hand, lists approximately 10 overridable member functions. These functions are ones that only advanced programmers should attempt to override. You'll probably never need to override them. The conventions described in this article also work well, in general, for Automation formerly known as OLE Automation methods and properties.
Automation methods are similar to MFC operations. Automation properties are similar to MFC attributes. This section houses all implementation details. Both member variables and member functions can appear in this section. Everything below this line could change in a future release of MFC. In addition, members declared below the implementation line are undocumented, although some implementation is discussed in technical notes.
Overrides of virtual functions in the base class reside in this section, regardless of which section the base class function is defined in. When a function overrides the base class implementation, it's considered an implementation detail.
Typically, these members are protected, but not always. Only use these members with caution, because they may change in the future. Declaring a group of members as public may be necessary for the class library implementation to work correctly.
However, it doesn't mean that you may safely use the members so declared. The CFile class provides an interface for general-purpose binary file operations. Read and write a file with CFile. Access file status with CFile. Create a serializable class. Serialize an object via a CArchive object. Create a CArchive object. Store and load CObjects and CObject-derived objects via an archive. Skip to main content. This browser is no longer supported.
Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback? Note This example creates and opens a file. Submit and view feedback for This product This page.
0コメント