Class EnumBase<T As EnumBase>
Protected
	value As Long
	lpszName As LPTSTR
Public
	Sub EnumBase(value As Long,lpszName As LPTSTR)
		This.value = value
		This.lpszName = lpszName
	End Sub

	Sub EnumBase( enumBase As EnumBase )
		This.value = enumBase.value
		This.lpszName = enumBase.lpszName
	End Sub

	Sub ~EnumBase()
	End Sub

	Override Function ToString() As String
		Return New String( lpszName )
	End Function

	Sub Copy(obj As EnumBase)
		This.value = obj.value
		This.lpszName = obj.lpszName
	End Sub

	Function Operator() As Int64
		Return This.value
	End Function
	Function Operator() As Long
		Return This.value
	End Function
	Function Operator() As DWord
		Return This.value
	End Function
	Function Operator() As Boolean
		Return ( This.value <> 0 )
	End Function

	Function Operator == (value As Long) As Boolean
		Return ( This.value = value )
	End Function

	Function Operator == (enumObj As T) As Boolean
		Return ( This.value = enumObj.value )
	End Function

	Function Operator <> (value As Long) As Boolean
		Return Not( This = value)
	End Function

	Function Operator <> (enumObj As T) As Boolean
		Return Not( This = enumObj)
	End Function

	Function Operator or (enumObj As T) As T
		Return New EnumBase( This.value or enumObj.value, This.lpszName )
	End Function

	Function Operator and (enumObj As T) As T
		Return New EnumBase( This.value and enumObj.value, This.lpszName )
	End Function
End Class
