An Example of the Comments
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at An Example of the Comments.
The following partial listing of class CChildFrame
uses most of the standard comments that MFC employs in its classes to divide class members by the ways they are used:
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
public:
// Operations
public:
// Overrides
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnRangeCmds(UINT nID);
};
These comments consistently mark sections of the class declaration that contain similar kinds of class members. Keep in mind that these are MFC conventions, not set rules.
See Also
Using the MFC Source Files
// Implementation Comment
// Constructors Comment
// Attributes Comment
// Operations Comment
// Overridables Comment