home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 6.ddi / CLIOLE.ZIP / CLIOLE.H < prev    next >
Encoding:
Text File  |  1992-06-10  |  2.6 KB  |  96 lines

  1. // Windows 3.1 Demo Program
  2. // Copyright (c) 1992 by Borland International
  3.  
  4. // declares structures and functions used in the example.
  5.  
  6.  
  7. // prototype for the standard Call back function used for Ole notifications.
  8. // it will route notifications on to the appropiate object.
  9.  
  10. int FAR PASCAL _export StdCallBack( LPOLECLIENT , OLE_NOTIFICATION , LPOLEOBJECT );
  11.  
  12. // typdef for an OLE callback function
  13. typedef int   FAR PASCAL ( *TCallBack )( LPOLECLIENT , OLE_NOTIFICATION , LPOLEOBJECT );
  14.  
  15.  
  16. // struct: TOleClient
  17. // This is an OLECLIENT structure with an HWND for the window which
  18. // owns this object.
  19. // An OLECLIENT's primary purpose is to provide the CallBack function
  20. // which the Ole librarys will call to give notifications about a
  21. // particular object.  The purpose of a TOleClient instance is to send those
  22. // notification to the window which is managing that object.
  23. // It will have no knowledge of the actual object which it receives
  24. // notifications for.
  25. // The OLECLIENT
  26. // structure has a vtable which has the address of the callback function.
  27. // since only one such vtable need be constructed for instances of this
  28. // structure, a global variable will be used to determine if a vtable has
  29. // been constructed.
  30.  
  31. typedef struct {
  32.     OLECLIENT oleClient;
  33.     HWND hwnd;
  34. } TOleClient;
  35.  
  36.  
  37.  
  38. // user defined messages
  39.  
  40. #define WM_U_REDRAW         (WM_USER + 1)
  41. #define WM_U_CALLBACK    ( WM_USER + 2)
  42.  
  43. // structure used to pass Ole notification messages from the
  44. // Ole Callback to the window.
  45.  
  46. typedef struct stagTOleNot {
  47.     LPOLECLIENT lpClient;
  48.     OLE_NOTIFICATION not;
  49.     LPOLEOBJECT lpObject;
  50. } TOleNot;
  51.  
  52. // function prototypes
  53.  
  54. long FAR PASCAL _export WndProc (HWND, WORD, WORD, LONG) ;
  55. void WMURedraw( HWND hwnd );
  56. void CMPBrush( );
  57. void CMUndo(HWND);
  58. void CMActivate( HWND hwnd );
  59. void CMClear( HWND hwnd );
  60. void CMCut(HWND hwnd);
  61. void CMCopy( HWND hwnd );
  62. void CMPaste( HWND hwnd );
  63. void WMCreate( HWND hwnd );
  64. void WMInitMenu( HWND hwnd , WORD wParam );
  65. int WMUCallBack( LPOLECLIENT lpOleClient ,
  66.                  OLE_NOTIFICATION oleNot,
  67.                  LPOLEOBJECT lpOleObject );
  68. void CMPBrush( );
  69. void BackupObject();
  70. LPSTR GetNextObjectName();
  71. void CMUndo();
  72. void CMCut(HWND hwnd );
  73. void CMCopy( HWND hwnd );
  74. void CloseCurrentOle( HWND hwnd );
  75. void CMCopy( HWND hwnd );
  76. void CMPaste( HWND hwnd );
  77. void RegisterClientDoc();
  78. void memerror();
  79. void Paint ( HWND, HDC );
  80. void CMAbout( HWND );
  81. void InitApplication(void);
  82. void InitInstance(void);
  83. void CMPBrush(void);
  84. void BackupObject(void);
  85. LPSTR GetNextObjectName(void);
  86. void RegisterClientDoc(void);
  87. void memerror(void);
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.