home *** CD-ROM | disk | FTP | other *** search
/ Windows Shareware GOLD / NuclearComputingVol3No1.cdr / utils / f1296 / dbugshow.c next >
C/C++ Source or Header  |  1990-09-11  |  1KB  |  36 lines

  1.  /* --- DBUGSHOW.C -     Fuction that calls the Dbug application with a string
  2.                             to be displayed  */
  3. /* BY: Michel Bouillon
  4.         First version : Jan 20 88
  5.         Last revision : Jan 20 88, 11:12am
  6. */
  7. #include <windows.h>
  8. #include <string.h>                /* MS-C definitions */    
  9. #include <stdio.h>
  10. #define    HDBUG_WINDOW    0xffff        
  11.  
  12. /*::defn */
  13. #define    DBUG_SHOW        0x6fff        
  14. /*::end*/
  15.  
  16. /*::fnproto*/
  17. void cdecl far DbugShow(HWND hWind,char *szFormat,...);
  18. /*::end*/
  19. void cdecl far DbugShow( hWind,szFormat, Args )
  20.     /* this function is to be called by any application (once linked) to
  21.         cause the Dbug application to display the desired string */
  22.      HWND hWind;           /* window handle of the calling window */
  23.      char *szFormat;    /* Format string as used in printf() */
  24.     char Args;         /* Zero or more parameters, as in printf */
  25. {
  26.     static char Buf[256];           /* Buffer to format string into */
  27.  
  28.      sprintf(  Buf, "(%4x) ",(int)hWind);
  29.     vsprintf( &Buf[strlen(Buf)], szFormat, &Args );
  30.      SendMessage(HDBUG_WINDOW,DBUG_SHOW,NULL,(LONG)(LPSTR)Buf);
  31.         if (hWind == 7)
  32.             MessageBox(NULL,(LPSTR)Buf,(LPSTR)"DbugShow3",MB_OK);
  33. }
  34.  
  35.  
  36.