home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / dllhusk / testdll2.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  3KB  |  75 lines

  1. // TESTDLL2.H - Public API exported from 'TESTDLL2.DLL'
  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. // Note: This sample uses AFX_EXT_CLASS to export an entire class.
  14. // This avoids creating a .DEF file with all the decorated names for
  15. // the class.  Creating a .DEF file is more efficient since the names
  16. // can be exported by ordinal.  To use that method of exporting, much
  17. // like MFC does itself, uncomment the following two lines and add
  18. // the appropriate lines to your .DEF file.
  19.  
  20. //#undef AFX_DATA
  21. //#define AFX_DATA AFX_EXT_DATA
  22.  
  23. // Initialize the DLL, register the classes etc
  24. extern "C" AFX_EXT_API void WINAPI InitTestDLL2();
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // This DLL exports a general purpose MDIChildWnd that can be used for
  28. //   a list output (stores data in a listbox)
  29. // All the public interfaces are exported in TESTDLL2.DEF
  30.  
  31. class AFX_EXT_CLASS CListOutputFrame : public CMDIChildWnd
  32. {
  33.     DECLARE_DYNAMIC(CListOutputFrame)
  34.  
  35. // Constructors
  36. public:
  37.     // NOTE: always export explicit constructors and destructor to be safe
  38.     CListOutputFrame();
  39.     ~CListOutputFrame();
  40.     BOOL Create(LPCTSTR lpszWindowName,
  41.         DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW,
  42.         const RECT& rect = rectDefault,
  43.         CMDIFrameWnd* pParentWnd = NULL);
  44.  
  45. // Operations
  46.     void Clear();       // clears list
  47.     void AddString(LPCTSTR lpszItem);        // adds to end of list
  48.     void SetBackpointer(CListOutputFrame** ppThis);
  49.  
  50. // Implementation
  51. protected:
  52.     CMenu       m_menu;         // menu to give to the the MDI Frame
  53.     CDialogBar  m_dlgBar;
  54.     CListBox    m_listBox;
  55.     CListOutputFrame** m_ppThis;  // backpointer to clear when frame destroyed
  56.     HGLOBAL GetTextData();
  57.  
  58.     //{{AFX_MSG(CListOutputFrame)
  59.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  60.     afx_msg void OnEditClear();
  61.     afx_msg void OnEditCopy();
  62.     afx_msg void OnEditCut();
  63.     //}}AFX_MSG
  64.     DECLARE_MESSAGE_MAP()
  65. };
  66.  
  67. // inlines do not need to be exported
  68. inline void CListOutputFrame::SetBackpointer(CListOutputFrame** ppThis)
  69.     { m_ppThis = ppThis; }
  70.  
  71. #undef AFX_DATA
  72. #define AFX_DATA
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75.