home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / daolibb / daocontr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-27  |  967 b   |  29 lines

  1. #if !defined(__daocontrol_h)
  2. #define __daocontrol_h
  3.  
  4. //This is the base class for control objects. They must inherit from this
  5. //in addition to their MFC hierarchy.
  6. //It manages database data retrieving and storing.
  7.  
  8. #define DAOCONTROL(name) m_##name = #name
  9.                     //Macro for initializing control objects
  10.  
  11. class DaoControl : public _FieldPtr {
  12.     virtual void Transfer(BOOL bSaveAndValidate) = 0;
  13.         //This forces derived classes to implement the transfer mechanism.
  14. protected:
  15.     _variant_t index;
  16.         //Attribute for the field class. It can be a field name or a field index.
  17.     void DDX_Control(CDataExchange *pDX);
  18.         //Binding method. It manages collaboration between the GUI 
  19.         //and database components.
  20. public:
  21.     DaoControl();
  22.     DaoControl& operator=(_variant_t const &);
  23.         //Assignment operator. Each derived class must override this.
  24.     virtual void Enable(bool e = true) = 0;
  25.         //User interface enabling/disabling mandatory method.
  26. };
  27.  
  28.  
  29. #endif