Index: trunk/Include/Classes/System/Exception.ab
===================================================================
--- trunk/Include/Classes/System/Exception.ab	(revision 385)
+++ trunk/Include/Classes/System/Exception.ab	(revision 391)
@@ -3,4 +3,5 @@
 #require <Classes/ActiveBasic/misc.ab>
 
+Namespace ActiveBasic
 '右のコメントは対応するCOR_E_ナントカのコード
 Const AB_E_EXCEPTION = &h80041500 '80131500
@@ -12,4 +13,6 @@
 Const AB_E_NOTSUPPORTED = &h80041515 '80131515
 Const AB_E_PLATFORMNOTSUPPORTED = &h80041539 '80131539
+
+End Namespace
 
 /*
@@ -57,5 +60,5 @@
 	Sub Exception()
 		init(GetType().FullName, Nothing)
-		hr = AB_E_EXCEPTION
+		hr = ActiveBasic.AB_E_EXCEPTION
 	End Sub
 	/*!
@@ -65,5 +68,5 @@
 	Sub Exception(message As String)
 		init(message, Nothing)
-		hr = AB_E_EXCEPTION
+		hr = ActiveBasic.AB_E_EXCEPTION
 	End Sub
 	/*!
@@ -74,5 +77,5 @@
 	Sub Exception(message As String, innerException As Exception)
 		init(message, innerException)
-		hr = AB_E_EXCEPTION
+		hr = ActiveBasic.AB_E_EXCEPTION
 	End Sub
 
@@ -190,5 +193,5 @@
 	Sub SystemException()
 		Exception(GetType().FullName, Nothing)
-		HResult = AB_E_SYSTEM
+		HResult = ActiveBasic.AB_E_SYSTEM
 	End Sub
 	/*!
@@ -198,5 +201,5 @@
 	Sub SystemException(message As String)
 		Exception(message, Nothing)
-		HResult = AB_E_SYSTEM
+		HResult = ActiveBasic.AB_E_SYSTEM
 	End Sub
 	/*!
@@ -207,5 +210,5 @@
 	Sub SystemException(message As String, innerException As Exception)
 		Exception(message, innerException)
-		HResult = AB_E_SYSTEM
+		HResult = ActiveBasic.AB_E_SYSTEM
 	End Sub
 End Class
@@ -224,5 +227,5 @@
 	Sub ArgumentException()
 		SystemException("One or more arguments have invalid value.", Nothing)
-		HResult = AB_E_ARGUMENT
+		HResult = ActiveBasic.AB_E_ARGUMENT
 	End Sub
 	/*!
@@ -232,5 +235,5 @@
 	Sub ArgumentException(message As String)
 		SystemException(message, Nothing)
-		HResult = AB_E_ARGUMENT
+		HResult = ActiveBasic.AB_E_ARGUMENT
 	End Sub
 	/*!
@@ -241,5 +244,5 @@
 	Sub ArgumentException(message As String, innerException As Exception)
 		SystemException(message, innerException)
-		HResult = AB_E_ARGUMENT
+		HResult = ActiveBasic.AB_E_ARGUMENT
 	End Sub
 	/*!
@@ -251,5 +254,5 @@
 		SystemException(message, Nothing)
 		param = paramName
-		HResult = AB_E_ARGUMENT
+		HResult = ActiveBasic.AB_E_ARGUMENT
 	End Sub
 	/*!
@@ -262,5 +265,5 @@
 		SystemException(message, innerException)
 		param = paramName
-		HResult = AB_E_ARGUMENT
+		HResult = ActiveBasic.AB_E_ARGUMENT
 	End Sub
 
@@ -337,5 +340,5 @@
 	Sub ArgumentOutOfRangeException()
 		ArgumentException("One or more arguments ware out of range value.", "", Nothing)
-		HResult = AB_E_ARGUMENTOUTOFRANGE
+		HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE
 	End Sub
 	/*!
@@ -345,5 +348,5 @@
 	Sub ArgumentOutOfRangeException(message As String)
 		ArgumentException(message, "", Nothing)
-		HResult = AB_E_ARGUMENTOUTOFRANGE
+		HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE
 	End Sub
 	/*!
@@ -354,5 +357,5 @@
 	Sub ArgumentOutOfRangeException(message As String, innerException As Exception)
 		ArgumentException(message, "", innerException)
-		HResult = AB_E_ARGUMENTOUTOFRANGE
+		HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE
 	End Sub
 	/*!
@@ -363,5 +366,5 @@
 	Sub ArgumentOutOfRangeException(message As String, paramName As String)
 		ArgumentException(message, paramName, Nothing)
-		HResult = AB_E_ARGUMENTOUTOFRANGE
+		HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE
 	End Sub
 	/*!
@@ -374,5 +377,5 @@
 		ArgumentException(message, paramName, Nothing)
 		actualValueObject = actualValue
-		HResult = AB_E_ARGUMENTOUTOFRANGE
+		HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE
 	End Sub
 
@@ -411,5 +414,5 @@
 	Sub IndexOutOfRangeException()
 		SystemException("The index was out of range value.", Nothing)
-		HResult = AB_E_INDEXOUTOFRANGE
+		HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE
 	End Sub
 	/*!
@@ -419,5 +422,5 @@
 	Sub IndexOutOfRangeException(message As String)
 		SystemException(message, Nothing)
-		HResult = AB_E_INDEXOUTOFRANGE
+		HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE
 	End Sub
 	/*!
@@ -428,5 +431,5 @@
 	Sub IndexOutOfRangeException(message As String, innerException As Exception)
 		SystemException(message, innerException)
-		HResult = AB_E_INDEXOUTOFRANGE
+		HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE
 	End Sub
 End Class
@@ -445,5 +448,5 @@
 	Sub InvalidOperationException()
 		SystemException("The operation is invalid.", Nothing)
-		HResult = AB_E_INVALIDOPERATION
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
 	End Sub
 	/*!
@@ -453,5 +456,5 @@
 	Sub InvalidOperationException(message As String)
 		SystemException(message, Nothing)
-		HResult = AB_E_INVALIDOPERATION
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
 	End Sub
 	/*!
@@ -462,6 +465,65 @@
 	Sub InvalidOperationException(message As String, innerException As Exception)
 		SystemException(message, innerException)
-		HResult = AB_E_INVALIDOPERATION
-	End Sub
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
+	End Sub
+End Class
+
+/*!
+@brief	博されたオブジェクトを操作しようとしたことを表す例外
+@author	Egtra
+@date	2007/12/06
+*/
+Class ObjectDisposedException
+	Inherits InvalidOperationException
+Public
+	/*!
+	@biref	コンストラクタ
+	*/
+	Sub ObjectDisposedException()
+		InvalidOperationException("The object has been disposed.", Nothing)
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
+	End Sub
+	/*!
+	@biref	コンストラクタ
+	@param[in] message	エラーメッセージ
+	*/
+	Sub ObjectDisposedException(message As String)
+		InvalidOperationException(message, Nothing)
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
+	End Sub
+	/*!
+	@biref	コンストラクタ
+	@param[in] message	エラーメッセージ
+	@param[in] innerException	内部例外
+	*/
+	Sub ObjectDisposedException(message As String, innerException As Exception)
+		InvalidOperationException(message, innerException)
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
+	End Sub
+	/*!
+	@biref	コンストラクタ
+	@param[in] objectName	操作しようとしたオブジェクトの名前
+	@param[in] message	エラーメッセージ
+	*/
+	Sub ObjectDisposedException(objectName As String, message As String)
+		InvalidOperationException(message, Nothing)
+		HResult = ActiveBasic.AB_E_INVALIDOPERATION
+		objName = " object: " + objectName
+	End Sub
+	/*!
+	@brief	この例外が発生したとき、操作しようとしていたオブジェクトの名前を返す。
+	*/
+	Function ObjectName() As String
+		Return objName
+	End Function
+
+	Override Function ToString() As String
+		ToString = Super.ToString()
+		If Not ActiveBasic.IsNothing(objName) Then
+			ToString += objName
+		End If
+	End Function
+Private
+	objName As String
 End Class
 
