Once you have created the .idl file once, open its properties and enable "Exclude from assembly."
If you update the file, you can create it manually by selecting the file in Solution Explorer and selecting "Compilation" (shortcut Ctrl + F7 in my setup, but this can change).
If you do not include the generated files in your version control system, a new check will also require you to manually rebuild the .idl file. This case, in particular, can cause a lot of confusion - it might be worth including the generated files under version control.
Another option is to create a custom build tool (or pre-build event) that will compare the last modified date / time of the .idl file with the last modified date / time of the output files, and then call MIDL, if required. This is the behavior that VS uses to determine whether to run CL, but it is not used for MIDL and, as far as I know, cannot be included in VC ++ 2008 project files.
source share