#if !defined(AFX_AVIBUTTON_H__06C64CD2_D7FC_4A20_B09E_83EFA094B01A__INCLUDED_)
#define AFX_AVIBUTTON_H__06C64CD2_D7FC_4A20_B09E_83EFA094B01A__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Avibutton.h : header file
///////////////////////////////////////////////////////////////////////////////
// CAvibutton windowclass CAvibutton : public CButton
{
// Construction
public:
CAvibutton();
         //在这里写方法(1)   
// Attributes
public:
         //在这里写方法(2)   
// Operations
public:
          //在这里写方法(3)   
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAvibutton)
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CAvibutton(); // Generated message map functions
protected:
//{{AFX_MSG(CAvibutton)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG DECLARE_MESSAGE_MAP()
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_AVIBUTTON_H__06C64CD2_D7FC_4A20_B09E_83EFA094B01A__INCLUDED_)
代码是我用MFC新建一个类的头文件,我想了解的就是上面三个地方的访问权限,Public的三个地方声明的函数或方法,即上面的(1,2,3)三个地方是不是效果都是一样的,还是有分别的.

解决方案 »

  1.   

    显然是一样的多个 public 只是为了区分各种不同的公有成员
      

  2.   

    // Construction 
    public: 
    CAvibutton(); 
             //在这里写构造函数    
    // Attributes 
    public: 
             //在这里属性    
    // Operations 
    public: 
              //在这里写方法清晰明确,利于阅读和代码的维护 
      

  3.   

    好样的,这就好办了,哪我怎么ADD才能分别加到上面的Public中去呢,我每次用"增加成员函数"都是加到第三个public中了,哪一,二,中如何加进去....自己写进去去的就没什么意思了.我是想明白如果操作会写分别写到里面去
      

  4.   

    谢谢大家.....没有方法的,因为VC规定了,不管如何ADD,都是加在最后一个PUBLIC上面,所以要到其它的话,只有手工搞定.