@@ -513,5 +575,5 @@
 	Sub NotSupportedException()
 		SystemException("This operation is not supported,", Nothing)
-		HResult = AB_E_NOTSUPPORTED
+		HResult = ActiveBasic.AB_E_NOTSUPPORTED
 	End Sub
 	/*!
@@ -521,5 +583,5 @@
 	Sub NotSupportedException(message As String)
 		SystemException(message, Nothing)
-		HResult = AB_E_NOTSUPPORTED
+		HResult = ActiveBasic.AB_E_NOTSUPPORTED
 	End Sub
 	/*!
@@ -530,5 +592,5 @@
 	Sub NotSupportedException(message As String, innerException As Exception)
 		SystemException(message, innerException)
-		HResult = AB_E_NOTSUPPORTED
+		HResult = ActiveBasic.AB_E_NOTSUPPORTED
 	End Sub
 End Class
@@ -547,5 +609,5 @@
 	Sub PlatformNotSupportedException()
 		NotSupportedException("This operation is not supported in this platform.", Nothing)
-		HResult = AB_E_PLATFORMNOTSUPPORTED
+		HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED
 	End Sub
 	/*!
@@ -555,5 +617,5 @@
 	Sub PlatformNotSupportedException(message As String)
 		NotSupportedException(message, Nothing)
-		HResult = AB_E_PLATFORMNOTSUPPORTED
+		HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED
 	End Sub
 	/*!
@@ -564,5 +626,5 @@
 	Sub PlatformNotSupportedException(message As String, innerException As Exception)
 		NotSupportedException(message, innerException)
-		HResult = AB_E_PLATFORMNOTSUPPORTED
+		HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED
 	End Sub
 End Class
