Declaring Enums

  • Thread starter Thread starter Terry Holland
  • Start date Start date
T

Terry Holland

I have a an assembly with the following code


Module modEnums
Public Enum enuFixType
ftyButtSide 'jamb full height, header inside jambs
ftyButtTop 'header full width, jambs butt up to header
ftyMorticeSide 'tenons at each end of header
ftyMorticeTop 'tenons at end of jambs
End Enum
End Module

Public Class clsSubFrame

Public Property FixType() As enuFixType
Get
Return m_ftyFixType
End Get
Set(ByVal Value As enuFixType)
m_ftyFixType = Value
End Set
End Property

.......

End Class

This won't build because I get the following error.
C:\_Development\Door Schedule\Door Schedule VB\BO\clsSubFrame.vb(26):
'FixType' cannot expose a Friend type outside of the Public class
'clsSubFrame'.

I want enuFixType availabe to all of my application. Could someone tell me
how/where to declare it to avoid this error.

tia

Terry Holland
 
Terry Holland said:
I have a an assembly with the following code


Module modEnums
Public Enum enuFixType
ftyButtSide 'jamb full height, header inside jambs
ftyButtTop 'header full width, jambs butt up to header
ftyMorticeSide 'tenons at each end of header
ftyMorticeTop 'tenons at end of jambs
End Enum
End Module

Public Class clsSubFrame

Public Property FixType() As enuFixType
Get
Return m_ftyFixType
End Get
Set(ByVal Value As enuFixType)
m_ftyFixType = Value
End Set
End Property

......

End Class

This won't build because I get the following error.
C:\_Development\Door Schedule\Door Schedule VB\BO\clsSubFrame.vb(26):
'FixType' cannot expose a Friend type outside of the Public class
'clsSubFrame'.

The module 'modEnums' is implicitly 'Friend', not 'Public'. Eiter add the
'Public' access modifier or declare the enum outside the module (the latter
is the preferred way).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top