home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / debug / tracebox / tracebox.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.0 KB  |  62 lines

  1. //************************************************************
  2. // Problem Determination  - Trace Queue Browser
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <istring.hpp>
  9. #include <ithread.hpp>
  10. #include "trbrowse.hpp"
  11.  
  12. const unsigned PMQUEUE_SIZE = 2000;
  13. IString        QUEUE_NAME("PRINTF32");       // base name of queue
  14.  
  15. /*------------------------------------------------------------------------------
  16. | main                                                                         |
  17. ------------------------------------------------------------------------------*/
  18. int main(int argc, char* argv[] )
  19. {
  20. #if (IC_MAJOR_VERSION >= 320)
  21.    // The pmCompatible container works a little better than the listview
  22.    // container, since it results in single column output.
  23.    // The command line switch -LV can be used to force listview to be used.
  24.    IContainerControl::setDefaultStyle(
  25.       IContainerControl::defaultStyle() |
  26.       IContainerControl::pmCompatible );
  27. #endif
  28.    while (argc > 1)
  29.       {
  30.       argc--;
  31.       if ( IString(argv[argc]) == IString("-LV") )
  32.          {
  33. #if (IC_MAJOR_VERSION >= 320)
  34.          IContainerControl::setDefaultStyle(
  35.             IContainerControl::defaultStyle() &
  36.             ~IContainerControl::pmCompatible );
  37. #endif
  38.          }
  39.       else
  40.          QUEUE_NAME = IString(argv[argc]);
  41.       }
  42.  
  43.    // Note that we increase the size of the PM
  44.    // message queue to try to avoid filling
  45.    // it up.
  46.    IThread::current().initializeGUI(PMQUEUE_SIZE);
  47.  
  48.    // Create the trace browser window
  49.    TraceBrowser traceWindow (QUEUE_NAME);
  50.  
  51.    // Give the window the focus and show it.
  52.    // focus (try to be non-intrusive).
  53.    traceWindow
  54.      .setFocus()
  55.      .show();
  56.  
  57.    IThread::current().processMsgs();
  58.    IThread::current().terminateGUI();
  59.  
  60.    return 0;
  61. }
  62.