COMMON.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  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. #include <windows.h>        // The CommandLineToArgvW is defined here   
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <tchar.h>          // Included to support UNICODE/ANSI         
  15. // Return values from the program to the OS
  16. #define EXECUTION_FAILED    -1
  17. #define EXECUTION_OK        0
  18. // Exception handler macro
  19. #define DO_EXCEPTION        1       // Execute the exception block
  20. // Macro for printing out error message and exit the program if an      
  21. // error occured                                                        
  22. #define EXIT_IF_FAIL(x, string){
  23.     ((x) != RPC_S_OK)?_tprintf(TEXT("%s returned with error: %dn"), 
  24.     TEXT(string), (x)),exit(x):0;} 
  25. // Common type definition and defines used in the program
  26. #define PROTOCOL_SEQUENCE   TEXT("ncacn_np")
  27. #define END_POINT           TEXT("\pipe\strout_sample")
  28. #define IGNORE_CHAR         TEXT('=')
  29. #define NULL_CHAR           TEXT('')
  30. #endif  // ifndef __COMMON_STROUT__