MIDL changes case of identifier when compiling IDL file
midl
Solution
This is a terrible bug/feature of MIDL. It doesn't allow the same identifier to appear with different casing, so it replaces all subsequent instances of a word with the casing from the first time it was seen.
See the KB220137
Problem
I've got a snippet of IDL that looks like this: ``` [ object, uuid(...), pointer_default(unique) ] interface IVirtualMachine { /* ... */ } [ object, uuid(...), pointer_default(unique) ] interface IVirtualServer : IUnknown { HRESULT FindVirtualMachine( [in] BSTR configurationName, [out,retval] IVirtualMachine **virtualMachine); }; [ uuid(...), version(1.0) ] library VirtualServerLib { [ uuid(...) ] coclass VirtualServer { [default] interface IVirtualServer; }; [ uuid(...) ] coclass VirtualMachine { [default] interface IVirtualMachine; }; }; ``` ...when I compile it with MIDL and then look in the generated type library, `VirtualMachine` (upper-case V) has been turned into `virtualMachine` (lower-case V). If I call my coclass `XirtualMachine`, for example, it's all good. What the hell?