home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / MSGTRACE.ZIP / MyProjects / MsgTrace / MsgTracer / MsgTracerComp.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-30  |  1.7 KB  |  61 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File        : MsgTracerComp.cpp
  4. // Project     : MsgTrace
  5. // Component   : MsgTracer
  6. //---------------------------------------------------------------------------
  7. // Description : implementation of the tracer component
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. //
  11. // SourceSafe Strings. Do not change.
  12. //---------------------------------------------------------------------------
  13. // $Author: jeskes $
  14. // $Date: $
  15. // $Revision: $
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18.  
  19. #include "stdafx.h"
  20. #include "MsgTracer.h"
  21. #include "MsgTracerApp.h"
  22. #include "OutputDoc.h"
  23. #include "MsgTracerComp.h"
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CMsgTracerComp: construction
  27. /////////////////////////////////////////////////////////////////////////////
  28.  
  29. CMsgTracerComp::CMsgTracerComp()
  30. {
  31.     AfxOleLockApp();
  32. }
  33.  
  34. CMsgTracerComp::~CMsgTracerComp()
  35. {
  36.     AfxOleUnlockApp();
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CMsgTracerComp: operation
  41. /////////////////////////////////////////////////////////////////////////////
  42.  
  43. STDMETHODIMP CMsgTracerComp::AttachProcess( DWORD ProcessId, BOOL Wait )
  44. {
  45.     if( ThisApp().m_bAllowAutoAttach )
  46.     {
  47.         ThisApp().AttachProcess( ProcessId, Wait );
  48.         return( S_OK );
  49.     }
  50.     return( S_FALSE );
  51. }
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54.  
  55. STDMETHODIMP CMsgTracerComp::Write(BSTR Message)
  56. {
  57.     ThisApp().WriteOutput( CString( Message ) );
  58.  
  59.     return( S_OK );
  60. }
  61.