home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // File : MsgTracerComp.cpp
- // Project : MsgTrace
- // Component : MsgTracer
- //---------------------------------------------------------------------------
- // Description : implementation of the tracer component
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // SourceSafe Strings. Do not change.
- //---------------------------------------------------------------------------
- // $Author: jeskes $
- // $Date: $
- // $Revision: $
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #include "stdafx.h"
- #include "MsgTracer.h"
- #include "MsgTracerApp.h"
- #include "OutputDoc.h"
- #include "MsgTracerComp.h"
-
- /////////////////////////////////////////////////////////////////////////////
- // CMsgTracerComp: construction
- /////////////////////////////////////////////////////////////////////////////
-
- CMsgTracerComp::CMsgTracerComp()
- {
- AfxOleLockApp();
- }
-
- CMsgTracerComp::~CMsgTracerComp()
- {
- AfxOleUnlockApp();
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMsgTracerComp: operation
- /////////////////////////////////////////////////////////////////////////////
-
- STDMETHODIMP CMsgTracerComp::AttachProcess( DWORD ProcessId, BOOL Wait )
- {
- if( ThisApp().m_bAllowAutoAttach )
- {
- ThisApp().AttachProcess( ProcessId, Wait );
- return( S_OK );
- }
- return( S_FALSE );
- }
-
- /////////////////////////////////////////////////////////////////////////////
-
- STDMETHODIMP CMsgTracerComp::Write(BSTR Message)
- {
- ThisApp().WriteOutput( CString( Message ) );
-
- return( S_OK );
- }
-