简体   繁体   中英

Preventing COM Name Mangling

I am trying to write a replacement for a VB6 dll that is referenced by another VB6 in c#.net.

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'

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...

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

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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