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

  1. // Windows 3.1 Demo Program
  2. // Copyright (c) 1992 by Borland International
  3.  
  4. // Defines the macros check and wait.
  5. // check is used to see if the last Ole function completed
  6. // successfully.
  7. // wait is used to go into a Message-Dispatch loop until
  8. // an Object is released.  It also checks that the last Ole
  9. // operation was successful.  They are implemented as macros to
  10. // take advantage of the __LINE__ and __FILE__ macros which
  11. // the compiler pre-defines.  This allows one to see which
  12. // line in the source code an error occured at.  They put up
  13. // a message box to display the symbolic constant for the
  14. // error which ole.h declared.  The comments in ole.h sometimes
  15. // give more information on what an error code meant.
  16.  
  17. // Warning: Putting up a MessageBox during the operation of Ole
  18. // functions may be a little dangerous, as the message loop for
  19. // the MessageBox is in Windows.  This means that any un-attended
  20. // messages between the OLE libraries must go through that message
  21. // loop.  A Safer thing to do is output debug strings to a
  22. // monochrome monitor, if available.  For the purposes of this
  23. // example, it should not be a problem.
  24.  
  25.  
  26. void CheckOleError( OLESTATUS , unsigned , char * );
  27. void WaitOleNotBusy( OLESTATUS , LPOLEOBJECT , unsigned, char * );
  28.  
  29. #define check( x ) CheckOleError( x , __LINE__ , __FILE__ )
  30.     //if not OLE_OK, CheckOleError will put up a message
  31.     //box, which could be bad for Ole message dispatching
  32.  
  33. #define wait( x , y) WaitOleNotBusy(  x , y , __LINE__, __FILE__ )
  34.  
  35.