Index: branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp
===================================================================
--- branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp	(revision 806)
+++ branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp	(revision 815)
@@ -17,14 +17,13 @@
 #include <limits.h>
 #include <shlobj.h>
-#include <process.h>
-#include <fcntl.h>
-#include <io.h>
 #include <shlwapi.h>
 #include <tchar.h>
-#include <stdarg.h>
 
 //boost libraries
 #include <boost/foreach.hpp>
-
+#include <boost/cast.hpp>
+
+#pragma warning(push)
+#pragma warning(disable: 4244 6326)
 #include <boost/archive/xml_oarchive.hpp>
 #include <boost/archive/xml_iarchive.hpp>
@@ -39,4 +38,5 @@
 #include <boost/serialization/map.hpp>
 #include <boost/serialization/version.hpp>
+#pragma warning(pop)
 
 #include <jenga/include/jenga.h>
@@ -46,7 +46,9 @@
 using namespace Jenga::Common;
 
+using boost::polymorphic_downcast;
+
 template<class T_xml_schema> void BoostSerializationSupport<T_xml_schema>::echo( const char *msg ) const
 {
-	MessageBox( NULL, msg, "XMLシリアライズの例外", MB_OK );
+	MessageBox( NULL, msg, "シリアライズの例外", MB_OK );
 }
 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( std::istream& ifs, bool isShowExceptionMessage )
@@ -58,9 +60,9 @@
 
 		// ファイルから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -91,9 +93,9 @@
 
 		// ファイルに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -151,5 +153,5 @@
 
 		// 文字列ストリームから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
 
 		isSuccessful = true;
@@ -176,9 +178,9 @@
 
 		// 文字列ストリームに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		echo( e.what() );
@@ -208,9 +210,9 @@
 
 		// ファイルから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -246,9 +248,9 @@
 
 		// ファイルに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -286,9 +288,9 @@
 
 		// 文字列ストリームから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		echo( e.what() );
@@ -310,9 +312,9 @@
 
 		// 文字列ストリームに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		echo( e.what() );
@@ -339,9 +341,9 @@
 
 		// ファイルから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -377,9 +379,9 @@
 
 		// ファイルに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		if( isShowExceptionMessage )
@@ -417,5 +419,5 @@
 
 		// 文字列ストリームから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
 
 		isSuccessful = true;
@@ -442,9 +444,9 @@
 
 		// 文字列ストリームに書き出し
-		oa << boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
-
-		isSuccessful = true;
-	}
-	catch( boost::archive::archive_exception e )
+		oa << boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema const*>(this) );
+
+		isSuccessful = true;
+	}
+	catch( boost::archive::archive_exception const& e )
 	{
 		echo( e.what() );
@@ -475,5 +477,5 @@
 
 		// 文字列ストリームから読込
-		ia >> boost::serialization::make_nvp( RootTagName(), *(T_xml_schema *)this );
+		ia >> boost::serialization::make_nvp( RootTagName(), *polymorphic_downcast<T_xml_schema*>(this) );
 
 		isSuccessful = true;
