473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Declaring Enums

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
Nov 21 '05 #1
2 1833
"Terry Holland" <th******@sgbgb.co.uk> schrieb:
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).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2
"Terry Holland" <th******@sgbgb.co.uk> schrieb:
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).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: SpaceCowboy | last post by:
I recently got into a discussion with a co-worker about using enums across a dll interface. He wanted to use chars instead, argueing that depending on compiler settings the size of an enum could...
2
by: Faisal | last post by:
Can anyone tell me if it is possible to enumerate through all the Enums within a class . I have a class with many Enums and would like to accees the Enums through an array/collection etc. I can't...
27
by: Mark A. Gibbs | last post by:
i have been toying with the idea of making my enums smarter - ie, more in line with the rest of the language. i haven't tested it yet, but what i came up with is a template like this: template...
5
by: Peter Berry | last post by:
I was surprised and somewhat disappointed by the fact that you cannot declare types in an interface. I discovered this when defining an interface that included events, where the definition of the...
2
by: SpotNet | last post by:
Hello CSharpies, Can Enums in C# be UInt32 Types, and not just Int32 Types. I have a lot of constant declarations that are UInt32 that I want to put in Enums to ease the use of Intellisence. I...
4
by: Martin Pritchard | last post by:
Hi, I'm working on a project that historically contains around 40 enums. In the database various fields refer to the int values of these enums, but of course ref integrity is not enofrced and...
2
by: Simon Elliott | last post by:
I have some legacy C++ code which requires some enums to be 1 or 2 bytes in size. I'd ideally like to be able to specify that a few carefully selected enums are a particular size. By default,...
11
by: Marc Gravell | last post by:
This one stumped me while refactoring some code to use generics... Suppose I declare an enum MyEnum {...} Is there a good reason why MyEnum doesn't implement IEquatable<MyEnum> ? Of course,...
10
by: athanasios.silis | last post by:
Hello everyone, i am attempting to make a structure #include "globalVars.h" struct myStruct{ int offset; unsigned char uChars; } saveVars, getVars;
1
by: Travis | last post by:
Is it possible to forward declare enums that are defined in a cpp so that I can have a method defined in the header file with the enum as a return type?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.