home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / DLLHUSK.PAK / TESTDLL2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.7 KB  |  82 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-1995 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. #ifdef _MAC
  24. #undef AFX_EXT_API
  25. #undef AFX_EXT_CLASS
  26. #define AFX_EXT_API
  27. #define AFX_EXT_CLASS
  28. #endif
  29.  
  30. // Initialize the DLL, register the classes etc
  31. extern "C" AFX_EXT_API void WINAPI InitTestDLL2();
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // This DLL exports a general purpose MDIChildWnd that can be used for
  35. //   a list output (stores data in a listbox)
  36. // All the public interfaces are exported in TESTDLL2.DEF
  37.  
  38. class AFX_EXT_CLASS CListOutputFrame : public CMDIChildWnd
  39. {
  40.     DECLARE_DYNAMIC(CListOutputFrame)
  41.  
  42. // Constructors
  43. public:
  44.     // NOTE: always export explicit constructors and destructor to be safe
  45.     CListOutputFrame();
  46.     ~CListOutputFrame();
  47.     BOOL Create(LPCTSTR lpszWindowName,
  48.         DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW,
  49.         const RECT& rect = rectDefault,
  50.         CMDIFrameWnd* pParentWnd = NULL);
  51.  
  52. // Operations
  53.     void Clear();       // clears list
  54.     void AddString(LPCTSTR lpszItem);        // adds to end of list
  55.     void SetBackpointer(CListOutputFrame** ppThis);
  56.  
  57. // Implementation
  58. protected:
  59.     CMenu       m_menu;         // menu to give to the the MDI Frame
  60.     CDialogBar  m_dlgBar;
  61.     CListBox    m_listBox;
  62.     CListOutputFrame** m_ppThis;  // backpointer to clear when frame destroyed
  63.     HGLOBAL GetTextData();
  64.  
  65.     //{{AFX_MSG(CListOutputFrame)
  66.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  67.     afx_msg void OnEditClear();
  68.     afx_msg void OnEditCopy();
  69.     afx_msg void OnEditCut();
  70.     //}}AFX_MSG
  71.     DECLARE_MESSAGE_MAP()
  72. };
  73.  
  74. // inlines do not need to be exported
  75. inline void CListOutputFrame::SetBackpointer(CListOutputFrame** ppThis)
  76.     { m_ppThis = ppThis; }
  77.  
  78. #undef AFX_DATA
  79. #define AFX_DATA
  80.  
  81. /////////////////////////////////////////////////////////////////////////////
  82.