1
Vote

TLBIMP converting C array of VARIANT_BOOL as C array of BOOL.

description

IDL file:
 
[uuid(791B8E24-28A1-4d85-A00A-5C1EFE3E08EA)]
library lib
{
[uuid(0AB14DF8-BF44-4e2e-A948-5D2D672FB678)]
typedef
struct A
{
    VARIANT_BOOL B[4];
} A;
}
 
Generated .NET code:
 
[StructLayout(LayoutKind.Sequential, Pack=2), Guid("0AB14DF8-BF44-4E2E-A948-5D2D672FB678")]
public struct A
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4)]
public bool[] B;
}
 
Expected code:
 
[StructLayout(LayoutKind.Sequential, Pack=2), Guid("0AB14DF8-BF44-4E2E-A948-5D2D672FB678")]
public struct A
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4, ArraySubType=UnmanagedType.VariantBool)]
public bool[] B;
}
 
See also https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=470491 and http://clrinterop.codeplex.com/WorkItem/View.aspx?WorkItemId=3009

comments