MIDL changes the Interface name

前端 未结 1 1655
悲哀的现实
悲哀的现实 2021-01-19 15:00

I have a COM dll , which is consumed by .NET applications using COM Inter-op. In one of the CoClasses , there is an Interface called IT6TrackData and it has one get propert

相关标签:
1条回答
  • 2021-01-19 15:05

    This is the side-effect of a hack in the type library generator built into Windows. It has a workaround for trouble caused by a case-insensitive language. Which might declare a type in one casing but refer to it elsewhere in another casing. Visual Basic is the prime example of such a language.

    The hack is very crude, it takes the casing of the first identifier it encounters and then changes the casing of any subsequent identifier to match. The most typical cause of an unexpected casing change is the name of a parameter, typically spelled with a lower-case first letter. So you probably had a "trackData" method parameter in a previous version of the code.

    And in your revision, either the order of the identifiers changed or you renamed or removed that parameter. Now getting "TrackData" instead.

    If you have existing client code around that depends on the original casing then there's little you can do but change the casing in your source. Fugly fix, but unsurprising to your clients since they can't tell the difference :)

    0 讨论(0)
提交回复
热议问题