Problems with naming(lowercase/uppercase) when exporting COM component from C#

↘锁芯ラ 提交于 2019-12-06 13:51:36

This is a known problem with type libraries. It is in fact by design for very obscure reasons, almost certainly having something to do with not knowing whether the compiler that reads the type library is sensitive to casing. A Basic compiler is not, a C++ compiler is. The fix was crude however, it does not classify the identifier by usage.

If any declaration before your structure declaration also contains an identifier named "type" then the rest of the identifiers will use the letter casing of that first one. The most unexpected case is when it is the name of a method parameter, most typically written in lower-case. Bummer if "Type" is the name of, say, a property, it will be renamed to "type". The crude part.

The only workaround is to use a more specific name that doesn't clash.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!