BUG: COM+ Component Cannot Use Commerce.Dictionary or Commerce.SimpleList Component (302871)



The information in this article 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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create an non-COM+ component named testClass.testObj.
  2. 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
    					
  3. Compile testClass.testObj.
  4. Create another COM+ component named testDic.Dictionary that references the Commerce.Dictionary, the Commerce.SimpleList, and the testClass.testObj components.
  5. 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("Commerce.Dictionary")
    Set oSList = CreateObject("Commerce.SimpleList")
    oTest1.ReturnString = "For testing purposes only."
    oTest2.ReturnString = "Another test string"
    
    ' 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
    					
  6. Compile testDic.Dictionary, and then add testDic.Dictionary to COM+ as a server package.
  7. 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
    					
  8. Test and run the component.
  9. Create an ASP page that includes the following code:
    <%
    Set test=Server.CreateObject("testDic.Dictionary") 
    Set oTest = test.GetDict
    Set oTest2 = oTest.list1
    Set oTest3 = oTest2(0)
    Response.Write oTest3.ReturnString
    %>
    					
  10. Call and run the component.

Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbbug kbpending KB302871