Why error MIDL2272: (async) interface must derive from another (async) interface ?
I'm getting a error MIDL2272 in line 24 when compiling the following IDL file with VS2015:
error MIDL2272: (async) interface must derive from another (async) interface : [ Interface 'IVDAAA' ]
Code:
import "oaidl.idl";
import "ocidl.idl";
[
uuid(AAAAAAAA-BBBB-AAAA-AAAA-AAAAAAAAAAAA),
helpstring("IDLTEST 1.0 Type Library"),
version(1.0)
]
library IDLTEST
{
// Forward declarations of interfaces do not help here
//interface IVDAAA;
//interface IVDBBB;
//interface IVDCCC;
[
uuid(AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA),
helpstring("helpstring"),
object,
dual
]
interface AAA : BBB
{
}
[
uuid(BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB),
helpstring("helpstring"),
object,
dual
]
interface BBB : CCC
{
}
[
uuid(CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC),
helpstring("helpstring"),
object,
dual
]
interface CCC : IUnknown
{
}
}
If I comment out the interface AAA block or swap the interface CCC block before interface AAA it works. (Forward declarations of interfaces do not help here)
Has someone a explanation for this behavior or a solution? (I can't change the order of interfaces because the code is generated.)
I found a post that this is a limitation/bug(?) in MIDL: http://marc.info/?l=ms-dcom&m=103440617319140&w=2
Can someone confirm that MIDL is limited in the level of derived interfaces?
Re: Why error MIDL2272: (async) interface must derive from another (async) interface
Is this c++?? - this is a c++ programming forum!
Re: Why error MIDL2272: (async) interface must derive from another (async) interface
Yes, C++/COM. => Defining COM Interfaces via IDL. I found some topics in this section that are IDL related. So because of this and because I didn't find a better matching section I asked this here.
Re: Why error MIDL2272: (async) interface must derive from another (async) interface
Quote:
Originally Posted by
tracefinder
If I comment out the interface AAA block or swap the interface CCC block before interface AAA it works. (Forward declarations of interfaces do not help here)
Has someone a explanation for this behavior or a solution? (I can't change the order of interfaces because the code is generated.)
As long as it depends on code generation, and you are not able to fix MIDL compiler, the only option is to fix code generation. Or tweak it some way.