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 / iviewers / idataobj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  3.6 KB  |  128 lines

  1. // idataobj.h
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13. // Header file for the IDataObject interface viewer.
  14. //
  15. //
  16. // Charlie Kindel, Program Manager
  17. // Microsoft Vertical Developer Relations
  18. // August 6, 1993
  19. //
  20. // InterNet   :  ckindel@microsoft.com
  21. // CompuServe :  >INTERNET:ckindel@microsoft.com
  22. //
  23. // Revisions:
  24. //  August 6, 1993  cek     First implementation.
  25. //
  26.  
  27. #ifndef _IDATAOBJ_H_
  28. #define _IDATAOBJ_H_
  29.  
  30. int WINAPI GetTextMetricsCorrectly( HDC hDC, LPTEXTMETRIC lpTM ) ;
  31. typedef struct FAR tagCOLUMNSTRUCT
  32. {
  33.    int   nLeft ;       // starting x position of the column
  34.    int   nRight ;      // ending x position of the column
  35.    UINT  uiFlags ;      // format flags
  36.  
  37. } COLUMNSTRUCT, *PCOLUMNSTRUCT, FAR *LPCOLUMNSTRUCT ;
  38.  
  39. void WINAPI ColumnTextOut( HDC hdc, int nX, int nY, LPTSTR lpszIN,
  40.                             int cColumns, LPCOLUMNSTRUCT rgColumns );
  41. void WINAPI DlgCenter( HWND hwndCenter, HWND hwndWithin, BOOL fClient ) ;
  42.  
  43. class CImpIAdviseSink ;
  44.  
  45. #define CCHOUTPUTMAX        8192
  46. #define CLINESMAX           500
  47. #define WM_OUTPUTBUFFERHASDATA      (WM_USER+1000)
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CIDataObjectDlg dialog
  51. //
  52. extern "C"
  53. BOOL CALLBACK fnIDataObjectDlg( HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
  54.  
  55. class FAR CIDataObjectDlg
  56. {
  57.     friend BOOL CALLBACK fnIDataObjectDlg( HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
  58.     friend class CImpIAdviseSink ;
  59.  
  60. public:
  61.  
  62.     CIDataObjectDlg( HWND hwnd, LPDATAOBJECT lpDO, REFIID riid, LPTSTR lpszName ) ;
  63.     ~CIDataObjectDlg() ;
  64.  
  65.     int DoModal( void ) ;
  66.  
  67.     LPDATAOBJECT    m_lpDO ;
  68.     LPTSTR          m_lpszName ;
  69.  
  70.     FORMATETC       m_fetc ;
  71.     DWORD           m_advf ;
  72.     BOOL            m_fDoOnGetDataPosted ;
  73.  
  74.     HWND        m_hWndParent ;
  75.     HWND        m_hDlg ;
  76.  
  77.     HWND        m_btnDoGetData ;
  78.     HWND        m_btnSetupAdvise ;
  79.     HWND        m_lbGetData ;
  80.     HWND        m_edtAdvise ;
  81.     TCHAR       m_szOutput[CCHOUTPUTMAX] ;
  82.     METAFILEPICT m_MetaFile ;
  83.  
  84.     UINT        m_cchOutput ;
  85.     UINT        m_cLinesOutput ;
  86.  
  87.     HWND        m_chkUpdateDisplay ;
  88.     BOOL        m_fUpdateDisplay ;
  89.     HWND        m_chkPrimeFirst ;
  90.  
  91.     HWND        m_lbFmtEtc ;
  92.  
  93.     HWND        m_chkDump ;
  94.  
  95.     DWORD       m_dwTime ;
  96.     DWORD       m_cOnDataChanges ;
  97.  
  98.     CImpIAdviseSink FAR* m_pSink ;
  99.     DWORD               m_dwConn ;
  100.  
  101. // Implementation
  102. protected:
  103.     BOOL DoIDataObject( UINT nLevel, LPDATAOBJECT pI ) ;
  104.     BOOL DoIEnumFormatEtc( UINT nLevel, LPENUMFORMATETC pI ) ;
  105.  
  106.     int AddItem( UINT nLevel, LPTSTR sz, LPVOID lpData, UINT uiType, int cColumns, LPCOLUMNSTRUCT  rgCol ) ;
  107.     int AddItem( UINT nLevel, LPTSTR sz, LPVOID lpData, UINT uiType ) ;
  108.     int AddItem( UINT nLevel, LPTSTR sz, LPVOID lpData ) ;
  109.  
  110.     BOOL OnInitDialog();
  111.  
  112.     void OnDoGetData() ;
  113.     HRESULT GotData( LPFORMATETC lpfetc, LPSTGMEDIUM lpstm ) ;
  114.     void OnSetupAdvise() ;
  115.     void OnKillAdvise() ;
  116.  
  117.     void OnSize(UINT nType, int cx, int cy);
  118.     void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
  119.     void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  120.     void OnDblClkFormatEtc();
  121.     void OnSelChangeFormatEtc();
  122.     void OnDestroy();
  123.     BOOL  WriteToOutput( LPTSTR lpsz ) ;
  124.     void OnOutputBufferHasData() ;
  125. };
  126.  
  127. #endif // _IDATAOBJ_H_
  128.