VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 2  'RequiresTransaction
END
Attribute VB_Name = "CTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

'******************************************
'*              Class: CTest              *
'******************************************

Private m_objChild As CTest

Public Property Get contextID() As String
    contextID = GetObjectContext().ContextInfo.GetContextId
End Property

Public Property Get activityID() As String
    activityID = GetObjectContext().ContextInfo.GetActivityId
End Property

Public Property Get transactionID() As String
    If (GetObjectContext().IsInTransaction) Then
        transactionID = GetObjectContext().ContextInfo.GetTransactionId
    Else
        transactionID = "Object not in transaction."
    End If
End Property

Public Sub CreateChild(Optional strMachineName As String = "")
    If (strMachineName <> "") Then
        Set m_objChild = CreateObject("CTestProj.CTest", _
                                        strMachineName)
    Else
        Set m_objChild = CreateObject("CTestProj.CTest")
    End If
End Sub

Public Property Get child() As CTest
    Set child = m_objChild
End Property

Public Sub CreateChildUsingNew()
    Set m_objChild = New CTest
End Sub

