home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / mfcbind / cntritem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.4 KB  |  75 lines

  1. // CntrItem.h : interface of the CMFCBindCntrItem class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #if !defined(AFX_CNTRITEM_H__C3B1822C_2457_11D1_A4EC_00C04FD91A9F__INCLUDED_)
  14. #define AFX_CNTRITEM_H__C3B1822C_2457_11D1_A4EC_00C04FD91A9F__INCLUDED_
  15.  
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19.  
  20. class CMFCBindDoc;
  21. class CMFCBindView;
  22.  
  23. class CMFCBindCntrItem : public COleDocObjectItem
  24. {
  25.     DECLARE_SERIAL(CMFCBindCntrItem)
  26.  
  27. // Constructors
  28. public:
  29.     CMFCBindCntrItem(CMFCBindDoc* pContainer = NULL);
  30.         // Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE.
  31.         //  IMPLEMENT_SERIALIZE requires the class have a constructor with
  32.         //  zero arguments.  Normally, OLE items are constructed with a
  33.         //  non-NULL document pointer.
  34.  
  35. // Attributes
  36. public:
  37.     CMFCBindDoc* GetDocument()
  38.         { return (CMFCBindDoc*)COleDocObjectItem::GetDocument(); }
  39.     CMFCBindView* GetActiveView()
  40.         { return (CMFCBindView*)COleDocObjectItem::GetActiveView(); }
  41.  
  42.     // ClassWizard generated virtual function overrides
  43.     //{{AFX_VIRTUAL(CMFCBindCntrItem)
  44.     public:
  45.     virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
  46.     virtual void OnActivate();
  47.     protected:
  48.     virtual void OnGetItemPosition(CRect& rPosition);
  49.     virtual void OnDeactivateUI(BOOL bUndoable);
  50.     virtual BOOL OnChangeItemPosition(const CRect& rectPos);
  51.     //}}AFX_VIRTUAL
  52.  
  53. // Implementation
  54. public:
  55.     void LoadFromMoniker(LPUNKNOWN pUnk, OLECHAR* swzName);
  56.     BOOL FinishCreate(SCODE sc);
  57.     void ProcessNewObject();
  58.  
  59.     static int m_nDocID;
  60.  
  61.     ~CMFCBindCntrItem();
  62. #ifdef _DEBUG
  63.     virtual void AssertValid() const;
  64.     virtual void Dump(CDumpContext& dc) const;
  65. #endif
  66.     virtual void Serialize(CArchive& ar);
  67. };
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70.  
  71. //{{AFX_INSERT_LOCATION}}
  72. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  73.  
  74. #endif // !defined(AFX_CNTRITEM_H__C3B1822C_2457_11D1_A4EC_00C04FD91A9F__INCLUDED_)
  75.