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 / wintyp / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-23  |  1.8 KB  |  40 lines

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  2. /*                  Copyright Microsoft Corp. 1992-1996                 */
  3. /*                      Remote Machine pipe sample                      */
  4. /*                                                                      */
  5. /* FILE     :   common.h                                                */
  6. /*                                                                      */
  7. /* PURPOSE  :   Definitions used in the program                         */
  8. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  9. #ifndef __COMMON_WINTYP_SAMPLE__    // If this file already included - 
  10. #define __COMMON_WINTYP_SAMPLE__    // don't include it again
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14.  
  15. #include <tchar.h>                  // Included to support UNICODE/ANSI
  16.  
  17. // Common type definition and defines used in the program
  18. #define FINDEDGE    1       // Action to take - Find edges in image
  19. #define FLIPIMAGE   2       // Action to take - Flip the imagedata
  20.  
  21. #define PROTOCOL_SEQUENCE   TEXT("ncacn_np")
  22. #define END_POINT           TEXT("\\pipe\\wintyp_sample")
  23.     
  24. // Return values from the program to the OS
  25. #define EXECUTION_FAILED    -1
  26. #define EXECUTION_OK        0
  27.  
  28. // Exception handler macro
  29. #define DO_EXCEPTION        1       // Execute the exception block
  30.  
  31. /* Macro for printing out error message and exit the program if an      */
  32. /* error occured                                                        */
  33. #define EXIT_IF_FAIL(x, string){    \
  34.     ((x) != RPC_S_OK)?_tprintf(TEXT("%s returned with error: %d\n"), \
  35.     TEXT(string), (x)),exit(x):0;} 
  36.  
  37. // Macro for printing messages to the screen
  38. #define PRINT(X, Y) MessageBox(g_hWnd, (X), (Y), MB_OK )
  39.  
  40. #endif    // __COMMON_WINTYP_SAMPLE__