DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us