MTS and OLE error 8004E00F
Hi,
I created a MTS component named IEmployee that required transaction. If I
created object by using Employee := coEmployee.Create, it worked fine. I
also can monitor the MTS object from then Transaction Server Explorer.
Then I write another MTS component and I want to include these two
components into one transaction. According to the Delphi manual, I wrote the
following codes:
procedure TForm1.Button1Click(Sender: TObject);
var
TransactionContextEx : ITransactionContextEx;
Employee : IEmployee;
begin
TransactionContextEx := CreateTransactionContextEx;
try
OleCheck(TransactionContextEx.CreateInstance(CLASS_Employee,
IID_IEmployee, Employee));
OleCheck(TransactionContextEx.CreateInstance(CLASS_EmpOrder,
IID_IEmpOrder, EmpOrder));
...
But TransactionContextEx.CreateInstance generated the error: OLE error
8004E00F. And the MTX.Exe was not launched at this time. Should I intialize
the MTS environment before I call the CreateInstance method? Or anything
wrong with the code?
Thanks,
Libo