[英]C# Com Enum and VB6
Hi I created C# Exe Com Server and refer it from VB6 application. 您好我创建了C#Exe Com Server并从VB6应用程序中引用它。 The problem is that all the enums are exposed with "strange name" in the vb app: EnumName_EnumeItem, while reffered from then VB6 code as EnumName.EnumItem.
问题是所有的枚举都在vb app:EnumName_EnumeItem中以“奇怪的名字”公开,而从VB6代码引用为EnumName.EnumItem。
The VB6 application code cannot be modified. VB6应用程序代码无法修改。 Wondering around I saw I can change this definitions by changing the idl extract fro the tlb, but failed to understand exactly how it's done, and what are the tools for the job.
想知道我能看到我可以通过改变tlb的idl提取来改变这个定义,但却无法准确理解它是如何完成的,以及这项工作的工具是什么。
Any suggestions how to set the enums easily as possible? 有关如何轻松设置枚举的任何建议吗?
The code: 编码:
public enum enResultCode : uint
{
enRCNone = 0x00000000,
enRCNotFound = 0x00000001,
enRCFoundOnServer = 0x00000002,
enRCFoundOnLocal = 0x00000003,
enRCDatabaseError = 0x00000004,
enRCAborted = 0xFFFFFFFF,
enRCServerError = 0xFFFFFFFE,
enRCLocalError = 0xFFFFFFFD
}
Shown in VB6 as: 在VB6中显示为:
instead of: 代替:
enResultCode.EnumItemName
I think you're correct the only way to do this is to modify the IDL yourself. 我认为你是对的,唯一的办法是自己修改IDL。 I can tell you a little about how it's done...
我可以告诉你一些关于它是如何完成的......
That should be enough. 那应该够了。 Sorry I can't give you all the correct command line switches but I'm not on a Windows machine right now.
对不起,我不能给你所有正确的命令行开关,但我现在不在Windows机器上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.