Microsoft KB Archive/302871

= BUG: COM+ Component Cannot Use Commerce.Dictionary or Commerce.SimpleList Component =

Article ID: 302871

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Commerce Edition
 * Microsoft COM+ 1.0

-



This article was previously published under Q302871



SYMPTOMS
When you develop a COM+ component that uses the nested Commerce.Dictionary or the nested Commerce.SimpleList component, an error occurs in Microsoft Active Server Pages (ASP) pages if the component takes a non-COM+ component as its entry.

In Win32 client mode, the components work fine in a COM+ environment, as well as in a non-COM+ environment. However, when you register the components in COM+, you receive the following error message in ASP:

'8000ffff' Catastrophic failure /test.asp, line 5'

NOTE: The component works fine under Microsoft Transaction Server (MTS).



CAUSE
COM+ introduces component marshaling. However, Commerce.Dictionary and Commerce.SimpleList cannot handle nested component marshaling. This problem occurs when a Microsoft Visual Basic component references a Commerce.SimpleList or a Commerce.Dictionary component that takes another component as an entry.



RESOLUTION
To work around this problem, use one of the following methods:
 * Remove the Commerce components from the reference chain.
 * Remove the third components that the Dictionary or the SimpleList object references from the reference chain.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create an non-COM+ component named testClass.testObj.  Add the following properties and methods to the testClass.testObj component: Private mvarReturnString As String

Public Property Let ReturnString(ByVal vData As String) mvarReturnString = vData End Property

Public Property Get ReturnString As String ReturnString = mvarReturnString End Property  Compile testClass.testObj. Create another COM+ component named testDic.Dictionary that references the Commerce.Dictionary, the Commerce.SimpleList, and the testClass.testObj components.  Add properties or methods to the components that return Dictionary or SimpleList. From oSList, call testObj, pass the reference to Dictionary, and then add SimpleList to Dictionary. For example: Public Function GetDict As MSCSCoreLib.CDictionary '================================ ' Use this code to add the non-COM+ component to SimpleList and ' to add SimpleList to Dictionary. ' You must add testClass to the reference of this class. ' You must reference Commerce.Dictionary in this project. '================================ Dim ODict As Object Dim oSList As Object Dim oTest1 As New testClass.testObj Dim oTest2 As New testClass.testObj

Set ODict = CreateObject(&quot;Commerce.Dictionary&quot;) Set oSList = CreateObject(&quot;Commerce.SimpleList&quot;) oTest1.ReturnString = &quot;For testing purposes only.&quot; oTest2.ReturnString = &quot;Another test string&quot;

' Add the two Test objects to the list. oSList.Add oTest1 oSList.Add oTest2

' Add the list to Dictionary.

Set ODict.list1 = oSList Set GetDict = ODict

End Function </li> Compile testDic.Dictionary, and then add testDic.Dictionary to COM+ as a server package.</li>  Create an Win32 client that includes the following code: Dim test As New testDic.Dictionary Set oTest = test.GetDict Set oTest2 = oTest.list1

Set oTest3 = oTest2(0) Debug.Print oTest3.ReturnString </li> Test and run the component.</li>  Create an ASP page that includes the following code: <% Set test=Server.CreateObject(&quot;testDic.Dictionary&quot;) Set oTest = test.GetDict Set oTest2 = oTest.list1 Set oTest3 = oTest2(0) Response.Write oTest3.ReturnString %>                   </li> Call and run the component.</li></ol>

Additional query words: 8000ffff Catastrophic failure

Keywords: kbbug kbpending KB302871

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.