Microsoft KB Archive/239849

= Type Mismatch Error Occurs in Visual Basic When UDT Is a COMTI Return Value =

Article ID: 239849

Article Last Modified on 3/18/2004

-

APPLIES TO


 * Microsoft COM Transaction Integrator for CICS and IMS 4.0 SP2
 * Microsoft SNA Server 4.0 Service Pack 2

-



This article was previously published under Q239849



SYMPTOMS
A Visual Basic client invokes a method of a COM Transaction Integrator for CICS and IMS (COMTI) component library, which declares a user-defined type (UDT) as a return value for the method. Visual Basic responds with a "type mismatch" error and the code does not compile. This only happens when the COMTI component is early bound. The UDT is defined in the Visual Basic code by referencing its declaration in the component library. Under the same circumstances, if late binding is used, the code compiles and executes correctly. In this case, the compiler has no knowledge of the component and a type mismatch can not occur.



CAUSE
The COMTI Component Builder (CB) declares the return value as a UDT pointer. The Visual Basic statement that invokes the COMTI method specifies the return value as a UDT, which is why there is a type mismatch.



WORKAROUND
To work around this issue, make the UDT an [output] parameter instead of a return value, or use late binding.



STATUS
Microsoft has confirmed that this is a problem in Microsoft SNA Server version 4.0, SP2.

Keywords: kbbug kbnofix KB239849

-

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

© Microsoft Corporation. All rights reserved.