SUMMARY
In Microsoft Transaction Server (MTS), you must use
ObjectContext.CreateInstance in your root object to create secondary objects for the transaction to flow. In COM+ this still works, but it is no longer necessary to do it. In COM+,
CreateObject subsumes the functionality of
ObjectContext.CreateInstance. The object created participates in the caller's activity.
In COM+, you can use the standard
CreateObject function in Microsoft Visual Basic to flow a transaction to secondary objects as appropriate.
The following example shows how the root object (clsRoot) creates the secondary object (clsSec) from within a transactional object.
Sub Test()
Dim objSec As clsSec 'clsSec is the secondary class.
Set objSec = CreateObject ("prjTest.clsSec")
End Sub
Also note that in COM+, as opposed to Microsoft Transaction Server, you don't have to obtain the ObjectContext in this particular scenario.
This applies to CoCreateInstance and CoCreateInstanceEx APIs in C++ also.