Unable to compile IDL file, error MIDL2020

659 Views Asked by At

I'm trying to create a COM component (C++, with ATL), my goal is to derive from the ITsSbPlugin interface.

I'm stuck at the very beginning: I'm not able to compile my IDL file, with MIDL (Version 8.01.0626)...

MIDL shows this error:

midl\oleaut32.dll : error MIDL2020 : error generating type library : LayOut failed : ITsSbTarget (0x80029C83) 0x80029C83 is the error code for "Inconsistent property functions"

The error won't show if I remove this from the library section in my IDL file:

[
    uuid("37f1f870-3c5d-4a21-b515-034543f2c411")
]
coclass TestModule
{
    [default] interface ITestModule;
};

My IDL file:

// TestModule.idl : IDL source for TestModule
//

// This file will be processed by the MIDL tool to
// produce the type library (TestModule.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
import "unknwn.idl";
import "sbtsv.idl";

[
    object,
    uuid("193a132b-2aed-4be9-a222-1b1b13ec9dd5")
]
interface ITestModule : ITsSbPlugin
{
    HRESULT Initialize(
        ITsSbProvider* pProvider,
        ITsSbPluginNotifySink* pNotifySink,
        ITsSbPluginPropertySet* pPropertySet
    );

    HRESULT Terminate(HRESULT hr);
};


[
    uuid("d09d55ae-9bf3-44d4-ad46-22c6144ab4a8"),
    version(1.0)
]
library TestModuleLib
{
    importlib("stdole2.tlb");

    [
        uuid("37f1f870-3c5d-4a21-b515-034543f2c411")
    ]
    coclass TestModule
    {
        [default] interface ITestModule;
    };
};

I don't understand what this error means, what can I do to properly compile this IDL?

0

There are 0 best solutions below