473,496 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Accessing a __value enum enumerated value from another assembly

In an assembly I have a __value enum with some enumerated constants, ie.

namespace X
{
public __value enum MyEnum
{
ValueA,
ValueB
};
}

From another assembly which references the assembly in which the above
exists, I attempt to refer to the ValueA as X::ValueA, only to get an error
message saying that ValueA is not a member of X. When I attempt to refer to
ValueA as X::MyEnum::ValueA, all is well.

The change is not a big thing but I was was under the distinct impression
that one only needed to specify the longer syntax when there was another
ValueA in namespace X. Is this a bug in the current compiler, or have I
missed something in the ability to specify an enumerated constant ?
Nov 17 '05 #1
0 1590

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

Similar topics

3
341
by: Edward Diener | last post by:
In an assembly I have a __value enum with some enumerated constants, ie. namespace X { public __value enum MyEnum { ValueA, ValueB }; }
6
4675
by: PengYu.UT | last post by:
Hi, I have some problem when I use enum with stream. The code segment is listed below. I know if I change the first line to "int op;", there will not be any error. However, what I really want is...
13
6514
by: Martin | last post by:
This post asks two questions, which I've illustrated in one C source file (see below), which clean compiles on my GNU compiler. 1. In K&R2, Section A8.9 it says "Declarations whose storage class...
4
1976
by: O. Zimmermann | last post by:
Hi all, A variable with an enumerated type can be set with a value from any other generic "enum" type in the program, or with an integer value, without notice to the user, neither at compilation...
10
7106
by: Ken Allen | last post by:
The ToString() function, when applied to a variable that is an enumeration type, results in a string that is the name of the enumerated value that was defined in the source code. This is cool, but...
0
1179
by: Edward Diener | last post by:
If a __value class with an event is put into an assembly, and a __gc class in another assembly attempts to attach its own event handler to the __value class's event of an embedded object of the...
15
1368
by: Edward Diener | last post by:
Why is it impossible to have a __value class instance variable in a __nogc class when it is possible to have a built-in type instance variable in a __nogc class ? __value class X { int a; };...
10
23545
by: kar1107 | last post by:
Hi all, Can the compiler chose the type of an enum to be signed or unsigned int? I thought it must be int; looks like it changes based on the assigned values. Below if I don't initialize...
7
9801
by: Harris | last post by:
Dear all, I have the following codes: ====== public enum Enum_Value { Value0 = 0, Value1 = 10,
34
11126
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.