home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / WPSDBG.ZIP / WPSDEBUG.H < prev   
Text File  |  1992-10-05  |  1KB  |  49 lines

  1. #define DBGPIPE "\\pipe\\dbgpipe"
  2.  
  3. int SOMDBGOutChar(CHAR c)
  4. {
  5.    static CHAR buf[160],cin ;
  6.    static ULONG cnt, incnt ;
  7.    if (c == '\n') {
  8.        buf[cnt++] = '\r' ;
  9.        buf[cnt++] = '\n' ;
  10.        DosCallNPipe(DBGPIPE,buf,cnt,&cin,1,&incnt,0) ;
  11.        cnt = 0 ;
  12.         } // endif
  13.    else
  14.        buf[cnt++] = c ;
  15.    return 1 ;
  16.  
  17. }
  18.  
  19. /*-------------------------------------------------------- 
  20.  
  21.     1.  Make sure that you have :
  22.             #define INCL_DOSNMPIPES
  23.         before:
  24.             #include <os2.h>
  25.         and:
  26.             #include <WPSDEBUG.H>
  27.         after:
  28.             #include <os2.h>
  29.  
  30.     2.  Insert the following in one of your INSTANCE methods:
  31.  
  32.            SOMOutCharRoutine = SOMDBGOutChar ;
  33.            SOM_TraceLevel = 1 ; // or 2
  34.  
  35.         between:
  36.            xxxData *somThis = xxxGetData(somSelf);
  37.         and:
  38.            xxxMethodDebug("xxx","xxx_wpMethod");
  39.  
  40.     NOTE: The best choice for step 2 is an "early" method
  41.           such as _wpSetup or _wpModifyPopupMenu. Tracing
  42.           begins after the execution of the two inserted lines.
  43.  
  44.           DO NOT insert the lines in step 2 into a class method.
  45.           This seems to prevent class registration.
  46.  
  47. ----------------------------------------------------------*/
  48.  
  49.