dbg.h
上传用户:shjinghong
上传日期:2008-12-31
资源大小:4820k
文件大小:2k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. //------------------------------------------------------------------------------
  2. // File: Dbg.h
  3. //
  4. // Desc: DirectShow sample code - Helper file for the PSIParser filter.
  5. //
  6. // Copyright (c) Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8. // dump a string to debug output
  9. #define Dump(tsz) 
  10.     OutputDebugString(tsz);
  11. #define DumpAndReturnFalse(tsz) 
  12.     {OutputDebugString(tsz);    
  13.     return false;}              
  14. // dump a string with a parameter value to debug output
  15. #define Dump1(tsz, arg)                         
  16.     { TCHAR dbgsup_tszDump[1024];               
  17.       wsprintf(dbgsup_tszDump, (tsz), (arg));   
  18.       OutputDebugString(dbgsup_tszDump); }
  19. #define CHECK_ERROR(tsz,hr)                     
  20. {   if( !SUCCEEDED(hr)  )                       
  21.     {                                           
  22.         TCHAR dbgsup_tszDump[1024];             
  23.         wsprintf(dbgsup_tszDump, (tsz), (hr));  
  24.         OutputDebugString(dbgsup_tszDump);      
  25.         return hr;                              
  26.     }                                           
  27. }
  28. #define RETURN_FALSE_IF_FAILED(tsz,hr)          
  29. {   if( S_OK != hr)                             
  30.     {                                           
  31.         TCHAR dbgsup_tszDump[1024];             
  32.         wsprintf(dbgsup_tszDump, (tsz), (hr));  
  33.         OutputDebugString(dbgsup_tszDump);      
  34.         return FALSE;                           
  35.     }                                           
  36. }
  37. #define CHECK_BADPTR(tsz,ptr)                   
  38. {                                               
  39.     TCHAR dbgsup_tszDump[1024];                 
  40.     if( ptr == 0)                               
  41.     {                                           
  42.         wsprintf(dbgsup_tszDump, (tsz), (ptr)); 
  43.         OutputDebugString(dbgsup_tszDump);      
  44.         return E_FAIL;                          
  45.     }                                           
  46. }
  47. #define RETURN_FALSE_IF_BADPTR(tsz,ptr)         
  48. {                                               
  49.     TCHAR dbgsup_tszDump[1024];                 
  50.     if( ptr == 0)                               
  51.     {                                           
  52.         wsprintf(dbgsup_tszDump, (tsz), (ptr)); 
  53.         OutputDebugString(dbgsup_tszDump);      
  54.         return FALSE;                           
  55.     }                                           
  56. }