I am running a COM-interop project. Substituting some VB and C ++ ATL COM projects with C # and .NET Interop. When I define enumerations in .NET and they are made by ComVisible, they become available as Typelib.EnumType_EnumValue only for Typelib.EnumValue. The typelib exporter does this to ensure that value names are unique. But I know that all my enumerations are unique, so I do not want underlining. There is also a lot of client code that needs to be changed if I don't get rid of underscores.
To find a solution to this problem, I defined the enumeration in the IDL file and created a search between typelib and .Net between them.
[
uuid(64893FD4-359D-46B9-BC1E-48C055796104),
version(1.0),
helpstring("ABC"),
helpfile("AAA.chm"),
helpcontext(0x00000001)
]
library EnumTypeLib
{
importlib("stdole2.tlb");
typedef [uuid(8FF85069-C4E2-4540-A277-4C0F3C19B807), helpstring("MyEnum"), helpcontext(0x00000066)]
enum MyEnum {
Value1 = 0,
Value2 = 1,
} MyEnum;
};
I am creating a typelibrary with MIDL.exe, which creates a tlb file.
tlbimp.exe. , Interop.
tlbimp OpenStructureAdapterEnum.tlb/keyfile:KeyFile.snk
regasm.exe
. , COM- OLE/COM Object Viewer VBA VB6. , COM, , , .
[restricted] void Missing7();
[restricted] void Missing8();
[restricted] void Missing9();
[restricted] void Missing10();
COM, ( ) .net Interop?