Monday, May 08, 2006

[C++] Compatibility issue (VS 6>VS2005) with IDL files

In this blog entry, my Colleague Ronald Zeleznjak describes a problem faced by one of our teams working in C++:

The challenge that we faced here in Ekobit, was that, every time our project (which is migrated from Visual Studio 6) was compiled, idl file was compiled too. This means, that idl file will be always recompiled, although we haven’t changed a thing there. Moreover, since some of generated files were included into the project, (part of our) project was compiled every time although NOTHING has changed. This is time consuming, annoying and downright ugly. To make things more interesting, projects created in Visual Studio 2005 don’t have this kind of problem.

So, we have found out that the problem lies in the Output properties of the idl file. It seems that when compiler checks whether to build the idl file, it checks it for the proxy file as well. To do that, it uses the name of IID file and adds extension (instead of using the name in property Proxy File). If these names are different (our case), proxy file is treated as nonexistent – so idl is rebuilt. During that action, proxy file is saved with the “real” (as it is written in the property) name and we are left scratching our heads.

From here on, the solution was simple. Use the same file names for IID File property and Proxy File property (only change the extension). By the way, they are the same by default for projects created in Visual Studio 2005:-).

Did we mention that this worked fine in Visual Studio 6 ;-)?


Post a Comment

Links to this post:

Create a Link

<< Home