Thursday, August 20, 2009

can't inherit Enum because of value type

Enum "Inheritance" - Stack Overflow
This is not possible. Enums cannot inherit from other enums. In fact all enums must actually inherit from System.Enum. C# allows syntax to change the underlying representation of the enum values which looks like inheritance, but in actuality they still inherit from System.enum.

See section 8.5.2 of the CLI spec for the full details. Relevant information from the spec

* All enums must derive from System.Enum
* Because of the above, all enums are value types and hence sealed


Tuesday, August 18, 2009

Convert char[] to string^ in c++

convert char[] to string ^
char errMessage[16*256] = ". . .";

String ^ strErrorMessage = gcnew String(errMessage);