Microsoft KB Archive/215460

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

Article ID: 215460

Article Last Modified on 6/12/2001

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Transaction Services 1.0
 * Microsoft Transaction Services 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.



Steps to Reproduce the Behavior
 Create a Visual Basic ActiveX DLL. Name your project "MyUDTProject," and then name the class CMyUDTClass.  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  Compile the DLL, and then set the binary compatibility. Copy the DLL to another MTS computer.</li> Create an empty MTS package.</li> Add the MyUDTProject.dll file to the MTS package you created.</li></ol>

<div class="references_section">