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

  1. // obj_vw.h
  2. //
  3. // Interface def for CObjTreeView
  4. //
  5.  
  6. // This is a part of the Microsoft Foundation Classes C++ library.
  7. // Copyright (C) 1992-1998 Microsoft Corporation
  8. // All rights reserved.
  9. //
  10. // This source code is only intended as a supplement to the
  11. // Microsoft Foundation Classes Reference and related
  12. // electronic documentation provided with the library.
  13. // See these sources for detailed information regarding the
  14. // Microsoft Foundation Classes product.
  15.  
  16. #ifndef _OBJ_VW_H_
  17. #define _OBJ_VW_H_
  18.  
  19. #include "view.h"
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CObjectData
  23.  
  24. class CObjectData : public CObject
  25. {
  26.     DECLARE_DYNCREATE(CObjectData)
  27. public:
  28.     CObjectData() ;
  29.     virtual ~CObjectData() ;
  30.  
  31.     HRESULT CreateInstance( DWORD clsctx ) ;
  32.     BOOL Release() ;
  33.  
  34.     DWORD           m_nType;
  35.  
  36.     CLSID           m_clsid ;
  37.     TCHAR           m_szProgID[40] ; // max 39 chars
  38.     WORD            m_wMajorVer, m_wMinorVer ;
  39.     UINT            m_uiBitmap ;
  40.     IClassFactory*  m_pcf ;
  41.     IUnknown*       m_punk ;
  42.  
  43.     enum {
  44.         typeUnknown,
  45.         typeObject,
  46.         typeTypeLib,
  47.         typeInterface,
  48.         typeStaticInterface
  49.     };
  50.  
  51. } ;
  52.  
  53.  
  54. class CObjTreeView : public CTreeView
  55. {
  56.     DECLARE_DYNCREATE(CObjTreeView)
  57. protected: // create from serialization only
  58.     CObjTreeView();
  59.  
  60. // Attributes
  61. public:
  62.  
  63.     COle2ViewDoc* GetDocument();
  64.     HTREEITEM     m_hObjects;
  65.     HTREEITEM     m_hTypeLibs ;
  66.     HTREEITEM     m_hInterfaces;
  67.  
  68.     HTREEITEM     m_hInsertable ;
  69.     HTREEITEM     m_hControls ;
  70.     HTREEITEM     m_hInternal ;
  71. #ifdef SHOW_CONTAINERS
  72.     HTREEITEM     m_hContainers ;
  73. #endif
  74.     HTREEITEM     m_hOLE1 ;
  75.     HTREEITEM     m_hUnclassified ;
  76.  
  77. // Operations
  78. public:
  79.     void DeleteTreeContents() ;
  80.     void DeleteTreeItems( HTREEITEM htree ) ;
  81.     BOOL IsValidSel() ;
  82.     void ExpandInterfaces( NM_TREEVIEW* pNMTreeView );
  83.     void ExpandTypeLibs( NM_TREEVIEW* pNMTreeView );
  84.     void ExpandClassification( NM_TREEVIEW* pNMTreeView );
  85.     void ExpandObject( NM_TREEVIEW* pNMTreeView );
  86.     void CallInterfaceViewer(CObjectData* pObjectData, HTREEITEM hItem);
  87.  
  88. // Implementation
  89. public:
  90.  
  91.     virtual ~CObjTreeView();
  92.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  93.     virtual void OnUpdate( CView* pSender, LPARAM lHint, CObject* pHint ) ;
  94.     virtual void OnDraw( CDC* pdc );
  95.     virtual void OnInitialUpdate();
  96. #ifdef _DEBUG
  97.     virtual void AssertValid() const;
  98.     virtual void Dump(CDumpContext& dc) const;
  99. #endif
  100.  
  101.  
  102. // Generated message map functions
  103. protected:
  104.     //{{AFX_MSG(CObjTreeView)
  105.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  106.     afx_msg void OnDestroy();
  107.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  108.     afx_msg void OnObjectDelete();
  109.     afx_msg void OnObjectVerify();
  110.     afx_msg void OnUseInProcServer();
  111.     afx_msg void OnUpdateUseInProcServer(CCmdUI* pCmdUI);
  112.     afx_msg void OnUseInProcHandler();
  113.     afx_msg void OnUpdateUseInProcHandler(CCmdUI* pCmdUI);
  114.     afx_msg void OnUseLocalServer();
  115.     afx_msg void OnUpdateUseLocalServer(CCmdUI* pCmdUI);
  116.     afx_msg void OnFileBind();
  117.     //}}AFX_MSG
  118.     afx_msg void OnTreeSelchanged(NMHDR* pNMHDR, LRESULT* pResult) ;
  119.     afx_msg void OnTreeItemExpanding(NMHDR* pNMHDR, LRESULT* pResult) ;
  120.     afx_msg void OnTreeItemExpanded(NMHDR* pNMHDR, LRESULT* pResult) ;
  121.     afx_msg void OnTreeDeleteItem(NMHDR* pNMHDR, LRESULT* pResult) ;
  122.     afx_msg void OnTreeReturn(NMHDR* pNMHDR, LRESULT* pResult) ;
  123.     afx_msg LRESULT OnCommandHelp(WPARAM, LPARAM lParam) ;
  124.     DECLARE_MESSAGE_MAP()
  125.  
  126.     friend class CMainFrame;
  127. };
  128.  
  129. #ifndef _DEBUG  // debug version in vw.cpp
  130. inline COle2ViewDoc* CObjTreeView::GetDocument()
  131.    { return (COle2ViewDoc*) m_pDocument; }
  132. #endif
  133.  
  134. #endif // _OBJ_VW_H_
  135.