Search code examples
c++visual-studio-2010idlmidl

Weird IDL error after migration to VS2010


Here's a very simple IDL interface that we've used successfully under VS2008 (arguments list shortened for brevity):

interface Mailer
{
    string findNode( [in] string requestedNode );
    unsigned short addMessage( [in] string msg, [in] unsigned short kind );
};

We're migrating the solution to VS2010 SP1. Now we have the following build error:

M.idl(3): error MIDL2025: syntax error : expecting a type specification near "string"

This always worked like a charm using VS2008 SP1 Note that I already replaced in by [in]. While scratching my head, I discovered that MIDL 2010 also dislikes in but don't say anything about [in].

Note that unsigned short is accepted (as observed by inverting the 2 methods of the interface).

How come? How can I make MIDL understand string again ?

TIA.


Solution

  • It appears that the IDL file, although present in the project, isn't used at all. VS2008 silently ignored it (as it would do for an unreferenced .h file). For some reason, VS2010 tries to compile it even if it's not referenced anywhere else. And since the contents is totally buggy (string is indeed not a native IDL type but an attribute as best), I now have errors.

    Solution: Exclude file from project!