PRB: Failure to Install Visual Basic 6.0 Component that Uses a User Defined Type in Interface into a Microsoft Transaction Server Package (215460)



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Transaction Server 1.0
  • Microsoft Transaction Server 2.0

This article was previously published under Q215460

SYMPTOMS

When you install a Visual Basic 6.0 ActiveX DLL, that uses a User Defined Type (UDT) in its public classes, into a Microsoft Transaction Server (MTS) package, it fails if the DLL is not registered on the computer. When you use the Microsoft Management Console (MMC) MTS explorer, the following error message occurs:
One or more DLLs appear to be corrupt. Either a DLL threw an exception during the installation, or the DLL and its embedded type library are out of sync. Ensure that the correct versions of all application run-time files or other dependent DLLs are available in the component DLL's directory or the system path.

CAUSE

This behavior occurs because the Visual Basic run-time, in a call to DllGetClassObject, attempts to obtain type information for the UDT. Because this information is not available in the registry, the call fails.

RESOLUTION

This behavior is corrected in Microsoft Windows 2000/COM+. However, the component must be manually registered before it is installed into MTS. To perform this:
  • Run REGSVR32.EXE on the DLL.
  • Use the Package and Deployment Wizard to run an installation of the DLL on the MTS computer.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create a Visual Basic ActiveX DLL.
  2. Name your project "MyUDTProject," and then name the class CMyUDTClass.
  3. Add the following code to CMyUDTClass:
    ' This code is in a code module.
    Public Type udtMyType ' Definition of a Public UDT
       lastName As String
       firstName As String
    End Type
    
    Public Function CallMe(person As udtMyType)
        person.lastName = "Doe"
    End Function
    					
  4. Compile the DLL, and then set the binary compatibility.
  5. Copy the DLL to another MTS computer.
  6. Create an empty MTS package.
  7. Add the MyUDTProject.dll file to the MTS package you created.

REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

241896 PRB: Threading Issues with Visual Basic 6.0 ActiveX Components

255973 BUG: Exporting Application Proxy in COM+ Gives Export Application


Modification Type:MajorLast Reviewed:6/12/2001
Keywords:kberrmsg kbprb kbSysAdmin KB215460