home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
WPSDBG.ZIP
/
WPSDEBUG.H
< prev
Wrap
Text File
|
1992-10-05
|
1KB
|
49 lines
#define DBGPIPE "\\pipe\\dbgpipe"
int SOMDBGOutChar(CHAR c)
{
static CHAR buf[160],cin ;
static ULONG cnt, incnt ;
if (c == '\n') {
buf[cnt++] = '\r' ;
buf[cnt++] = '\n' ;
DosCallNPipe(DBGPIPE,buf,cnt,&cin,1,&incnt,0) ;
cnt = 0 ;
} // endif
else
buf[cnt++] = c ;
return 1 ;
}
/*--------------------------------------------------------
1. Make sure that you have :
#define INCL_DOSNMPIPES
before:
#include <os2.h>
and:
#include <WPSDEBUG.H>
after:
#include <os2.h>
2. Insert the following in one of your INSTANCE methods:
SOMOutCharRoutine = SOMDBGOutChar ;
SOM_TraceLevel = 1 ; // or 2
between:
xxxData *somThis = xxxGetData(somSelf);
and:
xxxMethodDebug("xxx","xxx_wpMethod");
NOTE: The best choice for step 2 is an "early" method
such as _wpSetup or _wpModifyPopupMenu. Tracing
begins after the execution of the two inserted lines.
DO NOT insert the lines in step 2 into a class method.
This seems to prevent class registration.
----------------------------------------------------------*/