home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 8.ddi / MFC / SAMPLES / OSERVER / BIBDOC.H$ / bibdoc
Encoding:
Text File  |  1992-03-16  |  2.2 KB  |  77 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and Microsoft
  7. // QuickHelp documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. /////////////////////////////////////////////////////////////////////////////
  12.  
  13. #ifndef __AFXOLE_H__
  14. #include <afxole.h>
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CBibDoc:
  19.  
  20. class CBibItem;
  21.  
  22. class CBibDoc : public COleServerDoc
  23. {
  24. protected:
  25.     // visual data is stored in listbox
  26.     CListBox*   m_pList;
  27.     const char* m_pszFileName;
  28.     const char* m_pszSectionName;
  29.     CBibItem*   m_pSelectedItem;
  30.  
  31.  
  32. // Construction
  33. public:
  34.     CBibDoc(CListBox* pList, const char* pszFileName,
  35.             const char* pszSectionName);
  36.  
  37. // Attributes
  38.     // cached host names
  39.     CString     m_strHost, m_strHostObj;
  40.  
  41. // Operations
  42.     BOOL    Load();
  43.     void    AddItem(const CString& key, const CString& value);
  44.     void    DeleteItem(const CString& key, int nIndex);
  45.     void    GetItemKeyValue(int nIndex, CString& key, CString& value);
  46.     BOOL    GetItemValue(const CString& key, CString& value);
  47.  
  48.     BOOL    UpdateClient(const CString& string);
  49.  
  50.     // UI specific
  51.     BOOL    ShowItem(const CString& key);   // make visible
  52.  
  53. // Overridables for OLE server document
  54. protected:
  55.     virtual COleServerItem* OnGetDocument();
  56.     virtual COleServerItem* OnGetItem(LPCSTR lpszObjname);
  57.     virtual COleServerItem* GetNextItem(POSITION& rPosition);
  58.     virtual OLESTATUS OnSetHostNames(LPCSTR lpszHost, LPCSTR lpszHostObj);
  59.     virtual OLESTATUS OnRelease();
  60.  
  61. #ifdef _DEBUG
  62. public:
  63.     virtual void Dump(CDumpContext& dc) const;
  64.     virtual void AssertValid() const;
  65. #endif
  66. };
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69. // Defines for max doc data size
  70.  
  71. #define MAX_INI_FILE    20000
  72.     // limit since we are using the Windows Profile API to store data
  73.     // (not a typical or efficient way to manage a database, but it works)
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76.  
  77.