views:

27

answers:

1

I have a COM project that contains a number of IDL files, some of which are imported into other ones. How does Visual Studio decide which ones to compile (using MIDL) first?

I want to control the order. I have a master IDL file which contains my library declaration with several imports, and I get a build error if it is not the first one compiled.

(If any of this sounds really weird... I'm new to COM/ATL, and it's really, really confusing).

A: 

You can't ask Visual Studio to build .ild files in a specific order. Instead you can #include some of .idl files into other .idl files and set the files you imported to "excluded from build". This way MIDL will not compile the imported files separately, instead it will include their contents into specific place of another file and compile as the part of that file (same effect as with C preprocesor #include).

sharptooth