home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / strout / common.h < prev    next >
C/C++ Source or Header  |  1996-07-23  |  2KB  |  40 lines

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  2. /*                  Copyright Microsoft Corp. 1992-1996                 */
  3. /*                      Remote Machine strout sample                    */
  4. /*                                                                      */
  5. /*  FILE    :   common.h                                                */
  6. /*                                                                      */
  7. /*  PURPOSE :   Definitions used in the program                         */
  8. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  9. #ifndef __COMMON_STROUT__   // If this file has be included before      
  10. #define __COMMON_STROUT__   // Don't include it again                   
  11.  
  12. #include <windows.h>        // The CommandLineToArgvW is defined here   
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <tchar.h>          // Included to support UNICODE/ANSI         
  16.  
  17. // Return values from the program to the OS
  18. #define EXECUTION_FAILED    -1
  19. #define EXECUTION_OK        0
  20.  
  21. // Exception handler macro
  22. #define DO_EXCEPTION        1       // Execute the exception block
  23.  
  24. // Macro for printing out error message and exit the program if an      
  25. // error occured                                                        
  26. #define EXIT_IF_FAIL(x, string){    \
  27.     ((x) != RPC_S_OK)?_tprintf(TEXT("%s returned with error: %d\n"), \
  28.     TEXT(string), (x)),exit(x):0;} 
  29.  
  30. // Common type definition and defines used in the program
  31. #define PROTOCOL_SEQUENCE   TEXT("ncacn_np")
  32. #define END_POINT           TEXT("\\pipe\\strout_sample")
  33. #define    IGNORE_CHAR         TEXT('=')
  34. #define NULL_CHAR           TEXT('\0')
  35.  
  36. #endif  // ifndef __COMMON_STROUT__ 
  37.  
  38.  
  39.  
  40.