Microsoft KB Archive/317322

= PRB: Tlbexp.exe May Produce Invalid Method Declarations =

Article ID: 317322

Article Last Modified on 2/23/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1
 * Microsoft .NET Framework 1.0

-



This article was previously published under Q317322



SYMPTOMS
When you use invalid or incompatible combinations of SafeArraySubType, Tlbexp.exe may produce invalid signatures for a method call.



CAUSE
Tlbexp.exe does not perform any validation before it produces the type library for the managed class.



STATUS
This behavior is by design.



MORE INFORMATION
For example, a managed class may implement the following interface: public interface IAnimal {   void Eat([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_CY)] string [] x); void EatSomeMore([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_R8)] byte [] x); } When this managed class is exposed by using Tlbexp.exe, it produces the following type library definition for COM-based clients to consume: interface IAnimal : IDispatch {   [id(0x60020000)] HRESULT Eat([in] SAFEARRAY(CURRENCY) x); [id(0x60020001)] HRESULT EatSomeMore([in] SAFEARRAY(double) x); };

Keywords: kbcominterop kbprb KB317322

-

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

© Microsoft Corporation. All rights reserved.