Share via


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

Concepts

Using the MFC Source Files

The // Implementation Comment

The // Constructors Comment

The // Attributes Comment

The // Operations Comment

The // Overridables Comment