|
|
|
start date: Mon, 6 Aug 2007 08:52:00 -0700,
posted on: microsoft.public.dotnet.framework.interop
back
| Thread Index |
|
1
Adnan
|
|
2
Johannes Passing
|
Enums and Import of Type Library
I have written a COM interop DLL in VB.NET for .NET 2.0.50727. In it, I have
defined one of the enums as follows:
Public Enum side : uint
All = &HFFFFFFFF
Left = &H0
Right = &H1
Count = &H2
Both = &H3
Neutral = &H4
Undef = &HEEEEEEEE
End Enum
I generate the type library via regasm.exe. When I load this .tlb in VS
2005, it shows following for "side" type:
Enum side
Constant side_All = -1 (&Hffffffff)
Constant side_Both = 3
.....
.....
Why is it putting "side" in the beginning of my values? I had defined only
"All" but now it has become "side_All"?
Is there a way for me to avoid it from doing so?
Thanks,
Adnan
Date:Mon, 6 Aug 2007 08:52:00 -0700
Author:
|
Re: Enums and Import of Type Library
Unlike VB.Net, enums in IDL do not define a namespace. Two different
enums both including a symbol 'All' would thus collide. To avoid such
collisions, regasm prepends the name of the enum to ensure uniqueness.
--Johannes
Adnan wrote:
> I have written a COM interop DLL in VB.NET for .NET 2.0.50727. In it, I have
> defined one of the enums as follows:
> Public Enum side : uint
> All = &HFFFFFFFF
> Left = &H0
> Right = &H1
> Count = &H2
> Both = &H3
> Neutral = &H4
> Undef = &HEEEEEEEE
> End Enum
>
> I generate the type library via regasm.exe. When I load this .tlb in VS
> 2005, it shows following for "side" type:
> Enum side
> Constant side_All = -1 (&Hffffffff)
> Constant side_Both = 3
> ....
> ....
>
> Why is it putting "side" in the beginning of my values? I had defined only
> "All" but now it has become "side_All"?
>
> Is there a way for me to avoid it from doing so?
>
> Thanks,
> Adnan
>
--
Johannes Passing - http://int3.de/
Date:Tue, 07 Aug 2007 09:26:45 +0200
Author:
|
|
|