日期:2009-10-21 浏览次数:20952 次
Dim objOC As ObjectContext
Public Sub Something()
'This is a user-defined procedure/method
'The ObjectContext Object is returned by GetObjectContext
On Error GoTo Abort
'*******************************************************
' Perform whatever you want in this area
' Visual Basic 6 stuff goes here
' The Something() procedure/method is just
' an example - you may use properties and other
' methods/procedures as well!
'*******************************************************
Finished:
objOC.SetComplete
Exit Sub
Abort:
objOC.SetAbort
Err.Raise Err.Number, Err.Source, Err.Description
Exit Sub
End Sub
Private Sub ObjectControl_Activate()
'MTS invokes this procedure/method when the component/object is instantiated
Set objOC = GetObjectContext()
Exit Sub
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
'This enables MTS object pooling (not currently supported my MTS 2.0)
ObjectControl_CanBePooled = True
End Function
Private Sub ObjectControl_Deactivate()
'MTS invokes this procedure/method right before the component/object is released
Set objOC = Nothing
Exit Sub
End Sub