简体   繁体   English

防止COM名称管理

[英]Preventing COM Name Mangling

I am trying to write a replacement for a VB6 dll that is referenced by another VB6 in c#.net. 我正在尝试编写一个由c#.net中的另一个VB6引用的VB6 dll的替代品。

For now we can only work on the later and I am having some success with this. 现在我们只能在后期工作,我在这方面取得了一些成功。 Except I have run into a problem. 除了我遇到了问题。

My Enums are being mangling resulting it being called 'A1BACSTrans_BACSAU' instead of the expect 'BACSAU' 我的枚举正在被破坏,导致它被称为'A1BACSTrans_BACSAU'而不是期望'BACSAU'

the legacy code will (obviously) no longer compile. 遗留代码(显然)不再编译。

Can this be prevented? 这可以预防吗? if so, how? 如果是这样,怎么样? I have heard of modifying the IDL but I can see no references in their to a mangled name only unmangled... 我听说过修改IDL,但是我看到他们没有引用一个错误的名字,只是没有...

Thank you in advance! 先感谢您!

Guys, I have been discussing this over at c-sharpcorner also and although I mainly arrived at the solution myself I have document it there 伙计们,我一直在c-sharpcorner讨论这个问题,虽然我主要是自己解决了这个问题,但我已经在那里记录了

http://www.c-sharpcorner.com/Forums/Thread/111642/preventing-com-name-mangling.aspx http://www.c-sharpcorner.com/Forums/Thread/111642/preventing-com-name-mangling.aspx

Basically changing the IDL is the way I found to do it. 基本上改变IDL是我发现的方式。

I'd love to know if there is a way to do it in code, maybe an attribute but if there is a way I don't know it! 我想知道是否有办法在代码中执行此操作,可能是属性,但如果有一种方法我不知道它!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM