[mapguide-commits] r9971 - in trunk/MgDev: . Common/CoordinateSystem Common/Foundation Common/Foundation/Data Common/Foundation/Exception Common/Foundation/System Common/Geometry Common/Geometry/Buffer Common/Geometry/CoordinateSystem Common/Geometry/Exception Common/Geometry/Parse Common/Geometry/Spatial Common/MapGuideCommon Common/MapGuideCommon/Controller Common/MapGuideCommon/MapLayer Common/MapGuideCommon/Services Common/MapGuideCommon/System Common/MapGuideCommon/Util Common/PlatformBase Common/PlatformBase/Data Common/PlatformBase/MapLayer Common/PlatformBase/Services Common/PlatformBase/Services/PrintLayoutService Desktop Desktop/DesktopUnmanagedApi Desktop/DesktopUnmanagedApi/DotNet Desktop/DesktopUnmanagedApi/JavaApiEx Desktop/DesktopUnmanagedApi/MapGuideApi Desktop/MgDesktop Desktop/MgDesktop/Log Desktop/MgDesktop/MapLayer Desktop/MgDesktop/Services Desktop/MgDesktop/Services/Drawing Desktop/MgDesktop/Services/Feature Desktop/MgDesktop/Services/Feature/Commands Desktop/MgDesktop/Se rvices/Rendering Desktop/MgDesktop/Services/Resource Desktop/MgDesktop/Services/Stylization Desktop/MgDesktop/Services/Tile Desktop/MgDesktop/System Desktop/UnitTest Server/src/Common/Base Server/src/Common/Cache Server/src/Common/Manager Server/src/Core Server/src/Services/Drawing Server/src/Services/Feature Server/src/Services/Kml Server/src/Services/Mapping Server/src/Services/Profiling Server/src/Services/Rendering Server/src/Services/Resource Server/src/Services/ServerAdmin Server/src/Services/Site Server/src/Services/Tile Server/src/UnitTesting UnitTest/Common/FoundationTest UnitTest/Common/FoundationTest/DotNetUnmanagedApi UnitTest/WebTier/DotNet/TestMapGuideApi/ExternalTests Web/src/ApacheAgent Web/src/CgiAgent Web/src/DotNetUnmanagedApi Web/src/DotNetUnmanagedApi/Foundation Web/src/DotNetUnmanagedApi/Geometry Web/src/DotNetUnmanagedApi/MapGuideCommon Web/src/DotNetUnmanagedApi/PlatformBase Web/src/HttpHandler Web/src/IsapiAgent Web/src/JavaApi Web/src/JavaApiEx Web/src/MapG uideApi Web/src/PhpApi Web/src/WebApp Web/src/WebSupport Web/src/mapviewerjava Web/src/mapviewernet Web/src/mapviewerphp Web/src/schemareport

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 10 02:40:20 PDT 2022


Author: jng
Date: 2022-10-10 02:40:18 -0700 (Mon, 10 Oct 2022)
New Revision: 9971

Added:
   trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.cpp
   trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.h
   trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.cpp
   trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.h
Removed:
   trunk/MgDev/Common/Foundation/Exception/ApplicationException.cpp
   trunk/MgDev/Common/Foundation/Exception/ApplicationException.h
   trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.cpp
   trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.h
   trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.cpp
   trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.h
   trunk/MgDev/Common/Foundation/Exception/ConfigurationException.cpp
   trunk/MgDev/Common/Foundation/Exception/ConfigurationException.h
   trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.cpp
   trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.h
   trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.cpp
   trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.h
   trunk/MgDev/Common/Foundation/Exception/DateTimeException.cpp
   trunk/MgDev/Common/Foundation/Exception/DateTimeException.h
   trunk/MgDev/Common/Foundation/Exception/DecryptionException.cpp
   trunk/MgDev/Common/Foundation/Exception/DecryptionException.h
   trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.cpp
   trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.h
   trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.cpp
   trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.h
   trunk/MgDev/Common/Foundation/Exception/DomainException.cpp
   trunk/MgDev/Common/Foundation/Exception/DomainException.h
   trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.cpp
   trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.h
   trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.cpp
   trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.h
   trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.cpp
   trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.h
   trunk/MgDev/Common/Foundation/Exception/EncryptionException.cpp
   trunk/MgDev/Common/Foundation/Exception/EncryptionException.h
   trunk/MgDev/Common/Foundation/Exception/FileIoException.cpp
   trunk/MgDev/Common/Foundation/Exception/FileIoException.h
   trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.cpp
   trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.h
   trunk/MgDev/Common/Foundation/Exception/GridDensityException.cpp
   trunk/MgDev/Common/Foundation/Exception/GridDensityException.h
   trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.cpp
   trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidCastException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidCastException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.h
   trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.cpp
   trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.h
   trunk/MgDev/Common/Foundation/Exception/IoException.cpp
   trunk/MgDev/Common/Foundation/Exception/IoException.h
   trunk/MgDev/Common/Foundation/Exception/LengthException.cpp
   trunk/MgDev/Common/Foundation/Exception/LengthException.h
   trunk/MgDev/Common/Foundation/Exception/LogicException.cpp
   trunk/MgDev/Common/Foundation/Exception/LogicException.h
   trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.cpp
   trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.h
   trunk/MgDev/Common/Foundation/Exception/NotImplementedException.cpp
   trunk/MgDev/Common/Foundation/Exception/NotImplementedException.h
   trunk/MgDev/Common/Foundation/Exception/NullArgumentException.cpp
   trunk/MgDev/Common/Foundation/Exception/NullArgumentException.h
   trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.cpp
   trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.h
   trunk/MgDev/Common/Foundation/Exception/NullReferenceException.cpp
   trunk/MgDev/Common/Foundation/Exception/NullReferenceException.h
   trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.cpp
   trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.h
   trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.cpp
   trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.h
   trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.cpp
   trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.h
   trunk/MgDev/Common/Foundation/Exception/OverflowException.cpp
   trunk/MgDev/Common/Foundation/Exception/OverflowException.h
   trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.cpp
   trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.h
   trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.cpp
   trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.h
   trunk/MgDev/Common/Foundation/Exception/ResourcesException.cpp
   trunk/MgDev/Common/Foundation/Exception/ResourcesException.h
   trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.cpp
   trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.h
   trunk/MgDev/Common/Foundation/Exception/RuntimeException.cpp
   trunk/MgDev/Common/Foundation/Exception/RuntimeException.h
   trunk/MgDev/Common/Foundation/Exception/StreamIoException.cpp
   trunk/MgDev/Common/Foundation/Exception/StreamIoException.h
   trunk/MgDev/Common/Foundation/Exception/SystemException.cpp
   trunk/MgDev/Common/Foundation/Exception/SystemException.h
   trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.cpp
   trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.h
   trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.cpp
   trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.h
   trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.cpp
   trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.h
   trunk/MgDev/Common/Foundation/Exception/UnderflowException.cpp
   trunk/MgDev/Common/Foundation/Exception/UnderflowException.h
   trunk/MgDev/Common/Foundation/Exception/XmlException.cpp
   trunk/MgDev/Common/Foundation/Exception/XmlException.h
   trunk/MgDev/Common/Foundation/Exception/XmlParserException.cpp
   trunk/MgDev/Common/Foundation/Exception/XmlParserException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.cpp
   trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.h
   trunk/MgDev/Common/Geometry/Exception/GeometryException.cpp
   trunk/MgDev/Common/Geometry/Exception/GeometryException.h
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.cpp
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.h
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.cpp
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.cpp
   trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h
   trunk/MgDev/Common/MapGuideCommon/Exception/
   trunk/MgDev/Common/PlatformBase/Exception/
   trunk/MgDev/Desktop/MgDesktop/Exception/
Modified:
   trunk/MgDev/
   trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryBase.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysMacro.h
   trunk/MgDev/Common/CoordinateSystem/CoordSysMeasure.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp
   trunk/MgDev/Common/CoordinateSystem/MentorDictionary.cpp
   trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h
   trunk/MgDev/Common/CoordinateSystem/MentorUtil.cpp
   trunk/MgDev/Common/Foundation/Data/Byte.cpp
   trunk/MgDev/Common/Foundation/Data/ByteSink.cpp
   trunk/MgDev/Common/Foundation/Data/ByteSource.cpp
   trunk/MgDev/Common/Foundation/Data/DateTime.cpp
   trunk/MgDev/Common/Foundation/Data/NamedCollection.cpp
   trunk/MgDev/Common/Foundation/Data/NullableProperty.cpp
   trunk/MgDev/Common/Foundation/Data/Property.cpp
   trunk/MgDev/Common/Foundation/Data/PropertyDefinition.cpp
   trunk/MgDev/Common/Foundation/Data/StringCollection.cpp
   trunk/MgDev/Common/Foundation/Exception/Exception.cpp
   trunk/MgDev/Common/Foundation/Exception/Exception.h
   trunk/MgDev/Common/Foundation/Exception/ExceptionDefs.h
   trunk/MgDev/Common/Foundation/Foundation.h
   trunk/MgDev/Common/Foundation/Foundation.vcxproj
   trunk/MgDev/Common/Foundation/Foundation.vcxproj.filters
   trunk/MgDev/Common/Foundation/FoundationBuild.cpp
   trunk/MgDev/Common/Foundation/System/ByteSourceFileImpl.cpp
   trunk/MgDev/Common/Foundation/System/ByteSourceMemoryImpl.cpp
   trunk/MgDev/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp
   trunk/MgDev/Common/Foundation/System/ByteSourceStreamImpl.cpp
   trunk/MgDev/Common/Foundation/System/ClassFactory.cpp
   trunk/MgDev/Common/Foundation/System/Configuration.cpp
   trunk/MgDev/Common/Foundation/System/ConfigurationHeap.cpp
   trunk/MgDev/Common/Foundation/System/Disposable.cpp
   trunk/MgDev/Common/Foundation/System/DisposableCollection.cpp
   trunk/MgDev/Common/Foundation/System/FileUtil.cpp
   trunk/MgDev/Common/Foundation/System/FoundationClassId.h
   trunk/MgDev/Common/Foundation/System/GuardDisposable.cpp
   trunk/MgDev/Common/Foundation/System/MemoryStreamHelper.cpp
   trunk/MgDev/Common/Foundation/System/Resources.cpp
   trunk/MgDev/Common/Foundation/System/StreamHelper.cpp
   trunk/MgDev/Common/Foundation/System/StreamParser.cpp
   trunk/MgDev/Common/Foundation/System/StreamReader.cpp
   trunk/MgDev/Common/Foundation/System/StreamWriter.cpp
   trunk/MgDev/Common/Foundation/System/Util.cpp
   trunk/MgDev/Common/Foundation/System/Util.h
   trunk/MgDev/Common/Foundation/System/XmlDefs.h
   trunk/MgDev/Common/Foundation/System/XmlUtil.cpp
   trunk/MgDev/Common/Geometry/AgfStream.cpp
   trunk/MgDev/Common/Geometry/ArcSegment.cpp
   trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
   trunk/MgDev/Common/Geometry/Buffer/oobject.cpp
   trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
   trunk/MgDev/Common/Geometry/CurvePolygon.cpp
   trunk/MgDev/Common/Geometry/CurveRing.cpp
   trunk/MgDev/Common/Geometry/CurveString.cpp
   trunk/MgDev/Common/Geometry/Envelope.cpp
   trunk/MgDev/Common/Geometry/GeometricEntity.cpp
   trunk/MgDev/Common/Geometry/Geometry.cpp
   trunk/MgDev/Common/Geometry/Geometry.vcxproj
   trunk/MgDev/Common/Geometry/Geometry.vcxproj.filters
   trunk/MgDev/Common/Geometry/GeometryBuild.cpp
   trunk/MgDev/Common/Geometry/GeometryClassFactory.cpp
   trunk/MgDev/Common/Geometry/GeometryClassId.h
   trunk/MgDev/Common/Geometry/GeometryCommon.h
   trunk/MgDev/Common/Geometry/GeometrySimplifier.cpp
   trunk/MgDev/Common/Geometry/LineString.cpp
   trunk/MgDev/Common/Geometry/LinearRing.cpp
   trunk/MgDev/Common/Geometry/LinearSegment.cpp
   trunk/MgDev/Common/Geometry/Parse/Array.h
   trunk/MgDev/Common/Geometry/Parse/ArrayHelper.cpp
   trunk/MgDev/Common/Geometry/Parse/LexAwkt.cpp
   trunk/MgDev/Common/Geometry/Parse/ParseAwkt.cpp
   trunk/MgDev/Common/Geometry/Polygon.cpp
   trunk/MgDev/Common/Geometry/Spatial/MathUtility.cpp
   trunk/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
   trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp
   trunk/MgDev/Common/MapGuideCommon/Controller/Controller.cpp
   trunk/MgDev/Common/MapGuideCommon/Controller/DwfController.cpp
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
   trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.h
   trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj
   trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj.filters
   trunk/MgDev/Common/MapGuideCommon/MapGuideCommonBuild.cpp
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/MapPlot.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/PackageStatusInformation.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/PrintLayout.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyDataReader.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/Site.h
   trunk/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
   trunk/MgDev/Common/MapGuideCommon/System/CryptographyManager.h
   trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonClassId.h
   trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp
   trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
   trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp
   trunk/MgDev/Common/MapGuideCommon/Util/TimerUtil.cpp
   trunk/MgDev/Common/PlatformBase/Data/IntCollection.cpp
   trunk/MgDev/Common/PlatformBase/Data/SerializableCollection.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/ChangeList.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/Watermark.cpp
   trunk/MgDev/Common/PlatformBase/PlatformBase.h
   trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj
   trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj.filters
   trunk/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp
   trunk/MgDev/Common/PlatformBase/Services/ClassDefinitionCollection.cpp
   trunk/MgDev/Common/PlatformBase/Services/DataPropertyDefinition.cpp
   trunk/MgDev/Common/PlatformBase/Services/DeleteFeatures.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureCommandType.h
   trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureSchema.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureSchemaCollection.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureService.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureService.h
   trunk/MgDev/Common/PlatformBase/Services/FeatureSpatialOperations.h
   trunk/MgDev/Common/PlatformBase/Services/GeometryTypeInfo.cpp
   trunk/MgDev/Common/PlatformBase/Services/InsertFeatures.cpp
   trunk/MgDev/Common/PlatformBase/Services/LockFeatures.cpp
   trunk/MgDev/Common/PlatformBase/Services/ObjectPropertyType.h
   trunk/MgDev/Common/PlatformBase/Services/OrderingOption.h
   trunk/MgDev/Common/PlatformBase/Services/Parameter.cpp
   trunk/MgDev/Common/PlatformBase/Services/ParameterCollection.cpp
   trunk/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/MapViewportBase.cpp
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutBase.cpp
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementBase.cpp
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementCollection.cpp
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutServiceBase.cpp
   trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PropertyMappingCollection.cpp
   trunk/MgDev/Common/PlatformBase/Services/Raster.cpp
   trunk/MgDev/Common/PlatformBase/Services/ReaderType.h
   trunk/MgDev/Common/PlatformBase/Services/ResourceIdentifier.cpp
   trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
   trunk/MgDev/Common/PlatformBase/Services/Service.cpp
   trunk/MgDev/Common/PlatformBase/Services/ServiceRegistry.cpp
   trunk/MgDev/Common/PlatformBase/Services/SpatialContextExtentType.h
   trunk/MgDev/Common/PlatformBase/Services/UnlockFeatures.cpp
   trunk/MgDev/Common/PlatformBase/Services/UpdateFeatures.cpp
   trunk/MgDev/Desktop/
   trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopApiGen.xml
   trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopConstants.xml
   trunk/MgDev/Desktop/DesktopUnmanagedApi/JavaApiEx/catchall.code
   trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/Constants.xml
   trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/MapGuideApiGen.xml
   trunk/MgDev/Desktop/DesktopUnmanagedApi/catchall.code
   trunk/MgDev/Desktop/MgDesktop/Log/LogManager.cpp
   trunk/MgDev/Desktop/MgDesktop/Log/LogThread.cpp
   trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.cpp
   trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.h
   trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.cpp
   trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.h
   trunk/MgDev/Desktop/MgDesktop/MapLayer/Selection.h
   trunk/MgDev/Desktop/MgDesktop/MgDesktop.h
   trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj
   trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj.filters
   trunk/MgDev/Desktop/MgDesktop/MgDesktopBuild.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ByteSourceRasterStreamImpl.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/CryptoDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/DataReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/DataReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.h
   trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ApplySchema.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/DescribeSchema.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/EnumerateDataStores.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/FeatureManipulationCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetConnectionPropertyValues.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetLongTransactions.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetProviderCapabilities.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSchemaMapping.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSpatialContexts.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/InsertCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectAggregateCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectFeatures.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SqlCommand.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/UpdateFeatures.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionPool.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoForcedOneToOneFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDistribution.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureGeometricFunctions.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureNumericFunctions.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureStringFunctions.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/GwsFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/JoinFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProxyDataReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.h
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.h
   trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.h
   trunk/MgDev/Desktop/MgDesktop/Services/MappingService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ProfilingService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MapPlot.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PlotSpecification.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PrintLayout.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgInputStream.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.h
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.h
   trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataManager.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.h
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.h
   trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.h
   trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.h
   trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.h
   trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.h
   trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.h
   trunk/MgDev/Desktop/MgDesktop/Services/TileService.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/TileService.h
   trunk/MgDev/Desktop/MgDesktop/Services/Transaction.cpp
   trunk/MgDev/Desktop/MgDesktop/Services/Transaction.h
   trunk/MgDev/Desktop/MgDesktop/System/ClassId.h
   trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.cpp
   trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.h
   trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.cpp
   trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.h
   trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.cpp
   trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.h
   trunk/MgDev/Desktop/UnitTest/CatchHelperMacros.h
   trunk/MgDev/Desktop/UnitTest/TestFeatureService.cpp
   trunk/MgDev/Desktop/UnitTest/TestLogManager.cpp
   trunk/MgDev/Desktop/UnitTest/TestLogManagerThread.cpp
   trunk/MgDev/Desktop/UnitTest/TestPerformance.cpp
   trunk/MgDev/Desktop/UnitTest/TestResourceService.cpp
   trunk/MgDev/Desktop/UnitTest/TestServiceFactory.cpp
   trunk/MgDev/Desktop/UnitTest/TestTileService.cpp
   trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp
   trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp
   trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp
   trunk/MgDev/Server/src/Common/Cache/ResourceServiceCache.cpp
   trunk/MgDev/Server/src/Common/Cache/ServerCache.cpp
   trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp
   trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
   trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp
   trunk/MgDev/Server/src/Common/Manager/LogManager.cpp
   trunk/MgDev/Server/src/Common/Manager/LogManager.h
   trunk/MgDev/Server/src/Common/Manager/LogThread.cpp
   trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
   trunk/MgDev/Server/src/Common/Manager/PackageLogReader.cpp
   trunk/MgDev/Server/src/Common/Manager/PackageLogWriter.cpp
   trunk/MgDev/Server/src/Common/Manager/PackageManager.cpp
   trunk/MgDev/Server/src/Common/Manager/SecurityCache.cpp
   trunk/MgDev/Server/src/Common/Manager/SecurityManager.cpp
   trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
   trunk/MgDev/Server/src/Common/Manager/ServiceManager.cpp
   trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp
   trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
   trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp
   trunk/MgDev/Server/src/Core/EventTimer.cpp
   trunk/MgDev/Server/src/Core/LoadPackageCommand.cpp
   trunk/MgDev/Server/src/Core/Server.cpp
   trunk/MgDev/Server/src/Core/ServiceHandlerFactory.cpp
   trunk/MgDev/Server/src/Core/SetPwdCommand.cpp
   trunk/MgDev/Server/src/Core/TestCommand.cpp
   trunk/MgDev/Server/src/Core/TestFdoCommand.cpp
   trunk/MgDev/Server/src/Core/TimedEventHandler.cpp
   trunk/MgDev/Server/src/Services/Drawing/DrawingOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpDescribeDrawing.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpEnumerateLayers.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSectionResources.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSections.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpGetCoordinateSpace.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpGetDrawing.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpGetLayer.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpGetSection.cpp
   trunk/MgDev/Server/src/Services/Drawing/OpGetSectionResource.cpp
   trunk/MgDev/Server/src/Services/Drawing/ServerDrawingService.cpp
   trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceDefs.h
   trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceUtil.cpp
   trunk/MgDev/Server/src/Services/Feature/ByteSourceRasterStreamImpl.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.cpp
   trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/OpAddSavePoint.cpp
   trunk/MgDev/Server/src/Services/Feature/OpApplySchema.cpp
   trunk/MgDev/Server/src/Services/Feature/OpBeginTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/OpCloseDataReader.cpp
   trunk/MgDev/Server/src/Services/Feature/OpCloseFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/OpCloseSqlReader.cpp
   trunk/MgDev/Server/src/Services/Feature/OpCommitTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/OpCreateFeatureSource.cpp
   trunk/MgDev/Server/src/Services/Feature/OpDeleteFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpDescribeSchema.cpp
   trunk/MgDev/Server/src/Services/Feature/OpDescribeSchemaAsXml.cpp
   trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
   trunk/MgDev/Server/src/Services/Feature/OpEnumerateDataStores.cpp
   trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlNonQuery.cpp
   trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlQuery.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetClassDefinition.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetClasses.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetConnectionPropertyValues.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetDataRows.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetFdoCacheInfo.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetFeatureProviders.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetIdentityProperties.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetLongTransactions.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetRaster.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetSchemaMapping.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetSchemas.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetSpatialContexts.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetSqlRows.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeatureTotal.cpp
   trunk/MgDev/Server/src/Services/Feature/OpGetWfsReader.cpp
   trunk/MgDev/Server/src/Services/Feature/OpInsertFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpInsertFeaturesBatched.cpp
   trunk/MgDev/Server/src/Services/Feature/OpReleaseSavePoint.cpp
   trunk/MgDev/Server/src/Services/Feature/OpRollbackSavePoint.cpp
   trunk/MgDev/Server/src/Services/Feature/OpRollbackTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/OpSchemaToXml.cpp
   trunk/MgDev/Server/src/Services/Feature/OpSelectFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpSelectFeaturesSpatial.cpp
   trunk/MgDev/Server/src/Services/Feature/OpSetLongTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/OpTestConnection.cpp
   trunk/MgDev/Server/src/Services/Feature/OpTestFeatureSourceConnection.cpp
   trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpUpdateFeaturesWithTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/OpUpdateMatchingFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/OpXmlToSchema.cpp
   trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp
   trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerApplySchema.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerDataReader.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerEnumerateDataStores.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFdoFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceExceptionDef.h
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransaction.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransactionPool.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGetConnectionPropertyValues.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGetLongTransactions.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGetSpatialContexts.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerInsertCommand.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerSqlCommand.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerSqlDataReader.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerUpdateFeatures.cpp
   trunk/MgDev/Server/src/Services/Feature/TransformedGeometryFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Kml/KmlOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Kml/OpGetFeaturesKml.cpp
   trunk/MgDev/Server/src/Services/Kml/OpGetLayerKml.cpp
   trunk/MgDev/Server/src/Services/Kml/OpGetMapKml.cpp
   trunk/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp
   trunk/MgDev/Server/src/Services/Mapping/MappingOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendImage.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendPlot.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpGenerateMultiPlot.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpGeneratePlot.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpQueryFeatures.cpp
   trunk/MgDev/Server/src/Services/Mapping/OpQueryFeaturesWms.cpp
   trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
   trunk/MgDev/Server/src/Services/Mapping/ServerMappingServiceDefs.h
   trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderDynamicOverlay.cpp
   trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderMap.cpp
   trunk/MgDev/Server/src/Services/Profiling/ProfilingOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMapLegend.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatile.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatileXYZ.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderTile.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderTileFromMetatile.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderTileMVT.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderTileUTFGrid.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderTileXYZ.cpp
   trunk/MgDev/Server/src/Services/Rendering/RenderingOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
   trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/DbEnvironment.cpp
   trunk/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/LibraryResourceContentManager.cpp
   trunk/MgDev/Server/src/Services/Resource/OpApplyResourcePackage.cpp
   trunk/MgDev/Server/src/Services/Resource/OpChangeResourceOwner.cpp
   trunk/MgDev/Server/src/Services/Resource/OpCopyResource.cpp
   trunk/MgDev/Server/src/Services/Resource/OpCreateRepository.cpp
   trunk/MgDev/Server/src/Services/Resource/OpDeleteRepository.cpp
   trunk/MgDev/Server/src/Services/Resource/OpDeleteResource.cpp
   trunk/MgDev/Server/src/Services/Resource/OpDeleteResourceData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentMapDefinitions.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateRepositories.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceReferences.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateResources.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryContent.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryHeader.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetResourceContent.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetResourceContents.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetResourceData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetResourceHeader.cpp
   trunk/MgDev/Server/src/Services/Resource/OpGetResourceModifiedDate.cpp
   trunk/MgDev/Server/src/Services/Resource/OpInheritPermissionsFrom.cpp
   trunk/MgDev/Server/src/Services/Resource/OpMoveResource.cpp
   trunk/MgDev/Server/src/Services/Resource/OpRenameResourceData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpResourceExists.cpp
   trunk/MgDev/Server/src/Services/Resource/OpSetResource.cpp
   trunk/MgDev/Server/src/Services/Resource/OpSetResourceData.cpp
   trunk/MgDev/Server/src/Services/Resource/OpUpdateRepository.cpp
   trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp
   trunk/MgDev/Server/src/Services/Resource/Repository.cpp
   trunk/MgDev/Server/src/Services/Resource/RepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceContentManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceDataFileManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceDataStreamManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceHeader.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourcePackageLoader.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourcePackageMaker.cpp
   trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
   trunk/MgDev/Server/src/Services/Resource/SessionRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/SessionResourceContentManager.cpp
   trunk/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp
   trunk/MgDev/Server/src/Services/Resource/SystemRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/TagManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpBringOnline.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpClearLog.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpDeleteLog.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpDeletePackage.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpEnableMaximumLogSize.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumerateLogs.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumeratePackages.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetConfigurationProperties.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetDocument.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLog.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLogFile.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageLog.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageStatus.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpIsMaximumLogSizeEnabled.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpIsOnline.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpLoadPackage.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpMakePackage.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpRenameLog.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpSetConfigurationProperties.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpSetDocument.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpSetLogDelimiter.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpSetMaximumLogSize.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpTakeOffline.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
   trunk/MgDev/Server/src/Services/Site/OpAddGroup.cpp
   trunk/MgDev/Server/src/Services/Site/OpAddServer.cpp
   trunk/MgDev/Server/src/Services/Site/OpAddUser.cpp
   trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
   trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp
   trunk/MgDev/Server/src/Services/Site/OpDeleteGroups.cpp
   trunk/MgDev/Server/src/Services/Site/OpDeleteUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpDestroySession.cpp
   trunk/MgDev/Server/src/Services/Site/OpEnumerateGroups.cpp
   trunk/MgDev/Server/src/Services/Site/OpEnumerateRoles.cpp
   trunk/MgDev/Server/src/Services/Site/OpEnumerateServers.cpp
   trunk/MgDev/Server/src/Services/Site/OpEnumerateUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpGetSessionTimeout.cpp
   trunk/MgDev/Server/src/Services/Site/OpGetUserForSession.cpp
   trunk/MgDev/Server/src/Services/Site/OpGrantGroupMembershipsToUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToGroups.cpp
   trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpRemoveServer.cpp
   trunk/MgDev/Server/src/Services/Site/OpRequestServer.cpp
   trunk/MgDev/Server/src/Services/Site/OpRevokeGroupMembershipsFromUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromGroups.cpp
   trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromUsers.cpp
   trunk/MgDev/Server/src/Services/Site/OpUpdateGroup.cpp
   trunk/MgDev/Server/src/Services/Site/OpUpdateServer.cpp
   trunk/MgDev/Server/src/Services/Site/OpUpdateUser.cpp
   trunk/MgDev/Server/src/Services/Site/ServerSiteService.cpp
   trunk/MgDev/Server/src/Services/Site/SiteOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Tile/MetatileLockUtil.cpp
   trunk/MgDev/Server/src/Services/Tile/OpClearCache.cpp
   trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp
   trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp
   trunk/MgDev/Server/src/Services/Tile/OpGetTile.cpp
   trunk/MgDev/Server/src/Services/Tile/OpGetTileProviders.cpp
   trunk/MgDev/Server/src/Services/Tile/OpSetTile.cpp
   trunk/MgDev/Server/src/Services/Tile/ServerTileService.cpp
   trunk/MgDev/Server/src/Services/Tile/TileCacheDefault.cpp
   trunk/MgDev/Server/src/Services/Tile/TileCacheDefaultProvider.cpp
   trunk/MgDev/Server/src/Services/Tile/TileCacheXYZProvider.cpp
   trunk/MgDev/Server/src/Services/Tile/TileOperationFactory.cpp
   trunk/MgDev/Server/src/UnitTesting/CatchHelperMacros.h
   trunk/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp
   trunk/MgDev/Server/src/UnitTesting/TestDrawingService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestFeatureService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestGeometry.cpp
   trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestLogManager.cpp
   trunk/MgDev/Server/src/UnitTesting/TestLogManagerThread.cpp
   trunk/MgDev/Server/src/UnitTesting/TestMisc.cpp
   trunk/MgDev/Server/src/UnitTesting/TestPerformance.cpp
   trunk/MgDev/Server/src/UnitTesting/TestResourceService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestServerAdminService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestServiceFactory.cpp
   trunk/MgDev/Server/src/UnitTesting/TestSiteService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestTileService.cpp
   trunk/MgDev/UnitTest/Common/FoundationTest/DotNetUnmanagedApi/catchall.code
   trunk/MgDev/UnitTest/Common/FoundationTest/FoundationTest.cpp
   trunk/MgDev/UnitTest/WebTier/DotNet/TestMapGuideApi/ExternalTests/MapTests.cs
   trunk/MgDev/Web/src/ApacheAgent/ApachePostParser.cpp
   trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp
   trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml
   trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml
   trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml
   trunk/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
   trunk/MgDev/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml
   trunk/MgDev/Web/src/DotNetUnmanagedApi/catchall.code
   trunk/MgDev/Web/src/HttpHandler/HttpClearTileCache.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsIsValid.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoBoundary.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoBuffer.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoConvexHull.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoDistance.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoSimplify.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeoTessellate.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGeometryInfo.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetLongTransactions.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetPlot.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetSessionTimeout.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetSpatialContexts.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpKmlGetFeatures.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpKmlGetLayer.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpPrimitiveValue.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceExists.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpTestConnection.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpWmsGetMap.cpp
   trunk/MgDev/Web/src/HttpHandler/ReaderByteSourceImpl.cpp
   trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp
   trunk/MgDev/Web/src/JavaApi/catchall.code
   trunk/MgDev/Web/src/JavaApiEx/catchall.code
   trunk/MgDev/Web/src/MapGuideApi/Constants.xml
   trunk/MgDev/Web/src/MapGuideApi/MapGuideApiGen.xml
   trunk/MgDev/Web/src/PhpApi/catchall.code
   trunk/MgDev/Web/src/WebApp/WebCommand.cpp
   trunk/MgDev/Web/src/WebApp/WebFlyoutWidget.cpp
   trunk/MgDev/Web/src/WebApp/WebInvokeUrlCommand.cpp
   trunk/MgDev/Web/src/WebApp/WebLayout.cpp
   trunk/MgDev/Web/src/WebApp/WebPrintCommand.cpp
   trunk/MgDev/Web/src/WebApp/WebSearchCommand.cpp
   trunk/MgDev/Web/src/WebApp/WebTaskBar.cpp
   trunk/MgDev/Web/src/WebApp/WebTaskPane.cpp
   trunk/MgDev/Web/src/WebApp/WebToolbar.cpp
   trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp
   trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp
   trunk/MgDev/Web/src/mapviewernet/mainframe.aspx
   trunk/MgDev/Web/src/mapviewerphp/mainframe.php
   trunk/MgDev/Web/src/schemareport/showclass.php
   trunk/MgDev/Web/src/schemareport/showgeom.php
Log:
Merged revision(s) 9743-9755 from sandbox/jng/flatten_exceptions:
Remove all exceptions in Foundation and modify all throws to throw MgException, passing an exception code instead.
........
Remove all exceptions in Geometry/CoordinateSystem and modify all throws to throw MgException, passing an exception code instead.
........
Remove all exceptions in PlatformBase and modify all throws to throw MgException, passing an exception code instead.
........
Remove all exceptions in MapGuideCommon and modify all throws to throw MgException, passing an exception code instead.
........
Remove all exceptions from the rest of the server tier and modify all throws to throw MgException, passing an exception code instead.
........
Remove all exceptions from the rest of the web tier and modify all throws to throw MgException, passing an exception code instead. Remove all non-MgException classes from SWIG config files. Add MgExceptionCodes to SWIG constants files.
........
Remove all exceptions from mg-desktop and modify all throws to throw MgException, passing an exception code instead. Remove all non-MgException classes from SWIG config files. Add MgExceptionCodes to SWIG constants files.
........
Fix linux build
........
Fix up mg-desktop unit test runner
........
Fix APi doc for GetNativeErrorCode
........
Disable site manager tests wholesale until further notice
........
Fix up MgException handling in downstream api consumers / test code.
........
Fix incorrect operator
........


Index: trunk/MgDev
===================================================================
--- trunk/MgDev	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev	2022-10-10 09:40:18 UTC (rev 9971)

Property changes on: trunk/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
## -18,6 +18,7 ##
 /sandbox/jng/createruntimemap:7486-7555
 /sandbox/jng/deprecate_dwf:9439-9440,9442,9447,9449-9450
 /sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
+/sandbox/jng/flatten_exceptions:9743-9755
 /sandbox/jng/fusion_entrypoint_refactor:9400-9406
 /sandbox/jng/geoprocessing:9205-9229
 /sandbox/jng/geos34x:8256-8259
Modified: trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -119,7 +119,7 @@
         assert(bResult);
         if (!bResult)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         return;
     }
@@ -153,7 +153,7 @@
                 Ptr<MgDisposable> disposableCsObject = datumMapIterator->second;
                 MgCoordinateSystemDatum* datumInfo = dynamic_cast<MgCoordinateSystemDatum*>(disposableCsObject.p);
                 if (NULL == datumInfo)
-                    throw new MgInvalidArgumentException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
                 
                 pDatum = SAFE_ADDREF(datumInfo);
             }
@@ -164,7 +164,7 @@
             Ptr<MgCoordinateSystemDatumDictionary> pDtDict = m_pCatalog->GetDatumDictionary();
             if (!pDtDict)
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
             }
 
             pDatum = pDtDict->Get(sDtName);
@@ -171,7 +171,7 @@
             assert(pDatum);
             if (!pDatum)
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumInDictionaryException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumInDictionaryException", NULL);
             }
         }
 
@@ -195,7 +195,7 @@
                 Ptr<MgDisposable> disposableCsObject = ellipsoidMapIterator->second;
                 MgCoordinateSystemEllipsoid* ellipsoidInfo = dynamic_cast<MgCoordinateSystemEllipsoid*>(disposableCsObject.p);
                 if (NULL == ellipsoidInfo)
-                    throw new MgInvalidArgumentException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
                 
                 pEllipsoid = SAFE_ADDREF(ellipsoidInfo);
             }
@@ -207,7 +207,7 @@
             Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict = m_pCatalog->GetEllipsoidDictionary();
             if (!pElDict)
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
             }
 
             pEllipsoid = pElDict->Get(sElName);
@@ -214,7 +214,7 @@
             assert(pEllipsoid);
             if (!pEllipsoid)
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidInDictionaryException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidInDictionaryException", NULL);
             }
         }
 
@@ -283,7 +283,7 @@
         pCoordinate = new MgCoordinateXYM(x, y, lonLat->GetM());
         if (!pCoordinate)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else if(lonLat->GetDimension() == MgCoordinateDimension::XYZ)
@@ -298,13 +298,13 @@
         pCoordinate = new MgCoordinateXYZM(x, y, z, lonLat->GetM());
         if (!pCoordinate)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertFromLonLat")
 
@@ -329,7 +329,7 @@
         pCoordinate = new MgCoordinateXYM(dLongitude, dLatitude, coordinate->GetM());
         if (!pCoordinate)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else if(coordinate->GetDimension() == MgCoordinateDimension::XYZ)
@@ -344,13 +344,13 @@
         pCoordinate = new MgCoordinateXYZM(dLongitude, dLatitude, dZDest, coordinate->GetM());
         if (!pCoordinate)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertToLonLat")
 
@@ -493,7 +493,7 @@
     // and there must be a Great Circle path between the points.
     if(GetType() == MgCoordinateSystemType::Arbitrary)
     {
-        throw new MgInvalidCoordinateSystemTypeException(L"MgCoordinateSystem.MeasureGreatCircleDistance", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMustNotBeArbitrary", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidCoordinateSystemTypeException, L"MgCoordinateSystem.MeasureGreatCircleDistance", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMustNotBeArbitrary", NULL);
     }
 
     Ptr<MgCoordinate> pLonLat1=ConvertToLonLat(x1, y1);
@@ -731,12 +731,12 @@
     pErrs = new int[nNumErrs];
     if (NULL == pErrs)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     pErrsInt32 = new INT32[nNumErrs];
     if (NULL == pErrsInt32)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get the errors
@@ -750,7 +750,7 @@
 
     if (NULL == pNewEnum.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetErrors", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy in the results.  Mentor wants a list of ints, MgCoordinateSystemEnumInteger32
@@ -790,12 +790,12 @@
     MG_TRY()
     if (!m_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemFormatConverter> pConverter=m_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sWkt=pConverter->DefinitionToWkt(this, MgCoordinateSystemWktFlavor::Ogc);
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ToString")
@@ -812,7 +812,7 @@
     wchar_t* pUnit = Convert_UTF8_To_Wide(m_csprm.csdef.unit);
     if (NULL == pUnit)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetUnits", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetUnits", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING sUnit(pUnit);
     delete[] pUnit;
@@ -838,7 +838,7 @@
     //Can't change read-only items
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     //Make sure the projection's been properly set
@@ -846,7 +846,7 @@
     if (MgCoordinateSystemProjectionCode::Unknown == prj)
     {
         //Projection hasn't been properly set, so we can't set the unit type.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //Make sure it's a unit type we know about
@@ -855,7 +855,7 @@
     if (!GetUnitInfo(unit, &unitType, &dScale))
     {
         //Unknown unit type.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert(dScale > 0.0);
     assert(MgCoordinateSystemUnitType::Unknown != unitType);
@@ -866,7 +866,7 @@
     if (prjUnitType != unitType)
     {
         //Wrong unit type for this projection.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     //Okay, we're all set.  Copy in the values...
@@ -978,7 +978,7 @@
     wchar_t* pName = Convert_UTF8_To_Wide(m_csprm.csdef.key_nm);
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sName=pName;
     delete[] pName;
@@ -999,13 +999,13 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     if (sCode.empty())
     {
         //null pointer is obviously not legal...
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -1012,7 +1012,7 @@
     char *pStr = Convert_Wide_To_UTF8(sCode.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Try to make a legal name.  CS_nampp() legalizes the
@@ -1024,7 +1024,7 @@
     {
         //illegal string
         delete [] pStr;
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy into the definition
@@ -1058,7 +1058,7 @@
     wchar_t* pProjection = Convert_UTF8_To_Wide(m_csprm.csdef.prj_knm);
     if (NULL == pProjection)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetProjection", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetProjection", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sProjection=pProjection;
     delete[] pProjection;
@@ -1091,13 +1091,13 @@
     if (Protected())
     {
         //Can't change read-only items
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     if (MgCoordinateSystemProjectionCode::Unknown==prjType)
     {
         //cs_UNKWN_PROJ
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Set the projection string
@@ -1106,7 +1106,7 @@
     if (!kpProj)
     {
         //cs_UNKWN_PROJ
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //if same as the existing projection, do nothing
@@ -1124,7 +1124,7 @@
     if (!pp)
     {
         //cs_UNKWN_PROJ
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_csprm.prj_code = pp->code;
     m_csprm.prj_flags = pp->flags;
@@ -1204,7 +1204,7 @@
     wchar_t* pDatum = Convert_UTF8_To_Wide(m_csprm.csdef.dat_knm);
     if (NULL == pDatum)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sDatum=pDatum;
     delete[] pDatum;
@@ -1266,7 +1266,7 @@
     wchar_t* pEllipsoid = Convert_UTF8_To_Wide(m_csprm.csdef.elp_knm);
     if (NULL == pEllipsoid)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sEllipsoid=pEllipsoid;
     delete[] pEllipsoid;
@@ -1379,19 +1379,19 @@
     Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=m_pCatalog->GetCategoryDictionary();
     if (!pCtDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
     }
     //get the category dictionary pointer
     Ptr<MgCoordinateSystemEnum> pEnumCategories=pCtDict->GetEnum();
     if (!pEnumCategories)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
    pCategoryNames = new MgStringCollection();
    if (!pCategoryNames)
    {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"", NULL);
    }
 
     //list all the categories one by one
@@ -1530,7 +1530,7 @@
         Ptr<MgCoordinateSystemDatumDictionary> pDtDict=pCatalog->GetDatumDictionary();
         if (!pDtDict)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
         }
 
         //Build a wchar_t* from the datum name
@@ -1537,7 +1537,7 @@
         wchar_t* pStrDt = Convert_UTF8_To_Wide(m_csprm.csdef.dat_knm);
         if (NULL == pStrDt)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         STRING strDt(pStrDt);
         delete[] pStrDt;
@@ -1554,7 +1554,7 @@
         Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict=pCatalog->GetEllipsoidDictionary();
         if (!pElDict)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
         }
 
         //Build a wchar_t* from the ellipsoid name
@@ -1561,7 +1561,7 @@
         wchar_t* pStrEl = Convert_UTF8_To_Wide(m_csprm.csdef.elp_knm);
         if (NULL == pStrEl)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         STRING strEl(pStrEl);
         delete[] pStrEl;
@@ -1600,7 +1600,7 @@
     bool bResult = BuildCsDefFromInterface(pCsDef, def);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //And compare with this one!
@@ -1705,7 +1705,7 @@
     //Make an object to be the copy
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new
@@ -1723,7 +1723,7 @@
         Ptr<MgCoordinateSystemDatum> pDtClone=m_pDatum->CreateClone();
         if (NULL == pDtClone.p)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pNew->m_pDatum = pDtClone;
     }
@@ -1733,7 +1733,7 @@
         Ptr<MgCoordinateSystemEllipsoid> pElClone=m_pEllipsoid->CreateClone();
         if (NULL == pElClone.p)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pNew->m_pEllipsoid = pElClone;
     }
@@ -1757,7 +1757,7 @@
     wchar_t* pDesc = Convert_UTF8_To_Wide(m_csprm.csdef.desc_nm);
     if (NULL == pDesc)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sDesc=pDesc;
     delete[] pDesc;
@@ -1797,7 +1797,7 @@
     wchar_t* pGroup = Convert_UTF8_To_Wide(m_csprm.csdef.group);
     if (NULL == pGroup)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sGroup=pGroup;
     delete[] pGroup;
@@ -1835,7 +1835,7 @@
     wchar_t* pSource = Convert_UTF8_To_Wide(m_csprm.csdef.source);
     if (NULL == pSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sSource=pSource;
     delete[] pSource;
@@ -1917,7 +1917,7 @@
     wchar_t* pLoc = Convert_UTF8_To_Wide(m_csprm.csdef.locatn);
     if (NULL == pLoc)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetLocation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetLocation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sLoc=pLoc;
     delete[] pLoc;
@@ -1957,7 +1957,7 @@
     wchar_t* pCntrySt = Convert_UTF8_To_Wide(m_csprm.csdef.cntry_st);
     if (NULL == pCntrySt)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetCountryOrState", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetCountryOrState", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sCntrySt=pCntrySt;
     delete[] pCntrySt;
@@ -2010,7 +2010,7 @@
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
         //Projection type hasn't been properly initialized.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetProjectionParamCount", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetProjectionParamCount", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     // Now for each possible parameter.
@@ -2043,7 +2043,7 @@
     //Make sure the parameter is in the valid range
     if ((nIndex < 1) || (nIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure that this parameter is used by this projection
@@ -2051,7 +2051,7 @@
     if (MgCoordinateSystemProjectionCode::Unknown == prj)
     {
         //Projection type hasn't been properly initialized.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
     short prjCode = prj;
     //The following function call returns 1 if this
@@ -2065,7 +2065,7 @@
     if (1 != nResult)
     {
         //The parameter isn't used.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     //The parameter is used.  Return it.
@@ -2093,13 +2093,13 @@
     //Can't change read-only items
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     //Make sure the parameter is in the valid range
     if ((nIndex < 1) || (nIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure this parameter is used by this projection
@@ -2107,7 +2107,7 @@
     if (MgCoordinateSystemProjectionCode::Unknown == prj)
     {
         //Projection type hasn't been properly initialized.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
     struct cs_Prjprm_ info;
     short prjCode = prj;
@@ -2123,7 +2123,7 @@
     {
         //The specified parameter isn't used by this
         //projection.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     //Okay, at this point we know our projection type
@@ -2134,7 +2134,7 @@
     if ((dValue < info.min_val) || (dValue > info.max_val))
     {
         //They've given us an illegal value!
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Okay, the value they've given us is legitimate, too.
@@ -2166,7 +2166,7 @@
     //Make sure we're not read-only
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetOriginLongitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetOriginLongitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.csdef.org_lng = dOrgLng;
@@ -2193,7 +2193,7 @@
     //Make sure we're not read-only
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetOriginLatitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetOriginLatitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.csdef.org_lat = dOrgLat;
@@ -2223,7 +2223,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetOffsets", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetOffsets", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.csdef.x_off = dXOffset;
@@ -2258,7 +2258,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetScaleReduction", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetScaleReduction", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
     INT32 prj = ProjectionFromString(m_csprm.csdef.prj_knm);
     if (ProjectionUsesSclRed(prj))
@@ -2287,7 +2287,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetMapScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetMapScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.csdef.map_scl = dMapScale;
@@ -2319,7 +2319,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetZeroes", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetZeroes", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.csdef.zero[0] = (dXZero < 0.0)? 0.0 : dXZero;
@@ -2373,7 +2373,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     OrderMinMax(dLonMin, dLonMax);
@@ -2403,7 +2403,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.CancelLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.CancelLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     //it will only be set on CsMap's transformation struct, i.e.
@@ -2428,7 +2428,7 @@
     //Make sure we're not read-only
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     OrderMinMax(dXMin, dXMax);
@@ -2452,7 +2452,7 @@
     //Make sure we're not read-only
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.CancelXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.CancelXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     m_csprm.min_xy[0] = 0.0;
@@ -2481,12 +2481,12 @@
     //Make sure we're not read-only
     if (Protected())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     if ((sQuad < -4) || (sQuad > 4) || (0 == sQuad))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     m_csprm.csdef.quad = sQuad;
@@ -2524,21 +2524,21 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
     //no DT or EL if NERTH projection is used
     if (ProjectionIsNerthType (GetProjectionCode()))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
     }
     if (!IsLegalMentorName(sDatum.c_str()))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     char *pStr = Convert_Wide_To_UTF8(sDatum.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     memset(m_csprm.csdef.dat_knm, 0, sizeof(m_csprm.csdef.key_nm));
@@ -2553,21 +2553,21 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
     //no DT or EL if NERTH projection is used
     if (ProjectionIsNerthType (GetProjectionCode()))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
     }
     if (!IsLegalMentorName(sEllipsoid.c_str()))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     char *pStr = Convert_Wide_To_UTF8(sEllipsoid.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     memset(m_csprm.csdef.dat_knm, 0, sizeof(m_csprm.csdef.key_nm));
@@ -2601,7 +2601,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
     */
 
@@ -2608,7 +2608,7 @@
     //no DT or EL if NERTH projection is used
     if (ProjectionIsNerthType (GetProjectionCode()))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
     }
 
     //Get information out of the datum def
@@ -2616,7 +2616,7 @@
     bool bResult = BuildDtDefFromInterface(pDatum, dtdef);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //If the coordinate system is not geodetic we need to switch it
@@ -2644,7 +2644,7 @@
         || (0 != CS_nampp(dtdef.key_nm))
         || (0 != CS_stricmp(m_csprm.csdef.dat_knm, dtdef.key_nm)))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     //Get information out of the ellipsoid def
@@ -2652,13 +2652,13 @@
     assert(pEllipsoid);
     if (!pEllipsoid)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     cs_Eldef_ eldef;
     bResult = BuildElDefFromInterface(pEllipsoid, eldef);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Okay, at this point we have a cs_Csdef_, cs_Dtdef_, and cs_Eldef_
@@ -2669,7 +2669,7 @@
     CriticalClass.Leave();
     if (NULL == pCsprm)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
     }
 
     //Everything worked okay!  Copy the data into our member variables.
@@ -2678,7 +2678,7 @@
     Ptr<MgCoordinateSystemDatum> pDatumClone = pDatum->CreateClone();
     if (NULL == pDatumClone.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_pDatum = pDatumClone;
 
@@ -2688,7 +2688,7 @@
     //Make sure the coordinate system is valid
     if (!IsValid())
     {
-         throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+         throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     MG_CATCH(L"MgCoordinateSystem.SetDatumDefinition")
@@ -2750,7 +2750,7 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
     */
 
@@ -2757,7 +2757,7 @@
     //no DT or EL if NERTH projection is used
     if (ProjectionIsNerthType (GetProjectionCode()))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidIfArbitraryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidIfArbitraryException", NULL);
     }
 
     //Get information out of the Ellipsoid def
@@ -2765,7 +2765,7 @@
     bool bResult = BuildElDefFromInterface(pEllipsoid, eldef);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //If the coordinate system is geodetic we need to switch it
@@ -2793,7 +2793,7 @@
         || (0 != CS_nampp(eldef.key_nm))
         || (0 != CS_stricmp(m_csprm.csdef.elp_knm, eldef.key_nm)))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     //Okay, at this point we have a valid cs_Csdef_ and cs_Eldef_.
@@ -2804,7 +2804,7 @@
     CriticalClass.Leave();
     if (NULL == pDatum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
     }
 
     CriticalClass.Enter();
@@ -2812,7 +2812,7 @@
     CriticalClass.Leave();
     if (NULL == pCsprm)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
     }
 
     //We're all set.  Initialize our data members.
@@ -2821,7 +2821,7 @@
     Ptr<MgCoordinateSystemEllipsoid> pEllipsoidClone = pEllipsoid->CreateClone();
     if (NULL == pEllipsoidClone.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_pEllipsoid = pEllipsoidClone;
 
@@ -2830,7 +2830,7 @@
     //Make sure the coordinate system is valid
     if (!IsValid())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     MG_CATCH(L"MgCoordinateSystem.SetEllipsoidDefinition")
@@ -2898,7 +2898,7 @@
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertFromLonLat")
 }
@@ -2927,7 +2927,7 @@
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertFromLonLat")
 }
@@ -2948,7 +2948,7 @@
     pCoordinate=new MgCoordinateXY(dLongitude, dLatitude);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertToLonLat")
     return pCoordinate.Detach();
@@ -2964,7 +2964,7 @@
     pCoordinate=new MgCoordinateXYZ(dLongitude, dLatitude, dZDest);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertToLonLat")
     return pCoordinate.Detach();
@@ -2987,7 +2987,7 @@
     pCoordinate=new MgCoordinateXY(dX, dY);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertFromLonLat")
     return pCoordinate.Detach();
@@ -3003,7 +3003,7 @@
     pCoordinate=new MgCoordinateXYZ(dX, dY, dZDest);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertFromLonLat")
     return pCoordinate.Detach();
@@ -3060,13 +3060,13 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
     }
 
     if (!IsLegalString(sSrc.c_str(), nMaxSize))
     {
         //Can't set string, caller gave us an illegal value
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -3073,7 +3073,7 @@
     char *pStr = Convert_Wide_To_UTF8(sSrc.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy it in
@@ -3190,7 +3190,7 @@
     //Make sure we've been initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.IsValidCoord", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.IsValidCoord", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //Find out whether we're in range
@@ -3232,7 +3232,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //Do the conversion.
@@ -3252,7 +3252,7 @@
     {
         //The conversion failed, because we're outside the
         //mathematical domain of the coordinate system.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.ConvertPoint")
@@ -3273,7 +3273,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //Check the range.  We need to do this even if range checking
@@ -3289,7 +3289,7 @@
     if (nResult & cs_CNVRT_DOMN)
     {
         //Outside the mathematical domain!
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
     }
 
     //Do the conversion.
@@ -3304,7 +3304,7 @@
     {
         //WARNING
         //should really be a warning but throwing exception
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.GetDouble")
@@ -3326,7 +3326,7 @@
     pNew=new CCoordinateSystemMeasure(this);
     if (!pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystem.GetMeasure", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystem.GetMeasure", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystem.GetMeasure")
     return pNew;
@@ -3379,7 +3379,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     UINT8 nVersion=pStreamOut[0];
@@ -3415,7 +3415,7 @@
         {
             m_bEncrypted = bPrevEncrypted;
             m_csprm.csdef = prevDef;
-            throw new MgInvalidArgumentException(L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -3432,7 +3432,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystem.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystem.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //save the version

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysCatalog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -81,7 +81,7 @@
 
     if (!m_pCsDict || !m_pDtDict || !m_pElDict || !m_pCtDict || !m_pGpDict || !m_pGxDict)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.MgCoordinateSystemCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.MgCoordinateSystemCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Set up Mentor global variables.  See CSDATA.C for explanation.
@@ -249,7 +249,7 @@
     if (sDir.empty())
     {
         ACE_DEBUG((LM_DEBUG, "(%t) DefaultDir for the Coordinate System library has been set but is empty.\n"));
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (!MgFileUtil::IsDirectory(sDir.c_str()))
@@ -260,7 +260,7 @@
 
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //And return success.
@@ -353,7 +353,7 @@
     //CS-Map return -1 if for cs_altdr() the Coordsys.CSD file couldn't be found; 0 otherwise
 
     if (csmapResult)
-        throw new MgFileIoException(L"MgCoordinateSystemCatalog.SetDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemCatalog.SetDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return szPath;
 }
@@ -363,7 +363,7 @@
     MG_TRY()
 
     if (sDirPath.empty())
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCatalog.SetDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCatalog.SetDictionaryDir", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_libraryStatus = lsInitializationFailed;
     m_sDir = this->SetDictionaryDir(sDirPath, false, CS_altdr);
@@ -475,7 +475,7 @@
         || !m_pGxDict || m_pGxDict->GetFileName().empty())
     {
         //Directory hasn't been specified yet.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCatalog.AreDictionaryFilesWritable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCatalog.AreDictionaryFilesWritable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //the [m_sUserDir] will only contain something, if [SetUserDictionaryDir] had been called
@@ -655,7 +655,7 @@
     //need to get at data files to do certain datum shifts.
     if (m_sDir.empty())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     Ptr<CCoordinateSystemGeodeticTransformation> pNew = new CCoordinateSystemGeodeticTransformation(this, pSource, pTarget);
@@ -662,7 +662,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pColl = new MgDisposableCollection;
@@ -669,7 +669,7 @@
 
     if (NULL == pColl.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pColl->Add(pNew);
@@ -688,7 +688,7 @@
     pNew=new CCoordinateSystemMathComparator;
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetMathComparator", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetMathComparator", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.GetMathComparator")
     //And we're done!  Return success.
@@ -703,7 +703,7 @@
     pNew=new CCoordinateSystemFormatConverter(this);
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetFormatConverter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetFormatConverter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.GetFormatConverter")
 
@@ -719,7 +719,7 @@
     pNew=new CCoordinateSystemProjectionInformation();
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetProjectionInformation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetProjectionInformation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.GetProjectionInformation")
 
@@ -735,7 +735,7 @@
     pNew=new CCoordinateSystemUnitInformation();
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetUnitInformation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetUnitInformation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.GetUnitInformation")
 
@@ -751,7 +751,7 @@
     pNew=new CCoordinateSystemDictionaryUtility(this);
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCatalog.GetDictionaryUtility", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCatalog.GetDictionaryUtility", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCatalog.GetDictionaryUtility")
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysCategory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
     }
 
     if (NULL == pCategoryCopy)
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.CtorInit", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCategory.CtorInit", __LINE__, __WFILE__, NULL, L"", NULL);
 
     pToInitialize->m_pCatalog = SAFE_ADDREF(pCatalog);
     pToInitialize->mp_ctDef = pCategoryCopy;
@@ -113,15 +113,15 @@
     CHECKARGUMENTNULL(pDef, L"MgCoordinateSystemCategory.CopyFrom");
 
     if (!const_cast<CCoordinateSystemCategory*>(pDef)->IsValid())
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
 
     CCoordinateSystemCategory const* pOtherCategory = dynamic_cast<CCoordinateSystemCategory const*>(pDef);
     if (NULL == pOtherCategory)
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
 
     cs_Ctdef_* pCategoryCopy = CScpyCategory(pOtherCategory->mp_ctDef);
     if (NULL == pCategoryCopy)
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_TRY()
 
@@ -163,7 +163,7 @@
 
         if (!IsLegalName(sName))
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.SetName", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.SetName", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         pszNewName = Convert_Wide_To_UTF8(sName.c_str());
@@ -264,13 +264,13 @@
     if (NULL == pCtDef->mp_ctDef)
     {
         _ASSERT(false);
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (NULL == this->mp_ctDef)
     {
         _ASSERT(false);
-        throw new MgInvalidOperationException(L"MgCoordinateSystemCategory.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgCoordinateSystemCategory.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (this->mp_ctDef->nameCnt != pCtDef->mp_ctDef->nameCnt)
@@ -395,12 +395,12 @@
     pName = Convert_Wide_To_UTF8(sName.c_str());    //need to delete [] pName
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (!IsLegalMentorName(pName))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //See if it's already present
@@ -408,13 +408,13 @@
     if (itList != allCsNames.end())
     {
         //duplicate!
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCategoryDuplicateException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCategoryDuplicateException", NULL);
     }
 
     if (CSaddItmNameEx(this->mp_ctDef, pName))
     {
         _ASSERT(false); //whatever the problem is here... the name we validated; OOM ? hopefully unlikely
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCategoryDuplicateException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCategoryDuplicateException", NULL);
     }
 
     //Try to insert it in our list
@@ -451,7 +451,7 @@
         _ASSERT(NULL != pName); //would throw an exception otherwise
 
         if (!IsLegalMentorName(pName))
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.RemoveCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.RemoveCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
 
         if (CSrmvItmNameEx(this->mp_ctDef, pName))
         {
@@ -463,7 +463,7 @@
                 allCsNames.clear();
             }
 
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemCategory.RemoveCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategory.RemoveCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         //See if it's already present
@@ -530,7 +530,7 @@
     //create the new empty cs_Ctdef_ instance first
     struct cs_Ctdef_* pNewCategory = CSnewCategory(NULL);
     if (NULL == pNewCategory)
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCategory.MgCoordinateSystemCategory", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCategory.MgCoordinateSystemCategory", __LINE__, __WFILE__, NULL, L"", NULL);
 
     CSrlsCategory(this->mp_ctDef);
     this->mp_ctDef = pNewCategory;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -79,7 +79,7 @@
 
     if (NULL == pNewDef.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemCategoryDictionary.NewCategory", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemCategoryDictionary.NewCategory", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemCategoryDictionary.NewCategory")
@@ -155,7 +155,7 @@
         if (categoryCount < 0)
         {
             _ASSERT(NULL == pAllCategories);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.GenerateIndex", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.GenerateIndex", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         for(int i = 0; i < categoryCount; ++i)
@@ -216,7 +216,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sFileName);
-        throw new MgFileIoException(L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
     }
 
     if (!sFileName.empty())
@@ -288,7 +288,7 @@
     CCoordinateSystemCategory* pCategoryDef=dynamic_cast<CCoordinateSystemCategory*>(pDefinition);
     if (!pCategoryDef)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     cs_Ctdef_ const* pCsMapDef = pCategoryDef->GetCategoryDef();
@@ -298,7 +298,7 @@
     if (iter != Index().end())
     {
         //Yup.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
     }
 
     int updateResult = CS_ctupd(pCsMapDef);
@@ -305,7 +305,7 @@
     if (updateResult < 0)
     {
         //the category could not be added to the dictionary
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     _ASSERT(0 == updateResult); //we must have added it; +1 means "updated"
@@ -351,7 +351,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
     }
 
     bInvalidIndexOnFailure = true;
@@ -361,7 +361,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
     }
 
     int deletionResult = CS_ctdel(pCategory);
@@ -369,7 +369,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sName);
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
     }
 
     long position = iter->second;
@@ -419,7 +419,7 @@
         CCoordinateSystemCategory* pCategoryDef=dynamic_cast<CCoordinateSystemCategory*>(pDefinition);
         if (!pCategoryDef)
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         }
 
         //Look for it in our index
@@ -426,7 +426,7 @@
         STRING str = pCategoryDef->GetName();
         if (str.empty())
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pName = Convert_Wide_To_UTF8(str.c_str());
 
@@ -437,7 +437,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(str);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         invalidIndexOnFailure = true;
@@ -448,7 +448,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(str);
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
         }
 
         _ASSERT(1 == updateResult);
@@ -500,7 +500,7 @@
             //Nope.
             MgStringCollection arguments;
             arguments.Add(sName);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.GetCategory", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.GetCategory", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         invalidIndexOnFailure = true;
@@ -511,7 +511,7 @@
             //Nope.
             MgStringCollection arguments;
             arguments.Add(sName);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.GetCategory", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.GetCategory", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         //Make a new object with the [cs_Ctdef_] instance we got
@@ -610,7 +610,7 @@
             //nope, not there
             MgStringCollection arguments;
             arguments.Add(sOldName);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         invalidIndexOnFailure = true;
@@ -619,15 +619,15 @@
         {
             MgStringCollection arguments;
             arguments.Add(sOldName);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         pNewName = Convert_Wide_To_UTF8(sNewName.c_str());
         if (CSrplCatNameEx(pOldName, pNewName))
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
 
         if (CSupdCategories(NULL))
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
 
         long index = iter->second;
         Index().erase(iter);

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,7 +92,7 @@
 
     if (NULL == pEl.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.GetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInitializationFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.GetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInitializationFailedException", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDatum.GetEllipsoidDefinition")
@@ -125,7 +125,7 @@
     //Make sure the specified datum is valid
     if (def.key_nm[0]=='\0')
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //init the datum defintion part
@@ -152,7 +152,7 @@
     wchar_t* pwszElName=Convert_UTF8_To_Wide(def.ell_knm);
     if (!pwszElName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING sElName(::ToLower(pwszElName));
     delete[] pwszElName;
@@ -169,7 +169,7 @@
             Ptr<MgDisposable> disposableCsObject = ellipsoidsIterator->second;
             MgCoordinateSystemEllipsoid* ellipsoidInfo = dynamic_cast<MgCoordinateSystemEllipsoid*>(disposableCsObject.p);
             if (NULL == ellipsoidInfo)
-                throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
             
             pEllipsoid = SAFE_ADDREF(ellipsoidInfo);
         }
@@ -182,7 +182,7 @@
         Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict = m_pCatalog->GetEllipsoidDictionary();
         if (!pElDict)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
         }
 
         //load the ellipsoid defintion from the dictionary
@@ -191,7 +191,7 @@
     }
 
     if (NULL == pEllipsoid)
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidInDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidInDictionaryException", NULL);
 
     //Initialize from ellipsoid definitions we have
     SetEllipsoidDefinition(dynamic_cast<MgCoordinateSystemEllipsoid*>(pEllipsoid.p));
@@ -224,7 +224,7 @@
     wchar_t* pName = Convert_UTF8_To_Wide(m_DtDef.key_nm);
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sCode=pName;
     delete[] pName;
@@ -245,13 +245,13 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     if (sCode.empty())
     {
         //null pointer is obviously not legal...
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -258,7 +258,7 @@
     char *pStr = Convert_Wide_To_UTF8(sCode.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Try to make a legal name.  CS_nampp() legalizes the
@@ -270,7 +270,7 @@
     {
         //illegal string
         delete [] pStr;
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy into the definitions, dtdef and cs_datum_ must be in synch
@@ -366,7 +366,7 @@
     Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict=pCatalog->GetEllipsoidDictionary();
     if (!pElDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
     }
 
     //Build a wchar_t* from the ellipsoid name
@@ -373,7 +373,7 @@
     wchar_t* pStrEl = Convert_UTF8_To_Wide(m_datum.ell_knm);
     if (NULL == pStrEl)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING sElName(pStrEl);
     delete[] pStrEl;
@@ -409,7 +409,7 @@
     cs_Dtdef_ def;
     if (!BuildDtDefFromInterface(pDtDef, def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //And compare with this one!
@@ -462,7 +462,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new
@@ -500,7 +500,7 @@
     wchar_t* pDesc = Convert_UTF8_To_Wide(m_datum.dt_name);
     if (NULL == pDesc)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sDesc=pDesc;
     delete[] pDesc;
@@ -540,7 +540,7 @@
     wchar_t *pGroup = Convert_UTF8_To_Wide(m_DtDef.group);
     if (NULL == pGroup)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sGroup=pGroup;
     delete[] pGroup;
@@ -576,7 +576,7 @@
     wchar_t *pSource = Convert_UTF8_To_Wide(m_DtDef.source);
     if (NULL == pSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sSource=pSource;
     delete[] pSource;
@@ -659,7 +659,7 @@
     wchar_t* pLoc = Convert_UTF8_To_Wide(m_DtDef.locatn);
     if (NULL == pLoc)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetLocation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetLocation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sLoc=pLoc;
     delete[] pLoc;
@@ -696,7 +696,7 @@
     wchar_t *pCountryOrState = Convert_UTF8_To_Wide(m_DtDef.cntry_st);
     if (NULL == pCountryOrState)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetCountryOrState", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetCountryOrState", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sCountryOrState=pCountryOrState;
     delete[] pCountryOrState;
@@ -734,7 +734,7 @@
     wchar_t* pEllipsoid = Convert_UTF8_To_Wide(m_DtDef.ell_knm);
     if (NULL == pEllipsoid)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sEllipsoid=pEllipsoid;
     delete[] pEllipsoid;
@@ -755,13 +755,13 @@
     if (Protected())
     {
         //can't change a read-only object
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     //Make sure it's a legal datum name
     if (!IsLegalMentorName(sEllipsoid.c_str()))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert wchar_t* to C++ string
@@ -768,7 +768,7 @@
     char *pStr = Convert_Wide_To_UTF8(sEllipsoid.c_str()); //need to delete [] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert(strlen(pStr) < sizeof(m_DtDef.key_nm));
 
@@ -843,7 +843,7 @@
     //Make sure it's a legal datum name
     if (!IsLegalMentorName(sEllipsoid.c_str()))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert wchar_t* to C++ string
@@ -850,7 +850,7 @@
     char *pStr = Convert_Wide_To_UTF8(sEllipsoid.c_str()); //need to delete [] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert(strlen(pStr) < sizeof(m_DtDef.key_nm));
 
@@ -871,7 +871,7 @@
     bool bResult = BuildElDefFromInterface(pEllipsoidDef, eldef);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure the datum's specified ellipsoid matches the
@@ -884,7 +884,7 @@
         || (0 != CS_nampp(eldef.key_nm))
         || (0 != CS_stricmp(m_DtDef.ell_knm, eldef.key_nm)))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumMismatchException", NULL);
     }
 
     //Build a cs_Datum_ from the datum and ellipsoid definitions
@@ -893,7 +893,7 @@
     CriticalClass.Leave();
     if (NULL == pDatum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInternalException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInternalException", NULL);
     }
 
     //Okay, everything succeeded.  Hang on to a copy of the
@@ -930,7 +930,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pColl = new MgDisposableCollection;
@@ -937,7 +937,7 @@
 
     if (NULL == pColl.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pColl->Add(pNew);
@@ -961,13 +961,13 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     if (!IsLegalString(sSrc.c_str(), nMaxSize))
     {
         //Can't set string, caller gave us an illegal value
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -974,7 +974,7 @@
     char *pStr = Convert_Wide_To_UTF8(sSrc.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy it in
@@ -1009,7 +1009,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     UINT8 nVersion=pStreamOut[0];
@@ -1057,7 +1057,7 @@
         {
             m_bEncrypted = bPrevEncrypted;
             m_DtDef = prevDef;
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -1074,7 +1074,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatum.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatum.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //save the version

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDatumDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -313,7 +313,7 @@
 
     if (NULL == pNewDef.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatumDictionary.NewDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatumDictionary.NewDatum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDatumDictionary.NewDatum")
@@ -345,7 +345,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sFileName);
-        throw new MgFileIoException(L"MgCoordinateSystemDatumDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDatumDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
     }
 
     MentorDictionary::SetFileName(
@@ -414,7 +414,7 @@
     nSize=(ulFileBytes - sizeof(m_lMagic)) / nRecSize;
     if (0!=CS_fclose(pFile))
     {
-        throw new MgFileIoException(L"MgCoordinateSystemDatumDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDatumDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDatumDictionary.GetSize")
 
@@ -440,7 +440,7 @@
     MgCoordinateSystemDatum* pDatumDef=dynamic_cast<MgCoordinateSystemDatum*>(pDefinition);
     if (!pDatumDef)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatumDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatumDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
@@ -487,7 +487,7 @@
     MgCoordinateSystemDatum* pDatumDef=dynamic_cast<MgCoordinateSystemDatum*>(pDefinition);
     if (!pDatumDef)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDatumDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatumDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
@@ -539,7 +539,7 @@
         //wasn't there!
         MgStringCollection whatArguments;
         whatArguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemDatumDictionary.GetDatum", __LINE__, __WFILE__, &whatArguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemDatumDictionary.GetDatum", __LINE__, __WFILE__, &whatArguments, L"", NULL);
     }
 
     //Okay, at this point we have a Mentor coordsys definition
@@ -596,7 +596,7 @@
     char *pName = Convert_Wide_To_UTF8(sName.c_str()); //need to delete [] pName
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatumDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatumDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (NULL != m_pmapSystemNameDescription)
@@ -684,7 +684,7 @@
 
             //close the file before calling into the [read all CS-Map defs] method
             if (0 != CS_fclose(pFile))
-                throw new MgFileIoException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
             pFile = NULL;
 
@@ -698,7 +698,7 @@
         }
         if (NULL == m_pmapSystemNameDescription)
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -707,7 +707,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH(L"MgCoordinateSystemDatumDictionary.GetEnum")
@@ -716,7 +716,7 @@
     {
         const bool fileClosed = (0 == CS_fclose(pFile));
         if (!fileClosed && NULL == mgException) //throw this exception in case no other exception has already been caught
-            mgException = new MgFileIoException(L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+            mgException = new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
         pFile = NULL;
     }
@@ -743,7 +743,7 @@
 
     CCoordinateSystemDatumDictionary* datumDictionary = dynamic_cast<CCoordinateSystemDatumDictionary*>(targetDictionary);
     if (NULL == datumDictionary) //everything else is an implementation defect
-        throw new MgInvalidArgumentException(L"CCoordinateSystemDatumDictionary.ReadAllDatums", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemDatumDictionary.ReadAllDatums", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //place a lock here - we don't want any interference; what we need is the *current* status of all dictionary files
     SmartCriticalClass dictionaryLock;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -168,7 +168,7 @@
         nNameSize = sizeof(v8.key_nm);
         return;
     default:
-        throw new MgCoordinateSystemInitializationFailedException(
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"GetCoordinateSystemSizeInfo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -332,7 +332,7 @@
 
     if (NULL == pNewDef.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDictionary.NewCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDictionary.NewCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDictionary.NewCoordinateSystem")
@@ -366,7 +366,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sFileName);
-        throw new MgFileIoException(L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
     }
 
     MentorDictionary::SetFileName(
@@ -434,7 +434,7 @@
 
     if (0!=CS_fclose(pFile))
     {
-        throw new MgFileIoException(L"MgCoordinateSystemDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDictionary.GetSize")
@@ -461,7 +461,7 @@
     MgCoordinateSystem* pCoordinateSystem=dynamic_cast<MgCoordinateSystem*>(pDefinition);
     if (!pCoordinateSystem)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
@@ -508,7 +508,7 @@
     MgCoordinateSystem* pCoordinateSystem=dynamic_cast<MgCoordinateSystem*>(pDefinition);
     if (!pCoordinateSystem)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
@@ -551,7 +551,7 @@
 
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDictionary.GetCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDictionary.GetCoordinateSystem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Look in the dictionary
@@ -562,7 +562,7 @@
         //wasn't there!
         MgStringCollection whatArguments;
         whatArguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemDictionary.GetCoordinateSystem", __LINE__, __WFILE__, &whatArguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemDictionary.GetCoordinateSystem", __LINE__, __WFILE__, &whatArguments, L"", NULL);
     }
 
     //Okay, at this point we have a Mentor coordsys definition
@@ -627,7 +627,7 @@
     char *pName = Convert_Wide_To_UTF8(sName.c_str()); //need to delete [] pName
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (NULL != m_pmapSystemNameDescription)
@@ -662,7 +662,7 @@
 
     CCoordinateSystemDictionary* csDictionary = dynamic_cast<CCoordinateSystemDictionary*>(targetDictionary);
     if (NULL == csDictionary)
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //in order to create the MgCoordinateSystem objects, we have to have also the information on the datums and ellipsoids
     map<STRING, Ptr<MgDisposable> > ellipsoidMap;
@@ -756,7 +756,7 @@
             //Generate summary for version 7 or 8 coordsys file.
             //close the file before calling into the [read all CS-Map defs] method
             if (0 != CS_fclose(pFile))
-                throw new MgFileIoException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
             pFile = NULL;
 
@@ -770,7 +770,7 @@
         }
         if (NULL == m_pmapSystemNameDescription)
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -779,12 +779,12 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (pFile && 0 != CS_fclose(pFile))
     {
-        throw new MgFileIoException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
     }
     pFile = NULL;
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryBase.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -134,7 +134,7 @@
 
     if(NULL != pFile && (0 != CS_fclose(pFile)))
     {
-        throw new MgFileIoException(L"CCoordinateSystemDictionaryBase.GetSize", __LINE__, __WFILE__, NULL, NULL, NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"CCoordinateSystemDictionaryBase.GetSize", __LINE__, __WFILE__, NULL, NULL, NULL);
     }
 
     MG_THROW()
@@ -151,7 +151,7 @@
 
     T* pDictionaryDef = dynamic_cast<T*>(pDefinition);
     if (!pDictionaryDef)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemDictionaryBase.Add", __LINE__, __WFILE__, NULL, L"CCoordinateSystemDictionaryBase", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemDictionaryBase.Add", __LINE__, __WFILE__, NULL, L"CCoordinateSystemDictionaryBase", NULL);
 
     MG_TRY()
 
@@ -193,7 +193,7 @@
 
     T* pDictionaryDef = dynamic_cast<T*>(pDefinition);
     if (!pDictionaryDef)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemDictionaryBase.Modify", __LINE__, __WFILE__, NULL, L"CCoordinateSystemDictionaryBase", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemDictionaryBase.Modify", __LINE__, __WFILE__, NULL, L"CCoordinateSystemDictionaryBase", NULL);
 
     MG_TRY()
 
@@ -239,12 +239,12 @@
     {
         MgStringCollection whatArguments;
         whatArguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"CCoordinateSystemDictionaryBase.Get", __LINE__, __WFILE__, &whatArguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"CCoordinateSystemDictionaryBase.Get", __LINE__, __WFILE__, &whatArguments, L"", NULL);
     }
 
     pDefinition = this->NewItem(); //no AddRef; release if needed
     if (NULL == pDefinition.p) //ABA ???
-        throw new MgOutOfMemoryException(L"CCoordinateSystemDictionaryBase.Get", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemDictionaryBase.Get", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //we've created the Mg instance, we got the CS_Map definition; now let the Mg instance initialize itself from the
     //struct;
@@ -276,10 +276,17 @@
 
         return NULL != definition;
     }
-    catch(MgCoordinateSystemLoadFailedException* loadFailedException)
+    catch (MgException* ex)
     {
-        loadFailedException->Release();
-        return false;
+        if (ex->GetExceptionCode() == MgExceptionCodes::MgCoordinateSystemLoadFailedException)
+        {
+            ex->Release();
+            return false;
+        }
+        else
+        {
+            ex->Raise();
+        }
     }
 
     MG_CATCH_AND_THROW(L"CCoordinateSystemDictionaryBase.Has")
@@ -325,7 +332,7 @@
             definitionAccess->readAllDefinitions);
 
         if (NULL == allDictionaryEntries) //whatever happend here - the dictionay file seems to be invalid
-            throw new MgCoordinateSystemLoadFailedException(L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else
     {
@@ -343,7 +350,7 @@
         && NULL == mgException.p)
         //if there hasn't yet an exception occurred we now have one
         //if there was one already we (unfortunately) do now swallow the MgFileIoException
-        mgException = new MgFileIoException(L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        mgException = new MgException(MgExceptionCodes::MgFileIoException, L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
     MG_THROW()
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
     char *pDict = Convert_Wide_To_Ascii(kpDict);    //need to delete [] pDict;
     if (NULL == pDict)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure the file doesn't already exist
@@ -99,7 +99,7 @@
         CS_fclose(pFile);
         delete [] pDict;
         //It already exists, but it's not supposed to.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
     }
     if (pFile)
     {
@@ -113,7 +113,7 @@
     if (1!=nWrite || ferror(pFile))
     {
         CS_fclose(pFile);
-        throw new MgFileIoException(L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Success!

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,13 +63,13 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
     }
 
     if (!IsLegalString(sSrc.c_str(), nMaxSize))
     {
         //Can't set string, caller gave us an illegal value
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -76,7 +76,7 @@
     char *pStr = Convert_Wide_To_UTF8(sSrc.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy it in
@@ -118,7 +118,7 @@
     wchar_t *pName = Convert_UTF8_To_Wide(m_def.key_nm);
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.GetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.GetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sName=pName;
     delete[] pName;
@@ -137,12 +137,12 @@
     if (Protected())
     {
         //Can't modify a read-only object.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
     }
 
     if (sCode.empty())
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -149,7 +149,7 @@
     char *pStr = Convert_Wide_To_UTF8(sCode.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Try to make a legal name.  CS_nampp() legalizes the
@@ -161,7 +161,7 @@
     {
         //illegal string
         delete [] pStr;
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy into the definition
@@ -259,7 +259,7 @@
     bool bResult = BuildElDefFromInterface(pElDef, def);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEllipsoid.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEllipsoid.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //And compare with this one!
@@ -292,7 +292,7 @@
 
     if (NULL == pDef.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new
@@ -324,7 +324,7 @@
     wchar_t *pDesc = Convert_UTF8_To_Wide(m_def.name);
     if (NULL == pDesc)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.GetDescription", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sDesc=pDesc;
     delete[] pDesc;
@@ -362,7 +362,7 @@
     wchar_t *pGroup = Convert_UTF8_To_Wide(m_def.group);
     if (NULL == pGroup)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.GetGroup", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     sGroup=pGroup;
     delete[] pGroup;
@@ -399,7 +399,7 @@
     wchar_t *pSource = Convert_UTF8_To_Wide(m_def.source);
     if (NULL == pSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoid.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoid.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING sSource(pSource);
     delete[] pSource;
@@ -511,7 +511,7 @@
     if (Protected())
     {
         //can't change a read-only object
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
     }
 
     //Make sure the radii are mathematically valid
@@ -518,7 +518,7 @@
     if (!IsLegalEllipsoidRadius(dEquatorialRadius)
         || !IsLegalEllipsoidRadius(dPolarRadius))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure the flattening ratio is legitimate
@@ -525,7 +525,7 @@
     double dFlat = FlatteningRatio(dEquatorialRadius, dPolarRadius);
     if (!::IsLegalFlatteningRatio(dFlat))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Okay, everything's kosher, store the values.
@@ -552,7 +552,7 @@
     assert(dFlat <= 1.0);
     if ((dFlat < 0.0) || (dFlat > 1.0))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.FlatteningRatioToEccentricity", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.FlatteningRatioToEccentricity", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     dEccent = Eccentricity(dFlat);
@@ -577,7 +577,7 @@
     assert(dEccent <= 1.0);
     if ((dEccent < 0.0) || (dEccent > 1.0))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.EccentToFlat", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.EccentToFlat", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     dFlat = FlatteningRatio(dEccent);
@@ -602,7 +602,7 @@
     assert(dFlatteningRatio < 1.0);
     if ((dFlatteningRatio < 0.0) || (dFlatteningRatio >= 1.0))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.EquatorialRadiusFromPolarRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.EquatorialRadiusFromPolarRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     dEquatorialRadius = dPolarRadius / (1.0 - dFlatteningRatio);
@@ -627,7 +627,7 @@
     assert(dFlatteningRatio < 1.0);
     if ((dFlatteningRatio < 0.0) || (dFlatteningRatio >= 1.0))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.PolarRadiusFromEquatorialRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.PolarRadiusFromEquatorialRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     dPolarRadius = dEquatorialRadius * (1.0 - dFlatteningRatio);
@@ -787,11 +787,11 @@
 
     if (!IsLegalEllipsoidRadius(dEquatorialRadius))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     if (!IsLegalEllipsoidRadius(dPolarRadius))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     dFlat = FlatteningRatio(dEquatorialRadius, dPolarRadius);
@@ -815,7 +815,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     UINT8 nVersion=pStreamOut[0];
@@ -851,7 +851,7 @@
         {
             m_bEncrypted = bPrevEncrypted;
             m_def = prevDef;
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -868,7 +868,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoid.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoid.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //save the version

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -253,7 +253,7 @@
 
     if (NULL == pNewDef.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoidDictionary.NewEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoidDictionary.NewEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEllipsoidDictionary.NewEllipsoid")
@@ -285,7 +285,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sFileName);
-        throw new MgFileIoException(L"MgCoordinateSystemEllipsoidDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemEllipsoidDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
     }
 
     MentorDictionary::SetFileName(
@@ -352,7 +352,7 @@
     nSize=(ulFileBytes - sizeof(m_lMagic)) / sizeof(cs_Eldef_);
     if (0!=CS_fclose(pFile))
     {
-        throw new MgFileIoException(L"MgCoordinateSystemEllipsoidDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemEllipsoidDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEllipsoidDictionary.GetSize")
 
@@ -379,7 +379,7 @@
     MgCoordinateSystemEllipsoid* pEllipsoidDef=dynamic_cast<MgCoordinateSystemEllipsoid*>(pDefinition);
     if (!pEllipsoidDef)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoidDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoidDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
@@ -429,7 +429,7 @@
     MgCoordinateSystemEllipsoid* pEllipsoidDef=dynamic_cast<MgCoordinateSystemEllipsoid*>(pDefinition);
     if (!pEllipsoidDef)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoidDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoidDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
@@ -475,7 +475,7 @@
         //wasn't there!
         MgStringCollection whatArguments;
         whatArguments.Add(sName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, &whatArguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, &whatArguments, L"", NULL);
     }
 
     //Okay, at this point we have a Mentor ellipsoid definition
@@ -508,7 +508,7 @@
 
     if (NULL == pEllipsoidDef.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return pEllipsoidDef.Detach();
@@ -526,7 +526,7 @@
     char *pName = Convert_Wide_To_UTF8(sName.c_str()); //need to delete [] pName
     if (NULL == pName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEllipsoidDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEllipsoidDictionary.Has", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (NULL != m_pmapSystemNameDescription)
@@ -579,7 +579,7 @@
 
     //close the file before calling into the [read all CS-Map defs] method
     if (0 != CS_fclose(pFile))
-        throw new MgFileIoException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
     pFile = NULL;
 
@@ -592,7 +592,7 @@
             CS_eldefAll);
         if (NULL == m_pmapSystemNameDescription)
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -601,7 +601,7 @@
 
     if (pFile && 0 != CS_fclose(pFile))
     {
-        throw new MgFileIoException(L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
     }
 
     pFile = NULL;
@@ -630,7 +630,7 @@
 
     CCoordinateSystemEllipsoidDictionary* ellipsoidDictionary = dynamic_cast<CCoordinateSystemEllipsoidDictionary*>(targetDictionary);
     if (NULL == ellipsoidDictionary)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemEllipsoidDictionary.ReadAllEllipsoids", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemEllipsoidDictionary.ReadAllEllipsoids", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return MentorDictionary::ReadAllDefinitions<MgCoordinateSystemEllipsoid, cs_Eldef_, CCoordinateSystemEllipsoidDictionary>(
         ellipsoidDictionary,

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnum.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -104,7 +104,7 @@
     pOutput=new MgDisposableCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //optimization:
@@ -136,7 +136,7 @@
         wchar_t* pStr = Convert_UTF8_To_Wide(kpName);
         if (NULL == pStr)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING str(pStr);
@@ -147,7 +147,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(str);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         //is it filtered out?
@@ -173,7 +173,7 @@
     pOutput=new MgStringCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     for (; m_iter != m_pmapSystemNameDescription->end(); ++m_iter)
     {
@@ -190,7 +190,7 @@
         wchar_t *pwName = Convert_UTF8_To_Wide(kpName);
         if (NULL == pwName)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pOutput->Add(pwName);
         delete[] pwName;
@@ -208,7 +208,7 @@
     pOutput=new MgStringCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     for (; m_iter != m_pmapSystemNameDescription->end(); ++m_iter)
     {
@@ -225,7 +225,7 @@
         wchar_t *pwDecsription = Convert_UTF8_To_Wide(kpDecsription);
         if (NULL == pwDecsription)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pOutput->Add(pwDecsription);
         delete[] pwDecsription;
@@ -261,7 +261,7 @@
 
     if (ulSkipCount != ulSkipped)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEnum.Skip")
@@ -300,7 +300,7 @@
     wchar_t* pStr = Convert_UTF8_To_Wide(kpName);
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING str(pStr);
     delete[] pStr;
@@ -310,7 +310,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(str);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     //Evaluate it
@@ -360,7 +360,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCategory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
     wchar_t* pStr = Convert_UTF8_To_Wide(kpName);
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING str(pStr);
     delete[] pStr;
@@ -110,7 +110,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(str);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     //Evaluate it
@@ -155,7 +155,7 @@
     pOutput=new MgDisposableCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     wchar_t* pStr;
@@ -173,7 +173,7 @@
         pStr = Convert_UTF8_To_Wide(kpName);
         if (NULL == pStr)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         STRING str(pStr);
         delete[] pStr;
@@ -183,7 +183,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(str);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         //check if this category is filtered out or not
@@ -211,7 +211,7 @@
     pOutput=new MgStringCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     for (; m_iter != m_pCategoryNameList->end(); ++m_iter)
@@ -231,7 +231,7 @@
         wchar_t *pwName = Convert_UTF8_To_Wide(kpName);
         if (NULL == pwName)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.NextName", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pOutput->Add(pwName);
         delete[] pwName;
@@ -244,7 +244,7 @@
 //----------------------------------------------------------
 MgStringCollection* CCoordinateSystemEnumCategory::NextDescription(UINT32 ulCount)
 {
-    throw new MgNotImplementedException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //----------------------------------------------------------
@@ -273,7 +273,7 @@
 
     if (ulSkipCount != ulSkipped)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEnum.Skip")
@@ -303,7 +303,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy it from this one

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -98,18 +98,18 @@
     pOutput=new MgDisposableCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (!m_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgCoordinateSystemDictionary> pCsDict = m_pCatalog->GetCoordinateSystemDictionary();
     if (!pCsDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.Next", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.Next", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
     }
 
     for (; m_iter != this->m_csNames.end(); ++m_iter)
@@ -201,7 +201,7 @@
 
     if (ulSkipCount != ulSkipped)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEnum.Skip")
@@ -235,12 +235,12 @@
 
     if (!m_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemDictionary> pCsDict=m_pCatalog->GetCoordinateSystemDictionary();
     if (!pCsDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.IsFilteredOut", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystem.IsFilteredOut", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
     }
 
     //Get a def from the set for the Filter to work with
@@ -251,7 +251,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(str);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     //Evaluate it

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumDatum.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -49,7 +49,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumEllipsoid.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -49,7 +49,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnum.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -71,7 +71,7 @@
     m_pnValues = new INT32[ulSize];
     if (NULL == m_pnValues)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnumInteger32.SetList", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnumInteger32.SetList", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy them in and return success
@@ -112,7 +112,7 @@
     pOutput=new MgIntCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnumInteger32.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnumInteger32.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     for (; m_ulPos < m_ulSize; m_ulPos++)
@@ -144,7 +144,7 @@
     pOutput=new MgStringCollection;
     if (!pOutput)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnumInteger32.Next", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnumInteger32.Next", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     for (; m_ulPos < m_ulSize; m_ulPos++)
@@ -197,7 +197,7 @@
     }
     if (ulSkipCount != ulSkipped)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemEnumInteger32.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemEnumInteger32.Skip", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEnumInteger32.Skip")
 }
@@ -251,7 +251,7 @@
 
     if (NULL == pNew.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemEnumInteger32.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemEnumInteger32.CreateClone", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy data members into the new object.  NOTE:  if new

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -62,13 +62,13 @@
     if (wktFlvrUnknown==GetWktFlavor(nWktFlavor))
     {
         //invalid argument
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     bool bResult = BuildDefsFromInterface(pSource, pCsDef, pDtDef, pElDef);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (ProjectionIsNerthType (pCsDef->prj_knm))
@@ -85,7 +85,7 @@
             wchar_t* pwszWkt=Convert_UTF8_To_Wide(csWktBufr);
             if (!pwszWkt)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             sWkt=pwszWkt;
             delete[] pwszWkt;
@@ -159,11 +159,11 @@
             Ptr<CCoordinateSystem> pNew = new CCoordinateSystem(m_pCatalog);
             if (NULL == pNew.p)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             else if (!pNew->InitArbitrary(csprm))
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             return pNew.Detach();
         }
@@ -172,7 +172,7 @@
     pszWkt = Convert_Wide_To_UTF8(sWkt.c_str());
     if (NULL == pszWkt)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     struct cs_Csdef_ csDef;
@@ -346,7 +346,7 @@
         //make a coordsys object
         if (!pCsDef || !pElDef)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         //do we have a datum?
@@ -356,7 +356,7 @@
             Ptr<MgCoordinateSystemDatum> pDtDef=BuildInterfaceFromDtDef(dtDef, NULL);
             if (!pDtDef)
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             pDtDef->SetEllipsoidDefinition(pElDef);
             pCsDef->SetDatumDefinition(pDtDef);
@@ -387,7 +387,7 @@
         // Could not create the coordinate system from the WKT
         MgStringCollection arguments;
         arguments.Add(sWkt);
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromWkt", &arguments);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromWkt", &arguments);
     }
     else
     {
@@ -432,7 +432,7 @@
     if (wktFlvrUnknown==GetWktFlavor(nWktFlavor))
     {
         //invalid argument
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     std::string szMsiName;
@@ -487,7 +487,7 @@
         char *pszCsSource = Convert_Wide_To_UTF8(sCodeSource.c_str());
         if (!pszCsSource)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         strName=pszCsSource;
         delete[] pszCsSource;
@@ -501,7 +501,7 @@
     else
     {
         //invalid source format
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //now get the WKT
@@ -511,7 +511,7 @@
     wchar_t* wszMsiName=Convert_UTF8_To_Wide(szMsiName.c_str());
     if (!wszMsiName)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING strMsiName(wszMsiName);
     delete[] wszMsiName;
@@ -520,7 +520,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(strMsiName);
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     INT32 prj=pCsCoordinateSystemDef->GetProjectionCode();
@@ -536,7 +536,7 @@
             wchar_t* wszWkt=Convert_UTF8_To_Wide(csWktBufr);
             if (!wszWkt)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             sWkt=wszWkt;
@@ -581,7 +581,7 @@
     pszWkt = Convert_Wide_To_UTF8(sWkt.c_str());
     if (NULL == pszWkt)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.WktToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.WktToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //numbers in WKT string always use a dot a separator but the locale might say otherwise
@@ -693,7 +693,7 @@
             else
             {
                 //invalid format
-                throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.WktToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.WktToCode", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
     }
@@ -735,13 +735,13 @@
     STRING sCsSource=pSource->GetCsCode();
     if (sCsSource.empty())
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pszCsSource = Convert_Wide_To_UTF8(sCsSource.c_str());
     if (NULL == pszCsSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //need to check if the system is in our dictionary
@@ -782,7 +782,7 @@
     else
     {
         //invalid format
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH(L"MgCoordinateSystemFormatConverter.DefinitionToCode")
@@ -803,7 +803,7 @@
     pszCsSource = Convert_Wide_To_UTF8(sCodeSource.c_str());
     if (NULL == pszCsSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     std::string szMsiName;
@@ -846,7 +846,7 @@
     else
     {
         //invalid format
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //now get the definition
@@ -857,7 +857,7 @@
         wchar_t* wszMsiName=Convert_UTF8_To_Wide(szMsiName.c_str());
         if (!wszMsiName)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         STRING sMsiName(wszMsiName);
         delete[] wszMsiName;
@@ -869,7 +869,7 @@
         // Could not create the coordinate system from the code
         MgStringCollection arguments;
         arguments.Add(sCodeSource);
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromCode", &arguments);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromCode", &arguments);
     }
 
     MG_CATCH(L"MgCoordinateSystemFormatConverter.CodeToDefinition")
@@ -890,7 +890,7 @@
     pszCsSource = Convert_Wide_To_UTF8(sCodeSource.c_str());
     if (NULL == pszCsSource)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //if input is EPSG
@@ -929,7 +929,7 @@
                         wchar_t *pwszCsDestination=Convert_UTF8_To_Wide(szMsiName.c_str());
                         if (!pwszCsDestination)
                         {
-                            throw new MgOutOfMemoryException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                         sCsCodeDestination=pwszCsDestination;
                         delete[] pwszCsDestination;
@@ -944,7 +944,7 @@
             else
             {
                 //invalid format
-                throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
     }
@@ -980,7 +980,7 @@
     else
     {
         //invalid format
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH(L"MgCoordinateSystemFormatConverter.CodeToCode")
@@ -1042,7 +1042,7 @@
     else
     {
         //invalid format
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemFormatConverter.IsCodeInDictionary", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFormatConverter.IsCodeInDictionary", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFormatConverter.IsCodeInDictionary")
@@ -1088,7 +1088,7 @@
 
     if (NULL == pCsDict.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgCoordinateSystemFormatConverter.GetCoordinateSystem",
             __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
     }
@@ -1117,7 +1117,7 @@
     bool bResult=BuildCsDefFromInterface(pCsDef, def);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFormatConverter.ConvertArbitraryToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFormatConverter.ConvertArbitraryToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     char* szWkt=CCsArbitraryCoordinateSystemUtil::ConvertCoordinateSystemToWkt(&def);

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -36,7 +36,7 @@
 {
     this->geocentricTransformParams = (csGeocentricXformParams*) CS_malc(sizeof(csGeocentricXformParams));
     if (NULL == this->geocentricTransformParams)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.Ctor", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.Ctor", __LINE__, __WFILE__, NULL, L"", NULL);
 
     *this->geocentricTransformParams = params;
 }
@@ -104,7 +104,7 @@
         break;
 
     default:
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     this->transformationMethod = analyticalMethodCode;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -57,7 +57,7 @@
 
     this->gridFileParams = (csGridFileXformParams*) CS_malc(sizeof(csGridFileXformParams));
     if (NULL == this->gridFileParams)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
 
     memset(this->gridFileParams, 0, sizeof(csGridFileXformParams));
 }
@@ -80,7 +80,7 @@
     ENSURE_NOT_NULL(gridFiles, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFileNames");
     const INT32 fileNamesCount = gridFiles->GetCount();
     if (fileNamesCount > csGRIDI1_FILEMAX)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
 
     bool emptyFileCollection = (0 == fileNamesCount);
     csGeodeticXfromParmsFile_* allFiles = emptyFileCollection ? NULL : new csGeodeticXfromParmsFile_[fileNamesCount];
@@ -95,11 +95,11 @@
         Ptr<MgDisposable> gridFile = gridFiles->GetItem(i); //calls [AddRef] on the item being returned
         CCoordinateSystemGeodeticTransformGridFile* gridFileSetting = dynamic_cast<CCoordinateSystemGeodeticTransformGridFile*>(gridFile.p);
         if (NULL == gridFileSetting)
-            throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
 
         //we only allow for setting valid grid files
         if (!gridFileSetting->IsValid())
-            throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"", NULL);
 
         //take the values from the settings we have been passed here and set our internal
         //[csGridFileXFormat] instance at index [i] to those values

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
 
     this->mulRegParams = (csMultipleRegressionXformParams*) CS_malc(sizeof(csMultipleRegressionXformParams));
     if (NULL == this->mulRegParams)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
 
     memset(this->mulRegParams, 0, sizeof(csMultipleRegressionXformParams));
 }
@@ -108,7 +108,7 @@
         break;
 
     default:
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     this->transformationMethod = mulRegTransformationMethod;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,7 +63,7 @@
     this->pathDefinition = (cs_GeodeticPath_*)CS_malc(sizeof(cs_GeodeticPath_));
 
     if (NULL == this->pathDefinition)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticPath.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticPath.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
 
     memset ((void*)this->pathDefinition, 0, sizeof(cs_GeodeticPath_));
 }
@@ -156,7 +156,7 @@
 
     const INT32 pathElementCount = pathElements->GetCount();
     if (0 == pathElementCount || pathElementCount > csPATH_MAXXFRM)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"", NULL);
 
     cs_GeodeticPathElement_* validElements = new cs_GeodeticPathElement_[pathElementCount];
 
@@ -170,7 +170,7 @@
         Ptr<MgDisposable> collectionItem = pathElements->GetItem(i);
         MgCoordinateSystemGeodeticPathElement* pathElement = dynamic_cast<MgCoordinateSystemGeodeticPathElement*>(collectionItem.p);
         if (NULL == pathElement)
-            throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"", NULL);
 
         cs_GeodeticPathElement_& pathElementDef = validElements[i];
 
@@ -216,7 +216,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     UINT8 nVersion=pStreamOut[0];
@@ -231,7 +231,7 @@
         if (pathDefinition == NULL)
         {
             this->pathDefinition = previousPathPtr;
-            throw new MgOutOfMemoryException (L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         memcpy(pathDefinition, pStreamOut, sizeof(cs_GeodeticPath_));
         pStreamOut = pStreamOut + sizeof(cs_GeodeticPath_);
@@ -241,7 +241,7 @@
         {
             CS_free (this->pathDefinition);
             this->pathDefinition = previousPathPtr;
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         CS_free (previousPathPtr);
     }
@@ -259,7 +259,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticPath.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticPath.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //save the version

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -180,11 +180,8 @@
     {
         return static_cast<MgCoordinateSystemGeodeticPath*>(this->m_pDictionary->Get(sName));
     }
-    catch(MgCoordinateSystemLoadFailedException* loadFailedException)
-    {
-        //catch only the [MgCoordinateSystemLoadFailedException] and release it right away
-        loadFailedException->Release();
-    }
+    //catch only the [MgCoordinateSystemLoadFailedException] and release it right away
+    MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemLoadFailedException)
 
     return NULL;
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -61,7 +61,7 @@
 {
     cs_GeodeticPathElement_* tempPathElement = (cs_GeodeticPathElement_*) CS_malc(sizeof(cs_GeodeticPathElement_));
     if (NULL == tempPathElement)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticPathElement.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticPathElement.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_TRY()
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,7 +77,7 @@
         break;
 
     default:
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticStandaloneDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticStandaloneDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     this->m_nStandaloneMethodCode = standaloneMethodCode;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -78,13 +78,13 @@
         break;
 
     default:
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformDef.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticTransformDef.Reset", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //try creating a new [cs_GeodeticTransform_] instance before we wipe out our own stuff
     cs_GeodeticTransform_* newEmptyDef = (cs_GeodeticTransform_*)CS_malc(sizeof(cs_GeodeticTransform_));
     if (NULL == newEmptyDef) //uses CS_malc which returns NULL in case allocation fails
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticTransformDef.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticTransformDef.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_TRY()
 
@@ -160,7 +160,7 @@
         break;
 
     default: //invalid / unknown [methodCode] given; don't know how to proceed here
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformDef.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticTransformDef.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return transformationType;
@@ -181,7 +181,7 @@
     VERIFY_INITIALIZED(L"CCoordinateSystemGeodeticTransformDef.CreateTransformation");
 
     if (!this->IsValid())
-        throw new MgInvalidOperationException(L"CCoordinateSystemGeodeticTransformDef.CreateTransformation", __LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"CCoordinateSystemGeodeticTransformDef.CreateTransformation", __LINE__,__WFILE__, NULL, L"", NULL);
 
     //we don't take ownership of the transformation being returned but
     //will release [sourceDatum] and [targetDatum];
@@ -242,7 +242,7 @@
 
     default: //invalid state; why's that?
         _ASSERT(false);
-        throw new MgInvalidOperationException(L"CCoordinateSystemGeodeticTransformDef.GetParameters", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"CCoordinateSystemGeodeticTransformDef.GetParameters", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
 
@@ -314,7 +314,7 @@
     }
 
     if (NULL == transformDefParams)
-        throw new MgInvalidOperationException(L"CCoordinateSystemGeodeticTransformDef.SetParameters", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"CCoordinateSystemGeodeticTransformDef.SetParameters", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //copy the values from the parameter we've been passed into our own [parameters] section
     transformDefParams->CopyTo(&this->transformDefinition->parameters);
@@ -380,7 +380,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // In case an exception gets thrown.
@@ -400,7 +400,7 @@
         //Read the def from the stream
         allocatedBlock = (cs_GeodeticTransform_*)CS_malc(sizeof(cs_GeodeticTransform_));
         if (NULL == allocatedBlock)
-            throw new MgOutOfMemoryException (L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
 
         this->transformDefinition = allocatedBlock;
 
@@ -422,7 +422,7 @@
             // Nope!  It's not valid, but not valid in such a way that would cause
             // an exception to be thrown.  transformationDefinition cannot be
             // NULL at this point.
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -452,7 +452,7 @@
     assert(NULL != pStream);
     if (!pStream)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformDef.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformDef.SerializeTo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //save the version

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDefDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,11 +86,8 @@
     {
         return static_cast<MgCoordinateSystemGeodeticTransformDef*>(this->m_pDictionary->Get(transformationName));
     }
-    catch(MgCoordinateSystemLoadFailedException* loadFailedException)
-    {
-        //catch only the [MgCoordinateSystemLoadFailedException] and release it right away
-        loadFailedException->Release();
-    }
+    //catch only the [MgCoordinateSystemLoadFailedException] and release it right away
+    MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemLoadFailedException)
 
     return NULL;
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformGridFile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -38,7 +38,7 @@
 {
     this->gridFileDesc = (csGeodeticXfromParmsFile_*)CS_malc(sizeof(csGeodeticXfromParmsFile_));
     if (NULL == this->gridFileDesc)
-        throw new MgOutOfMemoryException(L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.ctor", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.ctor", __LINE__, __WFILE__, NULL, L"", NULL);
 
     ::memset(this->gridFileDesc, 0, sizeof(csGeodeticXfromParmsFile_));
     if (NULL != fileFormatParam)

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
     MgCoordinateSystemDatum *pSourceTmp=GetWGS84IfNull(pSource);
     if (!pSourceTmp)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
     }
     CCoordinateSystemDatum* pDtSourceImp=dynamic_cast<CCoordinateSystemDatum*>(pSourceTmp);
     assert(pDtSourceImp);
@@ -104,7 +104,7 @@
         {
             SAFE_RELEASE(pSourceTmp);
         }
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
     }
 
     //Set up our target datum
@@ -116,7 +116,7 @@
         {
             SAFE_RELEASE(pSourceTmp);
         }
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
     }
     CCoordinateSystemDatum* pDtTargetImp=dynamic_cast<CCoordinateSystemDatum*>(pTargetTmp);
     assert(pDtTargetImp);
@@ -132,7 +132,7 @@
         {
             SAFE_RELEASE(pTargetTmp);
         }
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
     }
 
     //Set up our datum conversion struct
@@ -142,7 +142,7 @@
     assert(pDtcprm);
     if (!pDtcprm)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
     }
 
     Uninitialize();
@@ -176,7 +176,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return SAFE_ADDREF(m_pDtSource);
@@ -191,7 +191,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetTarget", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetTarget", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return SAFE_ADDREF(m_pDtTarget);
@@ -227,12 +227,12 @@
     if (1==nResult)
     {
         // Partial failure - Outside the useful range.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
     }
     else if (-1==nResult)
     {
         // Total failure - Outside the mathematical domain.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
     }
     pLonLat->SetX(dLongitude);
     pLonLat->SetY(dLatitude);
@@ -270,18 +270,18 @@
     if (1==nResult)
     {
         // Partial failure - Outside the useful range.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
     }
     else if (-1==nResult)
     {
         // Total failure - Outside the mathematical domain.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
     }
 
     pCoord=new MgCoordinateXY(dLongitude, dLatitude);
     if (!pCoord)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemGeodeticTransformation.Shift")
     return pCoord.Detach();
@@ -316,18 +316,18 @@
     if (1==nResult)
     {
         // Partial failure - Outside the useful range.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
     }
     else if (-1==nResult)
     {
         // Total failure - Outside the mathematical domain.
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
     }
 
     pCoord=new MgCoordinateXYZ(dLongitude, dLatitude, dZ);
     if (!pCoord)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemGeodeticTransformation.Shift")
@@ -374,7 +374,7 @@
 
     CCoordinateSystemGeodeticTransformDef* transformDefImpl = dynamic_cast<CCoordinateSystemGeodeticTransformDef*>(transformationDef);
     if (NULL == transformDefImpl)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
 
     cs_GeodeticTransform_ csMapTransformDef;
     transformDefImpl->CopyTo(csMapTransformDef);
@@ -383,7 +383,7 @@
     datumTransform = CSdtcsu2(&csMapTransformDef, createInversed ? cs_DTCDIR_INV : cs_DTCDIR_FWD, cs_DTCFLG_BLK_W);
 
     if (NULL == datumTransform)
-        throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgCoordinateSystemDatumDictionary> datumDictionary = this->m_pCatalog->GetDatumDictionary();
     Ptr<MgCoordinateSystemDatum> srcDatum = datumDictionary->GetDatum(transformationDef->GetSourceDatum());
@@ -491,7 +491,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetOffsetX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
     dResult=def.delta_X;
 
@@ -508,7 +508,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetOffsetY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
     dResult=def.delta_Y;
     MG_CATCH_AND_THROW(L"MgCoordinateSystemGeodeticTransformation.GetOffsetY")
@@ -524,7 +524,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetOffsetZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
     dResult=def.delta_Z;
     MG_CATCH_AND_THROW(L"MgCoordinateSystemGeodeticTransformation.GetOffsetZ")
@@ -546,12 +546,12 @@
     MG_TRY()
     if (!m_pDtSource || !m_pDtTarget)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     //if not WGS84 for the target system, bye bye!
     if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
@@ -558,7 +558,7 @@
     assert(pDatumImp);
     if (!pDatumImp)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure this object isn't read-only
@@ -565,7 +565,7 @@
     if (m_pDtSource->IsProtected())
     {
         //can't change a read-only object
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     if (!IsLegalDatumOffset(x) ||
@@ -573,7 +573,7 @@
         !IsLegalDatumOffset(z))
     {
         //Caller gave us an illegal value.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pDatumImp->m_DtDef.delta_X = pDatumImp->m_datum.delta_X = x;
@@ -605,7 +605,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     dResult = def.rot_X;
@@ -623,7 +623,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     dResult = def.rot_Y;
@@ -641,7 +641,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     dResult = def.rot_Z;
@@ -659,7 +659,7 @@
     cs_Dtdef_ def;
     if (!GetDefinitionForGeodeticTransformationParameter(def))
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformBwScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformBwScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     dResult = def.bwscale;
@@ -685,12 +685,12 @@
 
     if (!m_pDtSource || !m_pDtTarget)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     //if not WGS84 for the target system, bye bye!
     if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
@@ -697,7 +697,7 @@
     assert(pDatumImp);
     if (!pDatumImp)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure this object isn't read-only
@@ -704,7 +704,7 @@
     if (m_pDtSource->IsProtected())
     {
         //can't change a read-only object
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     if (!IsLegalDatumRotation(dRotationX) ||
@@ -713,7 +713,7 @@
         !::IsLegalBwScale(dBwScale))
     {
         //Caller gave us an illegal value.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pDatumImp->m_DtDef.rot_X = pDatumImp->m_datum.rot_X = dRotationX;
@@ -767,12 +767,12 @@
 
     if (!m_pDtSource || !m_pDtTarget)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     //if not WGS84 for the target system, bye bye!
     if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
@@ -779,7 +779,7 @@
     assert(pDatumImp);
     if (!pDatumImp)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure this object isn't read-only
@@ -786,13 +786,13 @@
     if (m_pDtSource->IsProtected())
     {
         //can't change a read-only object
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
     }
 
     if (!IsLegalGeodeticTransformationMethod(nGeodeticTransformationMethod))
     {
         //Not one of the known datum conversion techniques.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pDatumImp->m_DtDef.to84_via = pDatumImp->m_datum.to84_via = nGeodeticTransformationMethod;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -183,7 +183,7 @@
     codeOk = GetUnitInfo(unitCode,&lclUnitType,NULL);
     if (!codeOk || unitType != lclUnitType)
     {
-        throw new MgInvalidCoordinateSystemUnitsException(L"MgCoordinateSystemGridSpecification.SetUnits",
+        throw new MgException(MgExceptionCodes::MgInvalidCoordinateSystemUnitsException, L"MgCoordinateSystemGridSpecification.SetUnits",
                                                           __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -353,7 +353,7 @@
     GetUnitInfo(trgUnitCode,&trgUnitType,NULL);
     if (trgUnitType != m_UnitType)
     {
-        throw new MgInvalidCoordinateSystemUnitsException(L"MgCoordinateSystemGridSpecification.ConvertUnitsOfValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidCoordinateSystemUnitsException, L"MgCoordinateSystemGridSpecification.ConvertUnitsOfValue", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Calculate the appropriate units conversion factor.  Since the unit types
@@ -428,7 +428,7 @@
 
         if (!swPnt|| !swPnt || !nePnt || !nwPnt ||!clPnt)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
                                              __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -435,7 +435,7 @@
         collection = new MgCoordinateCollection();
         if (collection == NULL)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
                                              __LINE__, __WFILE__, NULL, L"", NULL);
         }
         collection->Add (swPnt);
@@ -447,7 +447,7 @@
         Ptr<MgLinearRing> ring = factory.CreateLinearRing (collection);
         if (ring == 0)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemGridBoundary.SetBoundaryExtents",
                                              __LINE__, __WFILE__, NULL, L"", NULL);
         }
         m_GridBoundary = factory.CreatePolygon (ring,NULL);
@@ -983,7 +983,7 @@
 void CCoordinateSystemGridLineCollection::SetItem (INT32 index,MgCoordinateSystemGridLine* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridLineCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridLineCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_GridLineCollection->SetItem (index,value);
 }
@@ -990,7 +990,7 @@
 void CCoordinateSystemGridLineCollection::Add (MgCoordinateSystemGridLine* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridLineCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridLineCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // The MgDIsposableCollection object does the "SAFE_ADDREF" operation.
     m_GridLineCollection->Add (value);
@@ -1057,7 +1057,7 @@
 void CCoordinateSystemGridRegionCollection::SetItem (INT32 index, MgCoordinateSystemGridRegion* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridRegionCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridRegionCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_GridRegionCollection->SetItem (index,value);
 }
@@ -1064,7 +1064,7 @@
 void CCoordinateSystemGridRegionCollection::Add (MgCoordinateSystemGridRegion* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridRegionCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridRegionCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_GridRegionCollection->Add (value);
 }
@@ -1133,7 +1133,7 @@
 void CCoordinateSystemGridTickCollection::SetItem (INT32 index, MgCoordinateSystemGridTick* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridTickCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridTickCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_GridTickCollection->SetItem (index,value);
 }
@@ -1140,7 +1140,7 @@
 void CCoordinateSystemGridTickCollection::Add (MgCoordinateSystemGridTick* value)
 {
     if (GetAvailableMemory() < m_MemoryThreshold)
-        throw new MgGridDensityException(L"CCoordinateSystemGridTickCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgGridDensityException, L"CCoordinateSystemGridTickCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_GridTickCollection->Add (value);
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysMacro.h
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysMacro.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysMacro.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -26,17 +26,17 @@
 
 #ifdef CS_MAP_DEF_VARIABLE
     #define VERIFY_INITIALIZED(x)   if (NULL == CS_MAP_DEF_VARIABLE) \
-        throw new MgInvalidOperationException(x, __LINE__, __WFILE__, NULL, L"", NULL)
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, x, __LINE__, __WFILE__, NULL, L"", NULL)
 #else
     #define VERIFY_INITIALIZED(x)
 #endif
 
 #define VERIFY_NOT_PROTECTED(x) if (this->IsProtected()) \
-    throw new MgCoordinateSystemInitializationFailedException(x, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+    throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, x, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
 
 #define ENSURE_NOT_NULL(param,method) \
     if (NULL == param) \
-        throw new MgNullArgumentException(method, __LINE__, __WFILE__, NULL, L"", NULL)
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, method, __LINE__, __WFILE__, NULL, L"", NULL)
 
 #define DEFINE_GET_STRING(x,y) STRING x::Get##y()
 #define DEFINE_SET_STRING(x,y) void x::Set##y(CREFSTRING propertyValue)
@@ -51,7 +51,7 @@
     { \
         VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
         if (this->IsProtected()) \
-            throw new MgCoordinateSystemInitializationFailedException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
         \
         MentorSetString(propertyValue, charBuffer /* target buffer */, sizeof(charBuffer)); \
     }
@@ -72,7 +72,7 @@
     { \
         VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
         if (this->IsProtected()) \
-            throw new MgCoordinateSystemInitializationFailedException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
         \
         target = propertyValue;\
     }
@@ -82,7 +82,7 @@
     { \
         VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName)); \
         if (index < 0 || index > maxIdx) \
-            throw new MgArgumentOutOfRangeException(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+            throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
         \
         return target[index]; \
     } \
@@ -90,10 +90,10 @@
     { \
         VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
         if (this->IsProtected()) \
-            throw new MgCoordinateSystemInitializationFailedException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
         \
         if (index < 0 || index > maxIdx) \
-            throw new MgArgumentOutOfRangeException(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+            throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
         \
         target[index] = propertyValue;\
     }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysMeasure.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysMeasure.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysMeasure.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -200,7 +200,7 @@
     pNew=new MgEnvelope(m_pCoordSys->GetMinX(), m_pCoordSys->GetMinY(), m_pCoordSys->GetMaxX(), m_pCoordSys->GetMaxY());
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemMeasure.GetEnvelope", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMeasure.GetEnvelope", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     return pNew;
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -131,7 +131,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.Init", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.Init", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -151,7 +151,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemMgrs.InitFromEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMgrs.InitFromEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -172,7 +172,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.InitFromEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.InitFromEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -192,7 +192,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemMgrs.InitFromDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMgrs.InitFromDatum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -213,7 +213,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.InitFromDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.InitFromDatum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -279,7 +279,7 @@
         {
             if (m_bExceptionsOn)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             else
             {
@@ -405,7 +405,7 @@
     if (m_GridBoundary == 0)
     {
         // Proceeding without a grid boundary will cause a crash.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.GetGridLines",
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.GetGridLines",
                                                                    __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -463,7 +463,7 @@
     if (m_GridBoundary == 0)
     {
         // Proceeding without a grid boundary will cause a crash.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.GetGridRegions",
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.GetGridRegions",
                                                                    __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -495,7 +495,7 @@
     if (m_GridBoundary == 0)
     {
         // Proceeding without a grid boundary will cause a crash.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.GetGridRegions",
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.GetGridRegions",
                                                                    __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -717,7 +717,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -743,7 +743,7 @@
         {
             if (m_bExceptionsOn)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             else
             {
@@ -758,7 +758,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
         }
         else
         {
@@ -837,7 +837,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -851,7 +851,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -866,7 +866,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -890,7 +890,7 @@
     {
         if (m_bExceptionsOn)
         {
-            throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
         }
         else
         {

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysProjectionInformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -141,7 +141,7 @@
 
     if (NULL == pNewEnum.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemProjectionInformation.GetEnumProjections", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemProjectionInformation.GetEnumProjections", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pNewEnum->SetList(kProjections, klNumProjections);
@@ -162,7 +162,7 @@
     MG_TRY()
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // for each possible parameter.
     int parmIdx = 0;
@@ -188,13 +188,13 @@
     MG_TRY()
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.IsUsingParameter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.IsUsingParameter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     int nResult = CS_prjprm(NULL, nProjectionCode, ulIndex-1);
@@ -260,12 +260,12 @@
     MG_TRY()
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get information about the parameter
@@ -278,12 +278,12 @@
         break;
     case 0:
         //The projection does not use this parameter.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         break;
     case -1:
     default:
         //Not a valid projection.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -299,12 +299,12 @@
     MG_TRY()
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get information about the parameter
@@ -317,12 +317,12 @@
         break;
     case 0:
         //The projection does not use this parameter.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         break;
     case -1:
     default:
         //Not a valid projection.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -345,13 +345,13 @@
 
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get information about the parameter
@@ -364,12 +364,12 @@
         break;
     case 0:
         //The projection does not use this parameter.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         break;
     case -1:
     default:
         //Not a valid projection.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -397,13 +397,13 @@
 
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get information about the parameter
@@ -416,12 +416,12 @@
         break;
     case 0:
         //The projection does not use this parameter.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         break;
     case -1:
     default:
         //Not a valid projection.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -448,13 +448,13 @@
 
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Get information about the parameter
@@ -467,12 +467,12 @@
         break;
     case 0:
         //The projection does not use this parameter.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
         break;
     case -1:
     default:
         //Not a valid projection.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -500,13 +500,13 @@
 
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
     if ((ulIndex < 1) || (ulIndex > knCsNumParams))
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //MENTOR_MAINTENANCE
@@ -522,12 +522,12 @@
     }
     if (mp->prj_code == cs_PRJCOD_END)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     nIndex = mp->prm_types[ulIndex-1];
     if (nIndex <= 0)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
     }
 
     paramType = static_cast<INT32>(nIndex);
@@ -561,13 +561,13 @@
 {
     if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemProjectionInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemProjectionInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     wchar_t* pszTag=Convert_UTF8_To_Wide(StringFromProjection(nProjectionCode));
     if (NULL == pszTag)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemProjectionInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemProjectionInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING str(pszTag);
     delete[] pszTag;

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -109,7 +109,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.IsValidPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.IsValidPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     //Test the point
@@ -194,7 +194,7 @@
     pCoordinate = new MgCoordinateXY(dCoords [0], dCoords [1]);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemTransform.Transform")
     return pCoordinate;
@@ -257,7 +257,7 @@
     pCoordinate = new MgCoordinateXYM(dCoords [0], dCoords [1], lclM);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemTransform.TransformM")
@@ -319,7 +319,7 @@
     pCoordinate = new MgCoordinateXYZ(dCoords [0], dCoords [1], dCoords [2]);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemTransform.Transform")
@@ -384,7 +384,7 @@
     pCoordinate = new MgCoordinateXYZM(dCoords [0], dCoords [1], dCoords [2], lclM);
     if (!pCoordinate)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemTransform.TransformM")
     return pCoordinate;
@@ -511,7 +511,7 @@
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemTransform.TransformCoordinate", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemTransform.TransformCoordinate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     if (status != TransformOk)
     {
@@ -562,7 +562,7 @@
     else
     {
         // What dimension is this?
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemTransform.Transform")
 
@@ -758,7 +758,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.GetSource", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.GetSource", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     return SAFE_ADDREF(m_pCsSource.p);
@@ -773,7 +773,7 @@
     //Make sure we're initialized
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.GetTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.GetTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     return SAFE_ADDREF(m_pCsTarget.p);
@@ -803,7 +803,7 @@
     bValid = pSource->IsValid();
     if (!bValid)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Make sure the destination coordinate system is valid
@@ -810,7 +810,7 @@
     bValid = pTarget->IsValid();
     if (!bValid)
     {
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Build Mentor structs out of the source and destination
@@ -818,12 +818,12 @@
     bool bResult = BuildCsprmFromInterface(pSource, srcCsprm);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     bResult = BuildCsprmFromInterface(pTarget, dstCsprm);
     if (!bResult)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Attempt to set up a datum conversion.
@@ -837,7 +837,7 @@
         //This can easily happen if, for example, it's a NADCON
         //datum shift and Mentor couldn't find the NADCON
         //data files at run time.
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
     }
 
     //Okay, we're all set!  Uninitialize ourselves, and
@@ -881,17 +881,17 @@
 MgCoordinateSystemGeodeticTransformDef* CCoordinateSystemTransform::GetGeodeticTransformation (INT32 index)
 {
     if (index < 0 || index >= this->GetGeodeticTransformationCount())
-        throw new MgArgumentOutOfRangeException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
 
     // indexparameter is valid, get a pointer to the appropriate
     // CS-MAP transformation object.
     cs_GxXform_ *xfrmPtr = m_pDtcprm->xforms [index];
     if (NULL == xfrmPtr)
-        throw new MgCoordinateSystemInitializationFailedException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
 
     cs_GeodeticTransform_* xfrmDefPtr = &xfrmPtr->gxDef;
     if (NULL == xfrmDefPtr)
-        throw new MgCoordinateSystemInitializationFailedException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
 
     // Extract the name of the transformation.
     Ptr<MgCoordinateSystemGeodeticTransformDef> catalogTransformationDef;
@@ -919,7 +919,7 @@
         //in this case, CSMAP returns a [xfrmDefPtr] but the actual (explicit) transformation definition
         //doesn't exist in the dictionaries
         if (NULL == catalogTransformationDef)
-            throw new MgCoordinateSystemLoadFailedException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"", NULL);
 
     MG_CATCH(L"GetGeodeticTransformation.GetGeodeticTransformation")
 
@@ -1151,7 +1151,7 @@
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     dCoords [2] = 0.0;
@@ -1271,7 +1271,7 @@
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     dCoords [2] = 0.0;
@@ -1396,7 +1396,7 @@
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     m_nTransformStatus = TransformOk;
@@ -1523,7 +1523,7 @@
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     m_nTransformStatus = TransformOk;
@@ -1588,12 +1588,12 @@
     assert(pointCount > 0);
     if (0 >= pointCount)
     {
-        throw new MgNullArgumentException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     // Optimization
@@ -1632,7 +1632,7 @@
     }
     if (TransformTotalFailure <= status)
     {
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
     }
     return;
 }
@@ -1649,12 +1649,12 @@
     assert(pointCount > 0);
     if (0 >= pointCount)
     {
-        throw new MgNullArgumentException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     assert(IsInitialized());
     if (!IsInitialized())
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
     }
 
     // Optimization
@@ -1693,7 +1693,7 @@
     }
     if (TransformTotalFailure <= status)
     {
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
     }
     return;
 }
@@ -1938,7 +1938,7 @@
         else
         {
             // Invalid argument value.
-            throw new MgInvalidArgumentException(L"MgCoordinateSystemTransform.PositionOfValue",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemTransform.PositionOfValue",
                                                  __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2265,7 +2265,7 @@
     if (status == TransformTotalFailure)
     {
         m_nTransformStatus = TransformTotalFailure;
-        throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
     }
     else if (status == TransformDatumShiftWarning)
     {
@@ -2275,7 +2275,7 @@
         }
         if (!m_bIgnoreDatumShiftWarning)
         {
-            throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
         }
     }
     else if (status != TransformOk)
@@ -2286,7 +2286,7 @@
         }
         if(!m_bIgnoreOutsideDomainWarning)
         {
-            throw new MgCoordinateSystemConversionFailedException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemConversionFailedException, L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
         }
     }
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysUnitInformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -149,7 +149,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(L""); // dummy argument
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemUnknownUnit", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemUnknownUnit", NULL);
     }
 
     if (desiredUnitType != unitType)
@@ -156,7 +156,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(L""); // dummy argument
-        throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotLinearUnit", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotLinearUnit", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemUnitInformation.GetScale")
 
@@ -177,7 +177,7 @@
 
     if (NULL == pNewEnum.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemUnitInformation.GetEnumLinearUnits", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemUnitInformation.GetEnumLinearUnits", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pNewEnum->SetList(kLinearUnits, klNumLinearUnits);
@@ -201,7 +201,7 @@
 
     if (NULL == pNewEnum.p)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemUnitInformation.GetEnumAngularUnits", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemUnitInformation.GetEnumAngularUnits", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     pNewEnum->SetList(kAngularUnits, klNumAngularUnits);
@@ -258,7 +258,7 @@
     wchar_t* pszTag = Convert_UTF8_To_Wide(StringFromUnit(unit));
     if (NULL == pszTag)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemUnitInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemUnitInformation.GetTagString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING str(pszTag);
     delete[] pszTag;
@@ -282,7 +282,7 @@
     if (NULL == kpTag)
     {
         //Unknown unit type.
-        throw new MgInvalidArgumentException(L"MgCoordinateSystemUnitInformation.GetAbbreviation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemUnitInformation.GetAbbreviation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Look it up in Mentor's table

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -75,7 +75,7 @@
     case kFileIsValid:
         break;
     case kFileInvalidEmptyString:
-        throw new MgInvalidArgumentException(wszMethodName, __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, wszMethodName, __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     case kFileInvalidNotADir:
     case kFileInvalidIsADir:
@@ -82,7 +82,7 @@
         {
         MgStringCollection arguments;
         arguments.Add(sPathName);
-        throw new MgFileIoException(wszMethodName, __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, wszMethodName, __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
         }
         break;
     case kFileInvalidPath:
@@ -90,16 +90,16 @@
         {
         MgStringCollection arguments;
         arguments.Add(sPathName);
-        throw new MgFileIoException(wszMethodName, __LINE__, __WFILE__, &arguments, L"MgFileNotFoundException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, wszMethodName, __LINE__, __WFILE__, &arguments, L"MgFileNotFoundException", NULL);
         }
         break;
     case kFileInvalidCantRead:
     case kFileInvalidCantWrite:
-        throw new MgFileIoException(wszMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCatalogFileLockedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, wszMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCatalogFileLockedException", NULL);
         break;
     default:
         assert(0);
-        throw new MgUnclassifiedException(wszMethodName, __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgUnclassifiedException, wszMethodName, __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 }
@@ -697,6 +697,6 @@
     }
     return maxAvailable;
 #else // LINUX
-    throw new MgNotImplementedException(L"GetAvailableMemory", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"GetAvailableMemory", __LINE__, __WFILE__, NULL, L"", NULL);
 #endif
 }

Modified: trunk/MgDev/Common/CoordinateSystem/MentorDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/MentorDictionary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/MentorDictionary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -62,7 +62,7 @@
         bWriting = true;
         break;
     default:
-        throw new MgInvalidArgumentException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
         break;
     }
 
@@ -78,7 +78,7 @@
         switch (reason)
         {
         case kFileInvalidEmptyString:
-            throw new MgInvalidArgumentException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         case kFileInvalidPath:
         case kFileInvalidDoesNotExist:
@@ -86,7 +86,7 @@
             {
             MgStringCollection arguments;
             arguments.Add(kpPath);
-            throw new MgFileNotFoundException(L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"", NULL);
             }
             break;
         case kFileInvalidCantWrite:
@@ -93,11 +93,11 @@
             {
             MgStringCollection arguments;
             arguments.Add(kpPath);
-            throw new MgCoordinateSystemLoadFailedException(L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemDictionaryReadOnlyException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemDictionaryReadOnlyException", NULL);
             }
             break;
         default:
-            throw new MgUnclassifiedException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         }
         //return;
@@ -108,7 +108,7 @@
     GetFileModes(nOpenMode, szMode);
     if (NULL==(pFile=OpenDictionaryFile(kpPath, szMode, lMagic, ValidMagic)))
     {
-        throw new MgFileIoException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
     }
 
     //If the Mentor version is anything other than current, we're not allowed
@@ -118,7 +118,7 @@
         //Sorry, old version.  Write access not allowed.
         CS_fclose(pFile);
         pFile=NULL;
-        throw new MgInvalidArgumentException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryNoWriteToOldException", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryNoWriteToOldException", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MentorDictionary.Open")
@@ -159,7 +159,7 @@
         if (sDirectory.empty())
         {
             //Directory hasn't been specified yet.
-            throw new MgCoordinateSystemInitializationFailedException(kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
         }
 
         STRING sPath = sDirectory + sFileName;
@@ -179,7 +179,7 @@
         //Try to open the dictionary file
         if (!GetMagicFromDictionaryFile(sPath.c_str(), lMagic, ValidMagic))
         {
-            throw new MgFileIoException(kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
+            throw new MgException(MgExceptionCodes::MgFileIoException, kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
         }
     }//if dictionary is specified
 

Modified: trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
             return false;
 
         //i.e. nResult < 0
-        throw new MgFileIoException(L"MentorDictionary.GetNextEntry", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MentorDictionary.GetNextEntry", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //iterates through all entries return a vector of definitions in the same order as they've been returned by CsMap
@@ -116,7 +116,7 @@
 
             def = (T*) CS_malc(sizeof(T));
             if (NULL == def)
-                throw new MgOutOfMemoryException(L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"", NULL);
 
             while (MentorDictionary::GetNextEntry(pFile, *def, nCrypt, CS_Trd))
             {
@@ -126,10 +126,7 @@
 
             return allDictEntries.release();
         }
-        catch(MgFileIoException* ioException)
-        {
-            ioException->Release();
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgFileIoException)
         catch (std::bad_alloc&)
         {
         }
@@ -160,7 +157,7 @@
 
         allDefs.reset(MentorDictionary::ReadDictionaryEntries<T>(pFile, CS_Trd));
         if (NULL == allDefs.get())
-            throw new MgInvalidArgumentException(L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"", NULL);
 
         MG_CATCH(L"MentorDictionary.ReadDictionaryEntries")
 
@@ -168,7 +165,7 @@
         pFile = NULL;
 
         if (!fileClosed && NULL == mgException)
-            throw new MgFileIoException(L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+            throw new MgException(MgExceptionCodes::MgFileIoException, L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
 
         MG_THROW()
 
@@ -290,7 +287,7 @@
         CHECKARGUMENTNULL(targetDictionary, L"MentorDictionary.ReadAllDefinitions");
         CHECKARGUMENTNULL(GetCode, L"MentorDictionary.ReadAllDefinitions");
         if (0 != definitions.size())
-            throw new MgInvalidArgumentException(L"MentorDictionary.ReadAllDefinitions", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.ReadAllDefinitions", __LINE__, __WFILE__, NULL, L"", NULL);
 
         const UINT32 entryCount = targetDictionary->GetSize();;
         
@@ -331,7 +328,7 @@
             Ptr<MgDisposable> disposableItem = toBeFiltered->GetItem(j);
             T* mgCsItem = dynamic_cast<T*>(disposableItem.p);
             if (NULL == mgCsItem)
-                throw new MgInvalidArgumentException(L"MentorDictionary.FilterDefinitions", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.FilterDefinitions", __LINE__, __WFILE__, NULL, L"", NULL);
 
             //exclude the [mgCsItem], if it's not accepted by the filter we got
             if (filters->at(j)->IsFilteredOut(mgCsItem))
@@ -366,7 +363,7 @@
         if (readStatus < 0)
         {
             _ASSERT(NULL == pDefArray);
-            throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         const bool doPostProcess = (NULL != PostProcess);
@@ -433,7 +430,7 @@
         //Make sure the def they've given us is valid
         if (NULL != isValid && !CALL_MEMBER_FN(kpDef, isValid)())
         {
-            throw new MgInvalidArgumentException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         //Build a definition from the interface
@@ -441,7 +438,7 @@
         bool bResult = BuildDefFromInterface(kpDef, def);
         if (!bResult)
         {
-            throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         const char* keyName = key(def);
@@ -475,7 +472,7 @@
         if (bActuallyExists && !bAlreadyExists)
         {
             //It already exists, but it's not supposed to.
-            throw new MgInvalidArgumentException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
         }
         else if (!bActuallyExists && bAlreadyExists)
         {
@@ -483,7 +480,7 @@
             STRING message = MgUtil::MultiByteToWideChar(string(keyName));
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgCoordinateSystemLoadFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         if (verifyNotProtected)
@@ -491,7 +488,7 @@
             //If it already exists, make sure it's not protected.
             if ((bAlreadyExists) && (IsReallyProtected(sProtect)))
             {
-                throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
             }
         }
 
@@ -507,7 +504,7 @@
         {
         case -1:
             //Some sort of Mentor error occurred.
-            throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
             return;
         case 0:
             //The new object was added to the dictionary.
@@ -526,7 +523,7 @@
                 }
                 catch (std::bad_alloc)
                 {
-                    throw new MgOutOfMemoryException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
             }    //if summary is present
             break;
@@ -571,7 +568,7 @@
                     }
                     catch (std::bad_alloc)
                     {
-                        throw new MgOutOfMemoryException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }    //if the key name changed case
             }    //if a summary exists
@@ -579,7 +576,7 @@
         default:
             //This should never happen.
             assert(0);
-            throw new MgUnclassifiedException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
         }    //for each possible result of the update
     }
 
@@ -612,7 +609,7 @@
         char *pName = Convert_Wide_To_UTF8(kpName);    //need to delete [] pName;
         if (NULL == pName)
         {
-            throw new MgOutOfMemoryException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         //Check our summary first, if present
         CSystemNameDescriptionMap::iterator iter;
@@ -628,7 +625,7 @@
                 //there.  We can return failure without the
                 //overhead of searching the disk file.
                 delete [] pName;
-                throw new MgCoordinateSystemLoadFailedException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
             }
         }
         //Get def from disk file.  We need to do this even if
@@ -642,7 +639,7 @@
             STRING message = MgUtil::MultiByteToWideChar(string(pName));
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgCoordinateSystemLoadFailedException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemLoadFailedException, L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
         }
 
         //Make sure it's not protected
@@ -649,7 +646,7 @@
         if (IsReallyProtected(pDef->protect))
         {
             CS_free(pDef);
-            throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
         }
 
         //Go ahead and attempt to delete it
@@ -667,7 +664,7 @@
         else
         {
             //Failed.
-            throw new MgCoordinateSystemInitializationFailedException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+            throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
         }
     }
 

Modified: trunk/MgDev/Common/CoordinateSystem/MentorUtil.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/MentorUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/CoordinateSystem/MentorUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1439,7 +1439,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(sFileName);
-        throw new MgFileIoException(/*context */ L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, /*context */ L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
     }
 
     STRING fileNameSet;
@@ -1643,7 +1643,7 @@
 
     pString = Convert_UTF8_To_Wide(mentorString);
     if (NULL == pString) //ABA: this cannot be null, can it?
-        throw new MgOutOfMemoryException(L"MentorUtil.ReadString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorUtil.ReadString", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_CATCH(L"MentorUtil.ReadString")
 
@@ -1669,7 +1669,7 @@
     if (!IsLegalString(sSrc.c_str(), nMaxSize))
     {
         //Can't set string, caller gave us an illegal value
-        throw new MgInvalidArgumentException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Convert to a C++ string, for Mentor's sake
@@ -1676,7 +1676,7 @@
     pStr = Convert_Wide_To_UTF8(sSrc.c_str()); //need to delete[] pStr
     if (NULL == pStr)
     {
-        throw new MgOutOfMemoryException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MentorSetString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Copy it in

Modified: trunk/MgDev/Common/Foundation/Data/Byte.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/Byte.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/Byte.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
     CheckEnd();
     if (MgByte::Internal != m_allocType)
     {
-        throw new MgInvalidOperationException(L"MgByte.Append", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgByte.Append", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (len+m_len > m_allocLen)
@@ -159,7 +159,7 @@
     CheckEnd();
     if (len > m_allocLen)
     {
-        throw new MgArgumentOutOfRangeException(L"MgByte.SetLength",__LINE__,__WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgByte.SetLength",__LINE__,__WFILE__, NULL, L"", NULL);
     }
     m_len = len;
 }
@@ -176,7 +176,7 @@
     {
         if ( *((UINT64*)&m_bytes[m_allocLen]) != EndBytesMarker)
         {
-            throw new MgOverflowException(L"MgByte.CheckEnd",__LINE__,__WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOverflowException, L"MgByte.CheckEnd",__LINE__,__WFILE__, NULL, L"", NULL);
         }
     }
 }

Modified: trunk/MgDev/Common/Foundation/Data/ByteSink.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/ByteSink.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/ByteSink.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
         MgStringCollection arguments;
         arguments.Add(mimeType);
 
-        throw new MgInvalidMimeTypeException(L"MgByteSink.ToStringUtf8",
+        throw new MgException(MgExceptionCodes::MgInvalidMimeTypeException, L"MgByteSink.ToStringUtf8",
             __LINE__,__WFILE__, &arguments, L"", NULL);
     }
 
@@ -127,7 +127,7 @@
         if ((bytesSent = stream->send_n(bytes, bytesReceived, MG_MSG_NOSIGNAL)) != bytesReceived)
         {
             //should get the error from ACE and put it in the exception
-            throw new MgStreamIoException(L"MgByteSink.ToStream",
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgByteSink.ToStream",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -206,13 +206,13 @@
             if (errno == EEXIST)
             {
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileNotFoundException(L"MgByteSink.ToFile",
+                throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgByteSink.ToFile",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
             }
             else
             {
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgByteSink.ToFile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgByteSink.ToFile",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
             }
         }
@@ -247,7 +247,7 @@
                 MgStringCollection arguments;
                 arguments.Add(filename);
 
-                throw new MgFileIoException(L"MgByteSink.ToFile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgByteSink.ToFile",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
         }

Modified: trunk/MgDev/Common/Foundation/Data/ByteSource.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/ByteSource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/ByteSource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -40,7 +40,7 @@
 {
     if ((m_sourceImpl = new ByteSourceFileImpl(file)) == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgByteSource.MgByteSource",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgByteSource.MgByteSource",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -49,7 +49,7 @@
 {
     if ((m_sourceImpl = new ByteSourceFileImpl(file, temporary)) == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgByteSource.MgByteSource",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgByteSource.MgByteSource",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -69,7 +69,7 @@
 {
     if ((m_sourceImpl = new ByteSourceMemoryImpl(stream, length)) == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgByteSource.MgByteSource",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgByteSource.MgByteSource",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -141,7 +141,7 @@
 {
     if ((m_sourceImpl = new ByteSourceMemoryImpl(bytes)) == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgByteSource.MgByteSource",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgByteSource.MgByteSource",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/Foundation/Data/DateTime.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/DateTime.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/DateTime.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -170,7 +170,7 @@
         arguments.Add(L"1");
         arguments.Add(fdoDateTime);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.MgDateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.MgDateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFdoDateTime", NULL);
     }
 
@@ -223,7 +223,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.MgDateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.MgDateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidXmlDateTime", NULL);
     }
 
@@ -419,7 +419,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetDay",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetDay",
             __LINE__, __WFILE__, &arguments, L"MgInvalidDay", NULL);
     }
 
@@ -439,7 +439,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetMonth",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetMonth",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMonth", NULL);
     }
 
@@ -459,7 +459,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetYear",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetYear",
             __LINE__, __WFILE__, &arguments, L"MgInvalidYear", NULL);
     }
 
@@ -479,7 +479,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetHour",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetHour",
             __LINE__, __WFILE__, &arguments, L"MgInvalidHour", NULL);
     }
 
@@ -499,7 +499,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetMinute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetMinute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMinute", NULL);
     }
 
@@ -519,7 +519,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetSecond",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetSecond",
             __LINE__, __WFILE__, &arguments, L"MgInvalidSecond", NULL);
     }
 
@@ -539,7 +539,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.SetMicrosecond",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.SetMicrosecond",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMicroSecond", NULL);
     }
 
@@ -759,7 +759,7 @@
     }
     else
     {
-        throw new MgDateTimeException(L"MgDateTime.ToString",
+        throw new MgException(MgExceptionCodes::MgDateTimeException, L"MgDateTime.ToString",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -855,7 +855,7 @@
 
     if (timeValue < 0)
     {
-        throw new MgOutOfRangeException(L"MgDateTime.ToTimeValue",
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgDateTime.ToTimeValue",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1127,7 +1127,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateDate",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateDate",
             __LINE__, __WFILE__, &arguments, L"MgInvalidYear", NULL);
     }
 
@@ -1140,7 +1140,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateDate",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateDate",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMonth", NULL);
     }
 
@@ -1157,7 +1157,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateDate",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateDate",
             __LINE__, __WFILE__, &arguments, L"MgInvalidDay", NULL);
     }
 }
@@ -1173,7 +1173,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidHour", NULL);
     }
 
@@ -1186,7 +1186,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMinute", NULL);
     }
 
@@ -1199,7 +1199,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidSecond", NULL);
     }
 
@@ -1212,7 +1212,7 @@
         arguments.Add(L"4");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDateTime.ValidateTime",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDateTime.ValidateTime",
             __LINE__, __WFILE__, &arguments, L"MgInvalidMicroSecond", NULL);
     }
 }
@@ -1238,7 +1238,7 @@
     }
     else
     {
-        throw new MgDateTimeException(L"MgDateTime.Validate",
+        throw new MgException(MgExceptionCodes::MgDateTimeException, L"MgDateTime.Validate",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/Foundation/Data/NamedCollection.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/NamedCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/NamedCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -115,7 +115,7 @@
     {
         MgStringCollection args;
         args.Add(name);
-        throw new MgObjectNotFoundException(L"GetItem", __LINE__, __WFILE__, NULL, L"MgNoNameForObject", &args); // EXC::Create(Exception::NLSGetMessage(NLSID(38_ITEMNOTFOUND),name));
+        throw new MgException(MgExceptionCodes::MgObjectNotFoundException, L"GetItem", __LINE__, __WFILE__, NULL, L"MgNoNameForObject", &args); // EXC::Create(Exception::NLSGetMessage(NLSID(38_ITEMNOTFOUND),name));
     }
 
     return item;
@@ -387,7 +387,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgNamedCollection.IndexOf",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgNamedCollection.IndexOf",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL); // EXC::Create(Exception::NLSGetMessage(NLSID(2_BADPARAMETER)));
     }
 
@@ -418,7 +418,7 @@
 /// </returns>
 MgByteReader* MgNamedCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"MgNamedCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgNamedCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return NULL;
 }
@@ -498,7 +498,7 @@
         {
             MgStringCollection args;
             args.Add(item->GetName());
-            throw new MgDuplicateObjectException(L"CheckDuplicate", __LINE__, __WFILE__, NULL, L"MgDuplicateObject", &args); // EXC::Create(Exception::NLSGetMessage(NLSID(45_ITEMINCOLLECTION),(String*) item->GetName()));
+            throw new MgException(MgExceptionCodes::MgDuplicateObjectException, L"CheckDuplicate", __LINE__, __WFILE__, NULL, L"MgDuplicateObject", &args); // EXC::Create(Exception::NLSGetMessage(NLSID(45_ITEMINCOLLECTION),(String*) item->GetName()));
         }
     }
 }

Modified: trunk/MgDev/Common/Foundation/Data/NullableProperty.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/NullableProperty.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/NullableProperty.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
         MgStringCollection arguments;
         arguments.Add(this->GetName());
 
-        throw new MgNullPropertyValueException(L"MgNullableProperty.CheckNull",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgNullableProperty.CheckNull",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/Foundation/Data/Property.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/Property.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/Property.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgProperty.SetName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgProperty.SetName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/Foundation/Data/PropertyDefinition.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/PropertyDefinition.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/PropertyDefinition.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -51,7 +51,7 @@
 
     if (propType.empty())
     {
-        throw new MgInvalidPropertyTypeException(L"MgPropertyDefinition.MgPropertyDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgPropertyDefinition.MgPropertyDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     m_propertyType = type;

Modified: trunk/MgDev/Common/Foundation/Data/StringCollection.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Data/StringCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Data/StringCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -351,7 +351,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgIndexOutOfRangeException(L"MgStringCollection.ValidateIndex",
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgStringCollection.ValidateIndex",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooBig", NULL);
     }
     else if (index < 0)
@@ -363,7 +363,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgIndexOutOfRangeException(L"MgStringCollection.ValidateIndex",
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgStringCollection.ValidateIndex",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooSmall", NULL);
     }
 }

Deleted: trunk/MgDev/Common/Foundation/Exception/ApplicationException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ApplicationException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ApplicationException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_ABSTRACT(MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgApplicationException object.
-///
-MgApplicationException::MgApplicationException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgApplicationException::~MgApplicationException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ApplicationException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ApplicationException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ApplicationException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,74 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_APPLICATION_EXCEPTION_H_
-#define MG_APPLICATION_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Base class for all exceptions representing an application error.
-///
-/// \remarks
-/// This exception is not thrown directly.
-/// Instead an exception derived from it is used, such as
-/// MgConnectionFailedException.
-///
-class MG_FOUNDATION_API MgApplicationException : public MgException
-{
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgApplicationException object.
-    ///
-    virtual ~MgApplicationException() throw();
-
-protected:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgApplicationException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgApplicationException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_ABSTRACT(MgApplicationException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgApplicationException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgArgumentOutOfRangeException, MgOutOfRangeException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgArgumentOutOfRangeException object.
-///
-MgArgumentOutOfRangeException::MgArgumentOutOfRangeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgOutOfRangeException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgArgumentOutOfRangeException::~MgArgumentOutOfRangeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ArgumentOutOfRangeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_ARGUMENT_OUT_OF_RANGE_EXCEPTION_H_
-#define MG_ARGUMENT_OUT_OF_RANGE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when the value of an argument is
-/// outside the allowable range of values as defined by the invoked method.
-///
-class MG_FOUNDATION_API MgArgumentOutOfRangeException : public MgOutOfRangeException
-{
-    DECLARE_CLASSNAME(MgArgumentOutOfRangeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgArgumentOutOfRangeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgArgumentOutOfRangeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgArgumentOutOfRangeException object.
-    ///
-    virtual ~MgArgumentOutOfRangeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgArgumentOutOfRangeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgArgumentOutOfRangeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgClassNotFoundException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgClassNotFoundException object.
-///
-MgClassNotFoundException::MgClassNotFoundException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgClassNotFoundException::~MgClassNotFoundException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ClassNotFoundException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_CLASS_NOT_FOUND_EXCEPTION_H_
-#define MG_CLASS_NOT_FOUND_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to create an invalid class.
-///
-class MG_FOUNDATION_API MgClassNotFoundException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgClassNotFoundException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgClassNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgClassNotFoundException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgClassNotFoundException object.
-    ///
-    virtual ~MgClassNotFoundException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgClassNotFoundException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgClassNotFoundException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgConfigurationException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgConfigurationException object.
-///
-MgConfigurationException::MgConfigurationException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgConfigurationException::~MgConfigurationException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,72 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_CONFIGURATION_EXCEPTION_H_
-#define MG_CONFIGURATION_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-#include "Foundation.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs in a configuration file, possibly due to invalid parameters
-/// or a missing file.
-///
-class MG_FOUNDATION_API MgConfigurationException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgConfigurationException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgConfigurationException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgConfigurationException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgConfigurationException object.
-    ///
-    virtual ~MgConfigurationException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgConfigurationException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgConfigurationException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,49 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgConfigurationLoadFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgConfigurationLoadFailedException object.
-///
-MgConfigurationLoadFailedException::MgConfigurationLoadFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgConfigurationLoadFailedException::~MgConfigurationLoadFailedException() throw()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Retrieve the formatted exception message for the specified locale.
-///
-STRING MgConfigurationLoadFailedException::GetExceptionMessage(CREFSTRING locale) throw()
-{
-    return MgException::GetExceptionMessage(locale, MgResources::FailedToLoadConfigurationFile);
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationLoadFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,83 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_CONFIGURATION_LOAD_FAILED_EXCEPTION_H_
-#define MG_CONFIGURATION_LOAD_FAILED_EXCEPTION_H_
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a configuration file cannot be loaded.
-///
-class MG_FOUNDATION_API MgConfigurationLoadFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgConfigurationLoadFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgConfigurationLoadFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgConfigurationLoadFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgConfigurationLoadFailedException object.
-    ///
-    virtual ~MgConfigurationLoadFailedException() throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Retrieve the formatted exception message for the specified locale.
-    ///
-    /// \param locale
-    /// The locale identifier to format the details text.
-    /// Locale codes are 2 letters language codes defined by ISO 639-1.
-    /// Please refer to  http://www.loc.gov/standards/iso639-2/englangn.html
-    ///
-    /// \return
-    /// Formatted exception message
-    ///
-    virtual STRING GetExceptionMessage(CREFSTRING locale) throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgConfigurationLoadFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgConfigurationLoadFailedException;
-};
-/// \endcond
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgConfigurationSaveFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgConfigurationSaveFailedException object.
-///
-MgConfigurationSaveFailedException::MgConfigurationSaveFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgConfigurationSaveFailedException::~MgConfigurationSaveFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ConfigurationSaveFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_CONFIGURATION_SAVE_FAILED_EXCEPTION_H_
-#define MG_CONFIGURATION_SAVE_FAILED_EXCEPTION_H_
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a configuration file cannot be saved.
-///
-class MG_FOUNDATION_API MgConfigurationSaveFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgConfigurationSaveFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgConfigurationLoadFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgConfigurationSaveFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgConfigurationSaveFailedException object.
-    ///
-    virtual ~MgConfigurationSaveFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgConfigurationSaveFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgConfigurationSaveFailedException;
-};
-/// \endcond
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DateTimeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DateTimeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DateTimeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDateTimeException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDateTimeException object.
-///
-MgDateTimeException::MgDateTimeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgDateTimeException object.
-///
-MgDateTimeException::~MgDateTimeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DateTimeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DateTimeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DateTimeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_DATE_TIME_EXCEPTION_H_
-#define MG_DATE_TIME_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs in a date/time routine.
-///
-class MG_FOUNDATION_API MgDateTimeException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgDateTimeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDateTimeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDateTimeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgDateTimeException object.
-    ///
-    virtual ~MgDateTimeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDateTimeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDateTimeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DecryptionException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DecryptionException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DecryptionException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDecryptionException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDecryptionException object.
-///
-MgDecryptionException::MgDecryptionException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgDecryptionException object.
-///
-MgDecryptionException::~MgDecryptionException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DecryptionException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DecryptionException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DecryptionException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_DECRYPTION_EXCEPTION_H_
-#define MG_DECRYPTION_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a decryption error occurs.
-///
-class MG_FOUNDATION_API MgDecryptionException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgDecryptionException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDecryptionException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDecryptionException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgDecryptionException object.
-    ///
-    virtual ~MgDecryptionException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDecryptionException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDecryptionException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDirectoryNotFoundException, MgFileIoException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDirectoryNotFoundException object.
-///
-MgDirectoryNotFoundException::MgDirectoryNotFoundException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgFileIoException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgDirectoryNotFoundException::~MgDirectoryNotFoundException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DirectoryNotFoundException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_DIRECTORY_NOT_FOUND_EXCEPTION_H_
-#define MG_DIRECTORY_NOT_FOUND_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a directory cannot be found.
-///
-class MG_FOUNDATION_API MgDirectoryNotFoundException : public MgFileIoException
-{
-    DECLARE_CLASSNAME(MgDirectoryNotFoundException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDirectoryNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDirectoryNotFoundException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgDirectoryNotFoundException object.
-    ///
-    virtual ~MgDirectoryNotFoundException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDirectoryNotFoundException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDirectoryNotFoundException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDivideByZeroException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDivideByZeroException object.
-///
-MgDivideByZeroException::MgDivideByZeroException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgDivideByZeroException::~MgDivideByZeroException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DivideByZeroException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_DIVIDE_BY_ZERO_EXCEPTION_H_
-#define MG_DIVIDE_BY_ZERO_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when there is an attempt to divide an integral or decimal value by zero.
-///
-class MG_FOUNDATION_API MgDivideByZeroException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgDivideByZeroException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDivideByZeroException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDivideByZeroException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgDivideByZeroException object.
-    ///
-    virtual ~MgDivideByZeroException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDivideByZeroException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDivideByZeroException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DomainException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DomainException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DomainException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDomainException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDomainException object.
-///
-MgDomainException::MgDomainException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgDomainException::~MgDomainException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DomainException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DomainException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DomainException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,73 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_DOMAIN_EXCEPTION_H_
-#define MG_DOMAIN_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a value is used outside of its domain of definition.
-///
-/// \remarks
-/// For example, computing arccosine on a value whose absolute value is
-/// greater than one would raise a domain exception.
-///
-class MG_FOUNDATION_API MgDomainException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgDomainException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDomainException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDomainException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgDomainException object.
-    ///
-    virtual ~MgDomainException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDomainException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDomainException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDuplicateDirectoryException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDuplicateDirectoryException object.
-///
-MgDuplicateDirectoryException::MgDuplicateDirectoryException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgDuplicateDirectoryException object.
-///
-MgDuplicateDirectoryException::~MgDuplicateDirectoryException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateDirectoryException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_DUPLICATE_DIRECTORY_EXCEPTION_H_
-#define MG_DUPLICATE_DIRECTORY_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to create a directory that already exists.
-///
-class MG_FOUNDATION_API MgDuplicateDirectoryException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgDuplicateDirectoryException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDuplicateDirectoryException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDuplicateDirectoryException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgDuplicateDirectoryException object.
-    ///
-    virtual ~MgDuplicateDirectoryException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDuplicateDirectoryException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDuplicateDirectoryException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDuplicateFileException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDuplicateFileException object.
-///
-MgDuplicateFileException::MgDuplicateFileException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgDuplicateFileException object.
-///
-MgDuplicateFileException::~MgDuplicateFileException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateFileException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_DUPLICATE_FILE_EXCEPTION_H_
-#define MG_DUPLICATE_FILE_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to create a file that already exists.
-///
-class MG_FOUNDATION_API MgDuplicateFileException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgDuplicateFileException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDuplicateFileException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDuplicateFileException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgDuplicateFileException object.
-    ///
-    virtual ~MgDuplicateFileException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDuplicateFileException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDuplicateFileException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgDuplicateObjectException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgDuplicateNameException object.
-///
-MgDuplicateObjectException::MgDuplicateObjectException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgDuplicateObjectException::~MgDuplicateObjectException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/DuplicateObjectException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_DUPLICATE_OBJECT_EXCEPTION_H_
-#define MG_DUPLICATE_OBJECT_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a duplicate object is found.
-///
-class MG_FOUNDATION_API MgDuplicateObjectException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgDuplicateObjectException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgDuplicateObjectException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgDuplicateObjectException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgDuplicateObjectException object.
-    ///
-    virtual ~MgDuplicateObjectException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgDuplicateObjectException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgDuplicateObjectException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/EncryptionException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/EncryptionException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/EncryptionException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgEncryptionException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgEncryptionException object.
-///
-MgEncryptionException::MgEncryptionException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgEncryptionException object.
-///
-MgEncryptionException::~MgEncryptionException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/EncryptionException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/EncryptionException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/EncryptionException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_ENCRYPTION_EXCEPTION_H_
-#define MG_ENCRYPTION_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an encryption error is encountered.
-///
-class MG_FOUNDATION_API MgEncryptionException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgEncryptionException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgEncryptionException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgEncryptionException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgEncryptionException object.
-    ///
-    virtual ~MgEncryptionException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgEncryptionException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgEncryptionException;
-};
-
-#endif

Modified: trunk/MgDev/Common/Foundation/Exception/Exception.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -18,7 +18,7 @@
 #include "Foundation.h"
 
 
-IMPLEMENT_EXCEPTION_ABSTRACT(MgException)
+IMPLEMENT_EXCEPTION_DEFAULTS(MgException, _)
 
 MgException::LocaleCallbackFunc MgException::sm_localeCallbackFunc = NULL;
 
@@ -26,10 +26,12 @@
 /// \brief
 /// Construct a MgException.
 ///
-MgException::MgException(CREFSTRING methodName, INT32 lineNumber,
+MgException::MgException(CREFSTRING exceptionCode, CREFSTRING methodName, INT32 lineNumber,
     CREFSTRING fileName, MgStringCollection* whatArguments,
     CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    m_whyMessageId(whyMessageId)
+    m_whyMessageId(whyMessageId),
+    m_code(exceptionCode),
+    m_nativeErrorCode(0)
 {
     MG_TRY()
 
@@ -213,6 +215,9 @@
     stream->WriteString(m_message);
     stream->WriteString(m_details);
     stream->WriteString(m_stackTrace);
+
+    stream->WriteString(m_code);
+    stream->WriteInt64(m_nativeErrorCode);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -233,6 +238,9 @@
     stream->GetString(m_message);
     stream->GetString(m_details);
     stream->GetString(m_stackTrace);
+
+    stream->GetString(m_code);
+    stream->GetInt64(m_nativeErrorCode);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -491,7 +499,7 @@
     if (m_message.empty())
     {
         m_message = FormatMessage(locale, MgResources::Resource_Exception_Section,
-            GetClassName(), &m_whatArguments);
+            m_code, &m_whatArguments);
 
         if (!m_whyMessageId.empty())
         {
@@ -610,3 +618,105 @@
 {
     sm_localeCallbackFunc = func;
 }
+
+STRING MgException::GetExceptionCode()
+{
+    return m_code;
+}
+
+MgException* MgException::Create(exception& stdLibException, CREFSTRING methodName, INT32 lineNumber, CREFSTRING fileName) throw()
+{
+    // The following string conversion is used to detect whether or not
+    // the given error message is unicode compliant.
+    // Without this check, the server will not be able to serialize
+    // this exception object correctly.
+
+    STRING messageId;
+    MgStringCollection arguments;
+    bool unicodeCompliant = false;
+
+    MG_TRY()
+
+        STRING wcStr;
+
+        MgUtil::MultiByteToWideChar(stdLibException.what(), wcStr);
+        arguments.Add(wcStr);
+
+        unicodeCompliant = true;
+
+    MG_CATCH_AND_RELEASE()
+
+        if (unicodeCompliant)
+        {
+            messageId = L"MgFormatInnerExceptionMessage";
+        }
+        else
+        {
+            messageId = L"MgFailedToRetrieveSystemExceptionMesage";
+            arguments.Clear();
+        }
+
+    // Use typeid to determine the specific standard library exception type.
+    // An equivalent MgException* is returned.
+    // If typeid cannot determine the specific standard library exception type
+    // a new MgUnclassifiedException is returned.
+
+    if (typeid(stdLibException) == typeid(std::domain_error))
+    {
+        return new MgException(L"MgDomainException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::invalid_argument))
+    {
+        return new MgException(L"MgInvalidArgumentException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::length_error))
+    {
+        return new MgException(L"MgLengthException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::overflow_error))
+    {
+        return new MgException(L"MgOverflowException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::out_of_range)
+        || typeid(stdLibException) == typeid(std::range_error))
+    {
+        return new MgException(L"MgOutOfRangeException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::underflow_error))
+    {
+        return new MgException(L"MgUnderflowException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::bad_alloc))
+    {
+        return new MgException(L"MgOutOfMemoryException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::bad_cast))
+    {
+        return new MgException(L"MgInvalidCastException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::logic_error))
+    {
+        return new MgException(L"MgLogicException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else if (typeid(stdLibException) == typeid(std::bad_exception)
+        || typeid(stdLibException) == typeid(std::bad_typeid)
+        || typeid(stdLibException) == typeid(std::ios_base::failure)
+        || typeid(stdLibException) == typeid(std::runtime_error))
+    {
+        return new MgException(L"MgRuntimeException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+    else
+    {
+        return new MgException(L"MgUnclassifiedException", methodName, lineNumber, fileName, NULL, messageId, &arguments);
+    }
+}
+
+void MgException::SetNativeErrorCode(INT64 nativeErrorCode)
+{
+    m_nativeErrorCode = nativeErrorCode;
+}
+
+INT64 MgException::GetNativeErrorCode()
+{
+    return m_nativeErrorCode;
+}
\ No newline at end of file

Modified: trunk/MgDev/Common/Foundation/Exception/Exception.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/Exception.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/Exception.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -35,18 +35,40 @@
 
     ///////////////////////////////////////////////////////////////////////////
     /// \brief
+    /// Retrieve the exception code for this exception
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// string GetExceptionCode();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// String GetExceptionCode();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// string GetExceptionCode();
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \return
+    /// The exception code
+    ///
+    /// \since 4.0
+    ///
+    STRING GetExceptionCode();
+
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
     /// Retrieve the formatted exception message.  This is the localized and
     /// end user readable string.
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
-    /// string GetExceptionMessage() throw();
+    /// string GetExceptionMessage();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude JavaSyntaxTop.html
-    /// String GetExceptionMessage() throw();
+    /// String GetExceptionMessage();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude PHPSyntaxTop.html
-    /// string GetExceptionMessage() throw();
+    /// string GetExceptionMessage();
     /// \htmlinclude SyntaxBottom.html
     ///
     /// \return
@@ -67,13 +89,13 @@
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
-    /// string GetDetails() throw();
+    /// string GetDetails();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude JavaSyntaxTop.html
-    /// String GetDetails() throw();
+    /// String GetDetails();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude PHPSyntaxTop.html
-    /// string GetDetails() throw();
+    /// string GetDetails();
     /// \htmlinclude SyntaxBottom.html
     ///
     /// \return
@@ -90,13 +112,13 @@
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
-    /// string GetStackTrace() throw();
+    /// string GetStackTrace();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude JavaSyntaxTop.html
-    /// String GetStackTrace() throw();
+    /// String GetStackTrace();
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude PHPSyntaxTop.html
-    /// string GetStackTrace() throw();
+    /// string GetStackTrace();
     /// \htmlinclude SyntaxBottom.html
     ///
     /// \return
@@ -104,6 +126,29 @@
     ///
     STRING GetStackTrace() throw();
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Retrieve the native error code that may be set by errors from thirdparty
+    /// libraries
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// string GetNativeErrorCode();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// String GetNativeErrorCode();
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// string GetNativeErrorCode();
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \return
+    /// The native error code
+    ///
+    /// \since 4.0
+    ///
+    INT64 GetNativeErrorCode();
+
 EXTERNAL_API:
 
     ///////////////////////////////////////////////////////////////////////////
@@ -190,6 +235,21 @@
 
     ///////////////////////////////////////////////////////////////////////////
     /// \brief
+    /// Create a MgException from mapping a standard CPP exception to a MgException.
+    ///
+    static MgException* Create(std::exception& stdLibException, CREFSTRING methodName, INT32 lineNumber, CREFSTRING fileName) throw();
+
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Sets the native error code
+    /// 
+    /// \param nativeErrorCode
+    /// The native error code
+    ///
+    void SetNativeErrorCode(INT64 nativeErrorCode);
+
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
     /// Serialize data to TCP/IP stream.
     ///
     /// \param stream
@@ -210,27 +270,6 @@
 
     ///////////////////////////////////////////////////////////////////////////
     /// \brief
-    /// Construct the object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
     /// Dispose this object.
     ///
     /// \return
@@ -320,6 +359,9 @@
 
 protected:
 
+    /// The exception code
+    STRING m_code;
+
     /// Collection of method names which trace the stack leading up to the exception.
     MgStringCollection m_methodNames;
 
@@ -350,8 +392,34 @@
     /// The localized stack trace.
     STRING m_stackTrace;
 
+    /// The native error code
+    INT64 m_nativeErrorCode;
+
 INTERNAL_API:
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Construct the object.
+    ///
+    /// \param exceptionCode
+    /// The exception code
+    /// \param methodName
+    /// Name of the method where the exception occurred.
+    /// \param lineNumber
+    /// Line number where the exception occurred.
+    /// \param fileName
+    /// File name where the exception occurred.
+    /// \param whatArguments
+    /// Collection of arguments used to format the message that describes what the exception is.
+    /// \param whyMessageId
+    /// ID of the message that describes why the exception occurs.
+    /// \param whyArguments
+    /// Collection of arguments used to format the message that describes why the exception occurs.
+    ///
+    MgException(CREFSTRING exceptionCode, CREFSTRING methodName, INT32 lineNumber,
+        CREFSTRING fileName, MgStringCollection* whatArguments,
+        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
+
     typedef STRING (*LocaleCallbackFunc)();
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -361,13 +429,14 @@
     ///
     static void RegisterLocaleCallback(LocaleCallbackFunc func);
 
-
-    DECLARE_EXCEPTION_ABSTRACT(MgException)
-
 private:
 
     static LocaleCallbackFunc sm_localeCallbackFunc;
 
+INTERNAL_API:
+
+    DECLARE_EXCEPTION_DEFAULTS(MgException)
+
 CLASS_ID:
 
     static const INT32 m_cls_id = Foundation_Exception_MgException;

Copied: trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.cpp (from rev 9755, sandbox/jng/flatten_exceptions/Common/Foundation/Exception/ExceptionCodes.cpp)
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.cpp	                        (rev 0)
+++ trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -0,0 +1,173 @@
+//
+//  Copyright (C) 2004-2020 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "ExceptionCodes.h"
+
+/*
+For ease of regeneration in the future:
+
+ 1. Copy the [Exceptions] section of mapguide_en.res out to exceptions.txt
+ 2. In a bash-compatible shell, run:
+
+  cat exceptions.txt | awk '{print "static const STRING " $1 ";     ///\\if INTERNAL value(\"" $1 "\") \\endif" }' > cppdecls.txt
+  cat exceptions.txt | awk '{print "const STRING MgExceptionCodes::" $1 " = L\"" $1 "\";" }' > cppimpl.txt
+
+ 3. Copy/paste the contents of cppdecls.txt into the class body of MgExceptionCodes, replacing existing content
+ 4. Copy/paste the contents of cppimpl.txt into this file, replacing existing content
+*/
+
+const STRING MgExceptionCodes::MgAllProviderConnectionsUsedException = L"MgAllProviderConnectionsUsedException";
+const STRING MgExceptionCodes::MgArgumentOutOfRangeException = L"MgArgumentOutOfRangeException";
+const STRING MgExceptionCodes::MgArrayTypeMismatchException = L"MgArrayTypeMismatchException";
+const STRING MgExceptionCodes::MgAuthenticationFailedException = L"MgAuthenticationFailedException";
+const STRING MgExceptionCodes::MgClassNotFoundException = L"MgClassNotFoundException";
+const STRING MgExceptionCodes::MgConfigurationException = L"MgConfigurationException";
+const STRING MgExceptionCodes::MgConfigurationSaveFailedException = L"MgConfigurationSaveFailedException";
+const STRING MgExceptionCodes::MgConnectionFailedException = L"MgConnectionFailedException";
+const STRING MgExceptionCodes::MgConnectionNotOpenException = L"MgConnectionNotOpenException";
+const STRING MgExceptionCodes::MgCoordinateSystemComputationFailedException = L"MgCoordinateSystemComputationFailedException";
+const STRING MgExceptionCodes::MgCoordinateSystemConversionFailedException = L"MgCoordinateSystemConversionFailedException";
+const STRING MgExceptionCodes::MgCoordinateSystemInitializationFailedException = L"MgCoordinateSystemInitializationFailedException";
+const STRING MgExceptionCodes::MgCoordinateSystemLoadFailedException = L"MgCoordinateSystemLoadFailedException";
+const STRING MgExceptionCodes::MgCoordinateSystemMeasureFailedException = L"MgCoordinateSystemMeasureFailedException";
+const STRING MgExceptionCodes::MgCoordinateSystemTransformFailedException = L"MgCoordinateSystemTransformFailedException";
+const STRING MgExceptionCodes::MgDateTimeException = L"MgDateTimeException";
+const STRING MgExceptionCodes::MgDbException = L"MgDbException";
+const STRING MgExceptionCodes::MgDbXmlException = L"MgDbXmlException";
+const STRING MgExceptionCodes::MgDecryptionException = L"MgDecryptionException";
+const STRING MgExceptionCodes::MgDirectoryNotFoundException = L"MgDirectoryNotFoundException";
+const STRING MgExceptionCodes::MgDivideByZeroException = L"MgDivideByZeroException";
+const STRING MgExceptionCodes::MgDomainException = L"MgDomainException";
+const STRING MgExceptionCodes::MgDuplicateDirectoryException = L"MgDuplicateDirectoryException";
+const STRING MgExceptionCodes::MgDuplicateFileException = L"MgDuplicateFileException";
+const STRING MgExceptionCodes::MgDuplicateGroupException = L"MgDuplicateGroupException";
+const STRING MgExceptionCodes::MgDuplicateNameException = L"MgDuplicateNameException";
+const STRING MgExceptionCodes::MgDuplicateObjectException = L"MgDuplicateObjectException";
+const STRING MgExceptionCodes::MgDuplicateParameterException = L"MgDuplicateParameterException";
+const STRING MgExceptionCodes::MgDuplicateRepositoryException = L"MgDuplicateRepositoryException";
+const STRING MgExceptionCodes::MgDuplicateResourceDataException = L"MgDuplicateResourceDataException";
+const STRING MgExceptionCodes::MgDuplicateResourceException = L"MgDuplicateResourceException";
+const STRING MgExceptionCodes::MgDuplicateRoleException = L"MgDuplicateRoleException";
+const STRING MgExceptionCodes::MgDuplicateServerException = L"MgDuplicateServerException";
+const STRING MgExceptionCodes::MgDuplicateSessionException = L"MgDuplicateSessionException";
+const STRING MgExceptionCodes::MgDuplicateUserException = L"MgDuplicateUserException";
+const STRING MgExceptionCodes::MgDwfException = L"MgDwfException";
+const STRING MgExceptionCodes::MgDwfSectionNotFoundException = L"MgDwfSectionNotFoundException";
+const STRING MgExceptionCodes::MgDwfSectionResourceNotFoundException = L"MgDwfSectionResourceNotFoundException";
+const STRING MgExceptionCodes::MgEmptyFeatureSetException = L"MgEmptyFeatureSetException";
+const STRING MgExceptionCodes::MgEncryptionException = L"MgEncryptionException";
+const STRING MgExceptionCodes::MgEndOfStreamException = L"MgEndOfStreamException";
+const STRING MgExceptionCodes::MgEvaluationExpiredException = L"MgEvaluationExpiredException";
+const STRING MgExceptionCodes::MgFdoException = L"MgFdoException";
+const STRING MgExceptionCodes::MgFeatureServiceException = L"MgFeatureServiceException";
+const STRING MgExceptionCodes::MgFileIoException = L"MgFileIoException";
+const STRING MgExceptionCodes::MgFileNotFoundException = L"MgFileNotFoundException";
+const STRING MgExceptionCodes::MgGeometryException = L"MgGeometryException";
+const STRING MgExceptionCodes::MgGroupNotFoundException = L"MgGroupNotFoundException";
+const STRING MgExceptionCodes::MgIndexOutOfRangeException = L"MgIndexOutOfRangeException";
+const STRING MgExceptionCodes::MgInvalidArgumentException = L"MgInvalidArgumentException";
+const STRING MgExceptionCodes::MgInvalidCastException = L"MgInvalidCastException";
+const STRING MgExceptionCodes::MgInvalidCoordinateSystemException = L"MgInvalidCoordinateSystemException";
+const STRING MgExceptionCodes::MgInvalidCoordinateSystemTypeException = L"MgInvalidCoordinateSystemTypeException";
+const STRING MgExceptionCodes::MgInvalidCoordinateSystemUnitsException = L"MgInvalidCoordinateSystemUnitsException";
+const STRING MgExceptionCodes::MgInvalidDwfPackageException = L"MgInvalidDwfPackageException";
+const STRING MgExceptionCodes::MgInvalidDwfSectionException = L"MgInvalidDwfSectionException";
+const STRING MgExceptionCodes::MgInvalidFeatureSourceException = L"MgInvalidFeatureSourceException";
+const STRING MgExceptionCodes::MgInvalidIpAddressException = L"MgInvalidIpAddressException";
+const STRING MgExceptionCodes::MgInvalidLicenseException = L"MgInvalidLicenseException";
+const STRING MgExceptionCodes::MgInvalidLogEntryException = L"MgInvalidLogEntryException";
+const STRING MgExceptionCodes::MgInvalidMapDefinitionException = L"MgInvalidMapDefinitionException";
+const STRING MgExceptionCodes::MgInvalidMimeTypeException = L"MgInvalidMimeTypeException";
+const STRING MgExceptionCodes::MgInvalidOperationException = L"MgInvalidOperationException";
+const STRING MgExceptionCodes::MgInvalidOperationVersionException = L"MgInvalidOperationVersionException";
+const STRING MgExceptionCodes::MgInvalidPasswordException = L"MgInvalidPasswordException";
+const STRING MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException = L"MgInvalidPrintLayoutFontSizeUnitsException";
+const STRING MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException = L"MgInvalidPrintLayoutPositionUnitsException";
+const STRING MgExceptionCodes::MgInvalidPrintLayoutSizeUnitsException = L"MgInvalidPrintLayoutSizeUnitsException";
+const STRING MgExceptionCodes::MgInvalidPropertyTypeException = L"MgInvalidPropertyTypeException";
+const STRING MgExceptionCodes::MgInvalidRepositoryNameException = L"MgInvalidRepositoryNameException";
+const STRING MgExceptionCodes::MgInvalidRepositoryTypeException = L"MgInvalidRepositoryTypeException";
+const STRING MgExceptionCodes::MgInvalidResourceDataNameException = L"MgInvalidResourceDataNameException";
+const STRING MgExceptionCodes::MgInvalidResourceDataTypeException = L"MgInvalidResourceDataTypeException";
+const STRING MgExceptionCodes::MgInvalidResourceNameException = L"MgInvalidResourceNameException";
+const STRING MgExceptionCodes::MgInvalidResourcePathException = L"MgInvalidResourcePathException";
+const STRING MgExceptionCodes::MgInvalidResourcePreProcessingTypeException = L"MgInvalidResourcePreProcessingTypeException";
+const STRING MgExceptionCodes::MgInvalidResourceTypeException = L"MgInvalidResourceTypeException";
+const STRING MgExceptionCodes::MgInvalidServerNameException = L"MgInvalidServerNameException";
+const STRING MgExceptionCodes::MgInvalidSerialNumberException = L"MgInvalidSerialNumberException";
+const STRING MgExceptionCodes::MgInvalidStreamHeaderException = L"MgInvalidStreamHeaderException";
+const STRING MgExceptionCodes::MgIoException = L"MgIoException";
+const STRING MgExceptionCodes::MgLayerNotFoundException = L"MgLayerNotFoundException";
+const STRING MgExceptionCodes::MgLengthException = L"MgLengthException";
+const STRING MgExceptionCodes::MgLicenseException = L"MgLicenseException";
+const STRING MgExceptionCodes::MgLicenseExpiredException = L"MgLicenseExpiredException";
+const STRING MgExceptionCodes::MgLogicException = L"MgLogicException";
+const STRING MgExceptionCodes::MgLogOpenFailedException = L"MgLogOpenFailedException";
+const STRING MgExceptionCodes::MgNotFiniteNumberException = L"MgNotFiniteNumberException";
+const STRING MgExceptionCodes::MgNotImplementedException = L"MgNotImplementedException";
+const STRING MgExceptionCodes::MgNullArgumentException = L"MgNullArgumentException";
+const STRING MgExceptionCodes::MgNullPropertyValueException = L"MgNullPropertyValueException";
+const STRING MgExceptionCodes::MgNullReferenceException = L"MgNullReferenceException";
+const STRING MgExceptionCodes::MgObjectNotFoundException = L"MgObjectNotFoundException";
+const STRING MgExceptionCodes::MgOperationProcessingException = L"MgOperationProcessingException";
+const STRING MgExceptionCodes::MgOutOfMemoryException = L"MgOutOfMemoryException";
+const STRING MgExceptionCodes::MgOutOfRangeException = L"MgOutOfRangeException";
+const STRING MgExceptionCodes::MgOverflowException = L"MgOverflowException";
+const STRING MgExceptionCodes::MgParameterNotFoundException = L"MgParameterNotFoundException";
+const STRING MgExceptionCodes::MgPathTooLongException = L"MgPathTooLongException";
+const STRING MgExceptionCodes::MgPermissionDeniedException = L"MgPermissionDeniedException";
+const STRING MgExceptionCodes::MgPlatformNotSupportedException = L"MgPlatformNotSupportedException";
+const STRING MgExceptionCodes::MgPortNotAvailableException = L"MgPortNotAvailableException";
+const STRING MgExceptionCodes::MgPrintToScaleModeNotSelectedException = L"MgPrintToScaleModeNotSelectedException";
+const STRING MgExceptionCodes::MgRasterTransformationNotSupportedException = L"MgRasterTransformationNotSupportedException";
+const STRING MgExceptionCodes::MgRepositoryCreationFailedException = L"MgRepositoryCreationFailedException";
+const STRING MgExceptionCodes::MgRepositoryNotFoundException = L"MgRepositoryNotFoundException";
+const STRING MgExceptionCodes::MgRepositoryNotOpenException = L"MgRepositoryNotOpenException";
+const STRING MgExceptionCodes::MgRepositoryOpenFailedException = L"MgRepositoryOpenFailedException";
+const STRING MgExceptionCodes::MgResourceBusyException = L"MgResourceBusyException";
+const STRING MgExceptionCodes::MgResourceDataNotFoundException = L"MgResourceDataNotFoundException";
+const STRING MgExceptionCodes::MgResourceNotFoundException = L"MgResourceNotFoundException";
+const STRING MgExceptionCodes::MgResourcesException = L"MgResourcesException";
+const STRING MgExceptionCodes::MgResourceTagNotFoundException = L"MgResourceTagNotFoundException";
+const STRING MgExceptionCodes::MgRoleNotFoundException = L"MgRoleNotFoundException";
+const STRING MgExceptionCodes::MgRuntimeException = L"MgRuntimeException";
+const STRING MgExceptionCodes::MgServerNotFoundException = L"MgServerNotFoundException";
+const STRING MgExceptionCodes::MgServerNotOnlineException = L"MgServerNotOnlineException";
+const STRING MgExceptionCodes::MgServiceNotAvailableException = L"MgServiceNotAvailableException";
+const STRING MgExceptionCodes::MgServiceNotSupportedException = L"MgServiceNotSupportedException";
+const STRING MgExceptionCodes::MgSessionExpiredException = L"MgSessionExpiredException";
+const STRING MgExceptionCodes::MgSessionNotFoundException = L"MgSessionNotFoundException";
+const STRING MgExceptionCodes::MgStreamIoException = L"MgStreamIoException";
+const STRING MgExceptionCodes::MgStylizeLayerFailedException = L"MgStylizeLayerFailedException";
+const STRING MgExceptionCodes::MgTemporaryFileNotAvailableException = L"MgTemporaryFileNotAvailableException";
+const STRING MgExceptionCodes::MgUnauthorizedAccessException = L"MgUnauthorizedAccessException";
+const STRING MgExceptionCodes::MgUnclassifiedException = L"MgUnclassifiedException";
+const STRING MgExceptionCodes::MgUnderflowException = L"MgUnderflowException";
+const STRING MgExceptionCodes::MgUnknownTileProviderException = L"MgUnknownTileProviderException";
+const STRING MgExceptionCodes::MgUnsupportedProviderThreadModelException = L"MgUnsupportedProviderThreadModelException";
+const STRING MgExceptionCodes::MgUnsupportedTileProviderException = L"MgUnsupportedTileProviderException";
+const STRING MgExceptionCodes::MgUriFormatException = L"MgUriFormatException";
+const STRING MgExceptionCodes::MgUserNotFoundException = L"MgUserNotFoundException";
+const STRING MgExceptionCodes::MgXmlException = L"MgXmlException";
+const STRING MgExceptionCodes::MgXmlParserException = L"MgXmlParserException";
+
+// These codes aren't in mapguide_en.res
+const STRING MgExceptionCodes::MgConfigurationLoadFailedException = L"MgConfigurationLoadFailedException";
+const STRING MgExceptionCodes::MgResourcesLoadFailedException = L"MgResourcesLoadFailedException";
+const STRING MgExceptionCodes::MgGridDensityException = L"MgGridDensityException";
+const STRING MgExceptionCodes::MgInvalidLayerDefinitionException = L"MgInvalidLayerDefinitionException";
+const STRING MgExceptionCodes::MgInvalidWatermarkDefinitionException = L"MgInvalidWatermarkDefinitionException";
\ No newline at end of file

Copied: trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.h (from rev 9755, sandbox/jng/flatten_exceptions/Common/Foundation/Exception/ExceptionCodes.h)
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.h	                        (rev 0)
+++ trunk/MgDev/Common/Foundation/Exception/ExceptionCodes.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -0,0 +1,167 @@
+//
+//  Copyright (C) 2004-2020 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef _MG_EXCEPTION_CODES_H
+#define _MG_EXCEPTION_CODES_H
+
+class MG_FOUNDATION_API MgExceptionCodes
+{
+PUBLISHED_API:
+    static const STRING MgAllProviderConnectionsUsedException;     ///\if INTERNAL value("MgAllProviderConnectionsUsedException") \endif
+    static const STRING MgArgumentOutOfRangeException;     ///\if INTERNAL value("MgArgumentOutOfRangeException") \endif
+    static const STRING MgArrayTypeMismatchException;     ///\if INTERNAL value("MgArrayTypeMismatchException") \endif
+    static const STRING MgAuthenticationFailedException;     ///\if INTERNAL value("MgAuthenticationFailedException") \endif
+    static const STRING MgClassNotFoundException;     ///\if INTERNAL value("MgClassNotFoundException") \endif
+    static const STRING MgConfigurationException;     ///\if INTERNAL value("MgConfigurationException") \endif
+    static const STRING MgConfigurationSaveFailedException;     ///\if INTERNAL value("MgConfigurationSaveFailedException") \endif
+    static const STRING MgConnectionFailedException;     ///\if INTERNAL value("MgConnectionFailedException") \endif
+    static const STRING MgConnectionNotOpenException;     ///\if INTERNAL value("MgConnectionNotOpenException") \endif
+    static const STRING MgCoordinateSystemComputationFailedException;     ///\if INTERNAL value("MgCoordinateSystemComputationFailedException") \endif
+    static const STRING MgCoordinateSystemConversionFailedException;     ///\if INTERNAL value("MgCoordinateSystemConversionFailedException") \endif
+    static const STRING MgCoordinateSystemInitializationFailedException;     ///\if INTERNAL value("MgCoordinateSystemInitializationFailedException") \endif
+    static const STRING MgCoordinateSystemLoadFailedException;     ///\if INTERNAL value("MgCoordinateSystemLoadFailedException") \endif
+    static const STRING MgCoordinateSystemMeasureFailedException;     ///\if INTERNAL value("MgCoordinateSystemMeasureFailedException") \endif
+    static const STRING MgCoordinateSystemTransformFailedException;     ///\if INTERNAL value("MgCoordinateSystemTransformFailedException") \endif
+    static const STRING MgDateTimeException;     ///\if INTERNAL value("MgDateTimeException") \endif
+    static const STRING MgDbException;     ///\if INTERNAL value("MgDbException") \endif
+    static const STRING MgDbXmlException;     ///\if INTERNAL value("MgDbXmlException") \endif
+    static const STRING MgDecryptionException;     ///\if INTERNAL value("MgDecryptionException") \endif
+    static const STRING MgDirectoryNotFoundException;     ///\if INTERNAL value("MgDirectoryNotFoundException") \endif
+    static const STRING MgDivideByZeroException;     ///\if INTERNAL value("MgDivideByZeroException") \endif
+    static const STRING MgDomainException;     ///\if INTERNAL value("MgDomainException") \endif
+    static const STRING MgDuplicateDirectoryException;     ///\if INTERNAL value("MgDuplicateDirectoryException") \endif
+    static const STRING MgDuplicateFileException;     ///\if INTERNAL value("MgDuplicateFileException") \endif
+    static const STRING MgDuplicateGroupException;     ///\if INTERNAL value("MgDuplicateGroupException") \endif
+    static const STRING MgDuplicateNameException;     ///\if INTERNAL value("MgDuplicateNameException") \endif
+    static const STRING MgDuplicateObjectException;     ///\if INTERNAL value("MgDuplicateObjectException") \endif
+    static const STRING MgDuplicateParameterException;     ///\if INTERNAL value("MgDuplicateParameterException") \endif
+    static const STRING MgDuplicateRepositoryException;     ///\if INTERNAL value("MgDuplicateRepositoryException") \endif
+    static const STRING MgDuplicateResourceDataException;     ///\if INTERNAL value("MgDuplicateResourceDataException") \endif
+    static const STRING MgDuplicateResourceException;     ///\if INTERNAL value("MgDuplicateResourceException") \endif
+    static const STRING MgDuplicateRoleException;     ///\if INTERNAL value("MgDuplicateRoleException") \endif
+    static const STRING MgDuplicateServerException;     ///\if INTERNAL value("MgDuplicateServerException") \endif
+    static const STRING MgDuplicateSessionException;     ///\if INTERNAL value("MgDuplicateSessionException") \endif
+    static const STRING MgDuplicateUserException;     ///\if INTERNAL value("MgDuplicateUserException") \endif
+    static const STRING MgDwfException;     ///\if INTERNAL value("MgDwfException") \endif
+    static const STRING MgDwfSectionNotFoundException;     ///\if INTERNAL value("MgDwfSectionNotFoundException") \endif
+    static const STRING MgDwfSectionResourceNotFoundException;     ///\if INTERNAL value("MgDwfSectionResourceNotFoundException") \endif
+    static const STRING MgEmptyFeatureSetException;     ///\if INTERNAL value("MgEmptyFeatureSetException") \endif
+    static const STRING MgEncryptionException;     ///\if INTERNAL value("MgEncryptionException") \endif
+    static const STRING MgEndOfStreamException;     ///\if INTERNAL value("MgEndOfStreamException") \endif
+    static const STRING MgEvaluationExpiredException;     ///\if INTERNAL value("MgEvaluationExpiredException") \endif
+    static const STRING MgFdoException;     ///\if INTERNAL value("MgFdoException") \endif
+    static const STRING MgFeatureServiceException;     ///\if INTERNAL value("MgFeatureServiceException") \endif
+    static const STRING MgFileIoException;     ///\if INTERNAL value("MgFileIoException") \endif
+    static const STRING MgFileNotFoundException;     ///\if INTERNAL value("MgFileNotFoundException") \endif
+    static const STRING MgGeometryException;     ///\if INTERNAL value("MgGeometryException") \endif
+    static const STRING MgGroupNotFoundException;     ///\if INTERNAL value("MgGroupNotFoundException") \endif
+    static const STRING MgIndexOutOfRangeException;     ///\if INTERNAL value("MgIndexOutOfRangeException") \endif
+    static const STRING MgInvalidArgumentException;     ///\if INTERNAL value("MgInvalidArgumentException") \endif
+    static const STRING MgInvalidCastException;     ///\if INTERNAL value("MgInvalidCastException") \endif
+    static const STRING MgInvalidCoordinateSystemException;     ///\if INTERNAL value("MgInvalidCoordinateSystemException") \endif
+    static const STRING MgInvalidCoordinateSystemTypeException;     ///\if INTERNAL value("MgInvalidCoordinateSystemTypeException") \endif
+    static const STRING MgInvalidCoordinateSystemUnitsException;     ///\if INTERNAL value("MgInvalidCoordinateSystemUnitsException") \endif
+    static const STRING MgInvalidDwfPackageException;     ///\if INTERNAL value("MgInvalidDwfPackageException") \endif
+    static const STRING MgInvalidDwfSectionException;     ///\if INTERNAL value("MgInvalidDwfSectionException") \endif
+    static const STRING MgInvalidFeatureSourceException;     ///\if INTERNAL value("MgInvalidFeatureSourceException") \endif
+    static const STRING MgInvalidIpAddressException;     ///\if INTERNAL value("MgInvalidIpAddressException") \endif
+    static const STRING MgInvalidLicenseException;     ///\if INTERNAL value("MgInvalidLicenseException") \endif
+    static const STRING MgInvalidLogEntryException;     ///\if INTERNAL value("MgInvalidLogEntryException") \endif
+    static const STRING MgInvalidMapDefinitionException;     ///\if INTERNAL value("MgInvalidMapDefinitionException") \endif
+    static const STRING MgInvalidMimeTypeException;     ///\if INTERNAL value("MgInvalidMimeTypeException") \endif
+    static const STRING MgInvalidOperationException;     ///\if INTERNAL value("MgInvalidOperationException") \endif
+    static const STRING MgInvalidOperationVersionException;     ///\if INTERNAL value("MgInvalidOperationVersionException") \endif
+    static const STRING MgInvalidPasswordException;     ///\if INTERNAL value("MgInvalidPasswordException") \endif
+    static const STRING MgInvalidPrintLayoutFontSizeUnitsException;     ///\if INTERNAL value("MgInvalidPrintLayoutFontSizeUnitsException") \endif
+    static const STRING MgInvalidPrintLayoutPositionUnitsException;     ///\if INTERNAL value("MgInvalidPrintLayoutPositionUnitsException") \endif
+    static const STRING MgInvalidPrintLayoutSizeUnitsException;     ///\if INTERNAL value("MgInvalidPrintLayoutSizeUnitsException") \endif
+    static const STRING MgInvalidPropertyTypeException;     ///\if INTERNAL value("MgInvalidPropertyTypeException") \endif
+    static const STRING MgInvalidRepositoryNameException;     ///\if INTERNAL value("MgInvalidRepositoryNameException") \endif
+    static const STRING MgInvalidRepositoryTypeException;     ///\if INTERNAL value("MgInvalidRepositoryTypeException") \endif
+    static const STRING MgInvalidResourceDataNameException;     ///\if INTERNAL value("MgInvalidResourceDataNameException") \endif
+    static const STRING MgInvalidResourceDataTypeException;     ///\if INTERNAL value("MgInvalidResourceDataTypeException") \endif
+    static const STRING MgInvalidResourceNameException;     ///\if INTERNAL value("MgInvalidResourceNameException") \endif
+    static const STRING MgInvalidResourcePathException;     ///\if INTERNAL value("MgInvalidResourcePathException") \endif
+    static const STRING MgInvalidResourcePreProcessingTypeException;     ///\if INTERNAL value("MgInvalidResourcePreProcessingTypeException") \endif
+    static const STRING MgInvalidResourceTypeException;     ///\if INTERNAL value("MgInvalidResourceTypeException") \endif
+    static const STRING MgInvalidServerNameException;     ///\if INTERNAL value("MgInvalidServerNameException") \endif
+    static const STRING MgInvalidSerialNumberException;     ///\if INTERNAL value("MgInvalidSerialNumberException") \endif
+    static const STRING MgInvalidStreamHeaderException;     ///\if INTERNAL value("MgInvalidStreamHeaderException") \endif
+    static const STRING MgIoException;     ///\if INTERNAL value("MgIoException") \endif
+    static const STRING MgLayerNotFoundException;     ///\if INTERNAL value("MgLayerNotFoundException") \endif
+    static const STRING MgLengthException;     ///\if INTERNAL value("MgLengthException") \endif
+    static const STRING MgLicenseException;     ///\if INTERNAL value("MgLicenseException") \endif
+    static const STRING MgLicenseExpiredException;     ///\if INTERNAL value("MgLicenseExpiredException") \endif
+    static const STRING MgLogicException;     ///\if INTERNAL value("MgLogicException") \endif
+    static const STRING MgLogOpenFailedException;     ///\if INTERNAL value("MgLogOpenFailedException") \endif
+    static const STRING MgNotFiniteNumberException;     ///\if INTERNAL value("MgNotFiniteNumberException") \endif
+    static const STRING MgNotImplementedException;     ///\if INTERNAL value("MgNotImplementedException") \endif
+    static const STRING MgNullArgumentException;     ///\if INTERNAL value("MgNullArgumentException") \endif
+    static const STRING MgNullPropertyValueException;     ///\if INTERNAL value("MgNullPropertyValueException") \endif
+    static const STRING MgNullReferenceException;     ///\if INTERNAL value("MgNullReferenceException") \endif
+    static const STRING MgObjectNotFoundException;     ///\if INTERNAL value("MgObjectNotFoundException") \endif
+    static const STRING MgOperationProcessingException;     ///\if INTERNAL value("MgOperationProcessingException") \endif
+    static const STRING MgOutOfMemoryException;     ///\if INTERNAL value("MgOutOfMemoryException") \endif
+    static const STRING MgOutOfRangeException;     ///\if INTERNAL value("MgOutOfRangeException") \endif
+    static const STRING MgOverflowException;     ///\if INTERNAL value("MgOverflowException") \endif
+    static const STRING MgParameterNotFoundException;     ///\if INTERNAL value("MgParameterNotFoundException") \endif
+    static const STRING MgPathTooLongException;     ///\if INTERNAL value("MgPathTooLongException") \endif
+    static const STRING MgPermissionDeniedException;     ///\if INTERNAL value("MgPermissionDeniedException") \endif
+    static const STRING MgPlatformNotSupportedException;     ///\if INTERNAL value("MgPlatformNotSupportedException") \endif
+    static const STRING MgPortNotAvailableException;     ///\if INTERNAL value("MgPortNotAvailableException") \endif
+    static const STRING MgPrintToScaleModeNotSelectedException;     ///\if INTERNAL value("MgPrintToScaleModeNotSelectedException") \endif
+    static const STRING MgRasterTransformationNotSupportedException;     ///\if INTERNAL value("MgRasterTransformationNotSupportedException") \endif
+    static const STRING MgRepositoryCreationFailedException;     ///\if INTERNAL value("MgRepositoryCreationFailedException") \endif
+    static const STRING MgRepositoryNotFoundException;     ///\if INTERNAL value("MgRepositoryNotFoundException") \endif
+    static const STRING MgRepositoryNotOpenException;     ///\if INTERNAL value("MgRepositoryNotOpenException") \endif
+    static const STRING MgRepositoryOpenFailedException;     ///\if INTERNAL value("MgRepositoryOpenFailedException") \endif
+    static const STRING MgResourceBusyException;     ///\if INTERNAL value("MgResourceBusyException") \endif
+    static const STRING MgResourceDataNotFoundException;     ///\if INTERNAL value("MgResourceDataNotFoundException") \endif
+    static const STRING MgResourceNotFoundException;     ///\if INTERNAL value("MgResourceNotFoundException") \endif
+    static const STRING MgResourcesException;     ///\if INTERNAL value("MgResourcesException") \endif
+    static const STRING MgResourceTagNotFoundException;     ///\if INTERNAL value("MgResourceTagNotFoundException") \endif
+    static const STRING MgRoleNotFoundException;     ///\if INTERNAL value("MgRoleNotFoundException") \endif
+    static const STRING MgRuntimeException;     ///\if INTERNAL value("MgRuntimeException") \endif
+    static const STRING MgServerNotFoundException;     ///\if INTERNAL value("MgServerNotFoundException") \endif
+    static const STRING MgServerNotOnlineException;     ///\if INTERNAL value("MgServerNotOnlineException") \endif
+    static const STRING MgServiceNotAvailableException;     ///\if INTERNAL value("MgServiceNotAvailableException") \endif
+    static const STRING MgServiceNotSupportedException;     ///\if INTERNAL value("MgServiceNotSupportedException") \endif
+    static const STRING MgSessionExpiredException;     ///\if INTERNAL value("MgSessionExpiredException") \endif
+    static const STRING MgSessionNotFoundException;     ///\if INTERNAL value("MgSessionNotFoundException") \endif
+    static const STRING MgStreamIoException;     ///\if INTERNAL value("MgStreamIoException") \endif
+    static const STRING MgStylizeLayerFailedException;     ///\if INTERNAL value("MgStylizeLayerFailedException") \endif
+    static const STRING MgTemporaryFileNotAvailableException;     ///\if INTERNAL value("MgTemporaryFileNotAvailableException") \endif
+    static const STRING MgUnauthorizedAccessException;     ///\if INTERNAL value("MgUnauthorizedAccessException") \endif
+    static const STRING MgUnclassifiedException;     ///\if INTERNAL value("MgUnclassifiedException") \endif
+    static const STRING MgUnderflowException;     ///\if INTERNAL value("MgUnderflowException") \endif
+    static const STRING MgUnknownTileProviderException;     ///\if INTERNAL value("MgUnknownTileProviderException") \endif
+    static const STRING MgUnsupportedProviderThreadModelException;     ///\if INTERNAL value("MgUnsupportedProviderThreadModelException") \endif
+    static const STRING MgUnsupportedTileProviderException;     ///\if INTERNAL value("MgUnsupportedTileProviderException") \endif
+    static const STRING MgUriFormatException;     ///\if INTERNAL value("MgUriFormatException") \endif
+    static const STRING MgUserNotFoundException;     ///\if INTERNAL value("MgUserNotFoundException") \endif
+    static const STRING MgXmlException;     ///\if INTERNAL value("MgXmlException") \endif
+    static const STRING MgXmlParserException;     ///\if INTERNAL value("MgXmlParserException") \endif
+
+    // These codes aren't in mapguide_en.res
+    static const STRING MgConfigurationLoadFailedException;    ///\if INTERNAL value("MgConfigurationLoadFailedException") \endif
+    static const STRING MgResourcesLoadFailedException;    ///\if INTERNAL value("MgResourcesLoadFailedException") \endif
+    static const STRING MgGridDensityException;    ///\if INTERNAL value("MgGridDensityException") \endif
+    static const STRING MgInvalidLayerDefinitionException;    ///\if INTERNAL value("MgInvalidLayerDefinitionException") \endif
+    static const STRING MgInvalidWatermarkDefinitionException;    ///\if INTERNAL value("MgInvalidWatermarkDefinitionException") \endif
+};
+
+#endif
\ No newline at end of file

Modified: trunk/MgDev/Common/Foundation/Exception/ExceptionDefs.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ExceptionDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ExceptionDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -18,6 +18,10 @@
 #ifndef MG_EXCEPTION_DEFS_H_
 #define MG_EXCEPTION_DEFS_H_
 
+// SEH macros go away!
+#if defined(GetExceptionCode)
+#undef GetExceptionCode
+#endif
 
 #define DECLARE_EXCEPTION_ABSTRACT(className) \
     virtual INT32 GetClassId(); \
@@ -62,11 +66,11 @@
     }                                                                         \
     catch (exception& e)                                                      \
     {                                                                         \
-        mgException = MgSystemException::Create(e, methodName, __LINE__, __WFILE__); \
+        mgException = MgException::Create(e, methodName, __LINE__, __WFILE__); \
     }                                                                         \
     catch (...)                                                               \
     {                                                                         \
-        mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+        mgException = new MgException(L"MgUnclassifiedException", methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
     }                                                                         \
 
 #define MG_THROW()                                                            \
@@ -91,4 +95,26 @@
     {                                                                         \
     }                                                                         \
 
+#define MG_CATCH_IF_TYPE(extype)                                              \
+    catch (MgException* ex)                                                   \
+    {                                                                         \
+        if (ex->GetExceptionCode() == MgExceptionCodes::extype)               \
+        {                                                                     \
+
+#define MG_CATCH_IF_TYPE_ELSE()                                               \
+        }                                                                     \
+        else                                                                  \
+        {                                                                     \
+            ex->Raise();                                                      \
+
+#define MG_CATCH_ENDIF_TYPE()                                                 \
+        }                                                                     \
+    }                                                                         \
+
+#define MG_CATCH_AND_RELEASE_IF_TYPE(extype) \
+    MG_CATCH_IF_TYPE(extype) \
+        ex->Release(); \
+    MG_CATCH_IF_TYPE_ELSE() \
+    MG_CATCH_ENDIF_TYPE() \
+
 #endif

Deleted: trunk/MgDev/Common/Foundation/Exception/FileIoException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/FileIoException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/FileIoException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgFileIoException, MgIoException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgFileIoException object.
-///
-MgFileIoException::MgFileIoException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgIoException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgFileIoException::~MgFileIoException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/FileIoException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/FileIoException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/FileIoException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_FILE_IO_EXCEPTION_H_
-#define MG_FILE_IO_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a file I/O error occurs.
-///
-class MG_FOUNDATION_API MgFileIoException : public MgIoException
-{
-    DECLARE_CLASSNAME(MgFileIoException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgFileIoException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgFileIoException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgFileIoException object.
-    ///
-    virtual ~MgFileIoException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgFileIoException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgFileIoException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgFileNotFoundException, MgFileIoException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgFileNotFoundException object.
-///
-MgFileNotFoundException::MgFileNotFoundException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgFileIoException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgFileNotFoundException::~MgFileNotFoundException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/FileNotFoundException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_FILE_NOT_FOUND_EXCEPTION_H_
-#define MG_FILE_NOT_FOUND_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to access a file that cannot be found.
-///
-class MG_FOUNDATION_API MgFileNotFoundException : public MgFileIoException
-{
-    DECLARE_CLASSNAME(MgFileNotFoundException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgFileNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgFileNotFoundException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgFileNotFoundException object.
-    ///
-    virtual ~MgFileNotFoundException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgFileNotFoundException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgFileNotFoundException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/GridDensityException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/GridDensityException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/GridDensityException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgGridDensityException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgGridDensityException object.
-///
-MgGridDensityException::MgGridDensityException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgGridDensityException object.
-///
-MgGridDensityException::~MgGridDensityException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/GridDensityException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/GridDensityException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/GridDensityException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_GRID_DENSITY_EXCEPTION_H_
-#define MG_GRID_DENSITY_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs in a date/time routine.
-///
-class MG_FOUNDATION_API MgGridDensityException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgGridDensityException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgGridDensityException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgGridDensityException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgGridDensityException object.
-    ///
-    virtual ~MgGridDensityException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgGridDensityException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgGridDensityException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgIndexOutOfRangeException, MgOutOfRangeException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgIndexOutOfRangeException object.
-///
-MgIndexOutOfRangeException::MgIndexOutOfRangeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgOutOfRangeException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgIndexOutOfRangeException::~MgIndexOutOfRangeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/IndexOutOfRangeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,71 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INDEX_OUT_OF_RANGE_EXCEPTION_H_
-#define MG_INDEX_OUT_OF_RANGE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to
-/// access an element of an array with an index that is
-/// outside the bounds of the array.
-///
-class MG_FOUNDATION_API MgIndexOutOfRangeException : public MgOutOfRangeException
-{
-    DECLARE_CLASSNAME(MgIndexOutOfRangeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgIndexOutOfRangeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgIndexOutOfRangeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgIndexOutOfRangeException object.
-    ///
-    virtual ~MgIndexOutOfRangeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgIndexOutOfRangeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgIndexOutOfRangeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,101 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidArgumentException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidArgumentException object.
-///
-MgInvalidArgumentException::MgInvalidArgumentException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidArgumentException::~MgInvalidArgumentException() throw()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-///<summary>
-/// Retrieve the formatted exception message for the specified locale.
-/// <param name="nLocale">The locale identifier to format the message text.</param>
-///
-///
-STRING MgInvalidArgumentException::GetExceptionMessage(CREFSTRING locale) throw()
-{
-    //
-    // Format:
-    //
-    //  { Description on WHAT the exception is }
-    //  [ Reason on WHY the exception occurs ]
-    //
-    // Example:
-    //
-    //  Invalid argument(s):
-    //      [1] = 2005-12-08T15:30
-    //  The XML date time is invalid because not all of the fields were found.
-    //
-
-    MG_TRY()
-
-    // Note that for any empty string argument, MgResources::BlankArgument
-    // must be used to prevent MgProperty::SetName (via MgStringCollection::Add)
-    // from infinitely throwing the MgInvalidArgumentException.
-
-    if (m_message.empty())
-    {
-        m_message = FormatMessage(locale, MgResources::Resource_Exception_Section,
-            GetClassName(), NULL);
-
-        const INT32 numArgsPerLine = 2;
-        const INT32 size = m_whatArguments.GetCount();
-        assert(0 == (size % numArgsPerLine));
-
-        for (INT32 i = 1; i < size; i += numArgsPerLine)
-        {
-            STRING argIndex = m_whatArguments.GetItem(i-1);
-            STRING argValue = m_whatArguments.GetItem(i);
-
-            m_message += L"\n\t[";
-            m_message += argIndex;
-            m_message += L"] = \"";
-            m_message += argValue;
-            m_message += L"\"";
-        }
-
-        if (!m_whyMessageId.empty())
-        {
-            m_message += L"\n";
-            m_message += FormatMessage(locale, MgResources::ErrorDescription,
-                m_whyMessageId, &m_whyArguments);
-        }
-    }
-
-    MG_CATCH_AND_RELEASE()
-
-    return m_message;
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidArgumentException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,83 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_ARGUMENT_EXCEPTION_H_
-#define MG_INVALID_ARGUMENT_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-////////////////////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a method is called with an invalid argument.
-///
-class MG_FOUNDATION_API MgInvalidArgumentException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgInvalidArgumentException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidArgumentException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidArgumentException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidArgumentException object.
-    ///
-    virtual ~MgInvalidArgumentException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidArgumentException)
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Retrieve the formatted exception message for the specified locale.
-    ///
-    /// \param locale
-    /// The locale identifier to format the details text.
-    /// Locale codes are 2 letters language codes defined by ISO 639-1.
-    /// Please refer to  http://www.loc.gov/standards/iso639-2/englangn.html
-    ///
-    /// \return
-    /// Formatted exception message
-    ///
-    virtual STRING GetExceptionMessage(CREFSTRING locale) throw();
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidArgumentException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidCastException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidCastException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidCastException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidCastException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidCastException object.
-///
-MgInvalidCastException::MgInvalidCastException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidCastException::~MgInvalidCastException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidCastException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidCastException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidCastException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_CAST_EXCEPTION_H_
-#define MG_INVALID_CAST_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting an invalid type cast or explicit conversion.
-///
-class MG_FOUNDATION_API MgInvalidCastException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgInvalidCastException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidCastException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidCastException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidCastException object.
-    ///
-    virtual ~MgInvalidCastException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidCastException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidCastException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidMimeTypeException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidMimeTypeException object.
-///
-MgInvalidMimeTypeException::MgInvalidMimeTypeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgInvalidMimeTypeException object.
-///
-MgInvalidMimeTypeException::~MgInvalidMimeTypeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidMimeTypeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MGINVALIDMIMETYPEEXCEPTION_H_
-#define MGINVALIDMIMETYPEEXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an invalid mime type is detected.
-///
-class MG_FOUNDATION_API MgInvalidMimeTypeException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgInvalidMimeTypeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidMimeTypeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidMimeTypeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgInvalidMimeTypeException object.
-    ///
-    virtual ~MgInvalidMimeTypeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidMimeTypeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidMimeTypeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidOperationException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidOperationException object.
-///
-MgInvalidOperationException::MgInvalidOperationException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidOperationException::~MgInvalidOperationException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidOperationException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_OPERATION_EXCEPTION_H_
-#define MG_INVALID_OPERATION_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a method call is invalid for the object's current state.
-///
-class MG_FOUNDATION_API MgInvalidOperationException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgInvalidOperationException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidOperationException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidOperationException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidOperationException object.
-    ///
-    virtual ~MgInvalidOperationException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidOperationException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidOperationException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidPropertyTypeException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidPropertyTypeException object.
-///
-MgInvalidPropertyTypeException::MgInvalidPropertyTypeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidPropertyTypeException::~MgInvalidPropertyTypeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidPropertyTypeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_PROPERTY_TYPE_EXCEPTION_H_
-#define MG_INVALID_PROPERTY_TYPE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an invalid property type is used.
-///
-class MG_FOUNDATION_API MgInvalidPropertyTypeException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgInvalidPropertyTypeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidPropertyTypeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidPropertyTypeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidPropertyTypeException object.
-    ///
-    virtual ~MgInvalidPropertyTypeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidPropertyTypeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidPropertyTypeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidStreamHeaderException, MgStreamIoException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidStreamHeaderException object.
-///
-MgInvalidStreamHeaderException::MgInvalidStreamHeaderException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgStreamIoException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidStreamHeaderException::~MgInvalidStreamHeaderException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/InvalidStreamHeaderException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_STREAM_HEADER_EXCEPTION_H_
-#define MG_INVALID_STREAM_HEADER_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a stream header is invalid.
-///
-class MG_FOUNDATION_API MgInvalidStreamHeaderException : public MgStreamIoException
-{
-    DECLARE_CLASSNAME(MgInvalidStreamHeaderException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidStreamHeaderException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidStreamHeaderException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidStreamHeaderException object.
-    ///
-    virtual ~MgInvalidStreamHeaderException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidStreamHeaderException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgInvalidStreamHeaderException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/IoException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/IoException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/IoException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgIoException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgIoException object.
-///
-MgIoException::MgIoException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgIoException::~MgIoException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/IoException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/IoException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/IoException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_IO_EXCEPTION_H_
-#define MG_IO_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an I/O error occurs.
-///
-class MG_FOUNDATION_API MgIoException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgIoException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgIoException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgIoException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgIoException object.
-    ///
-    virtual ~MgIoException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgIoException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgIoException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/LengthException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/LengthException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/LengthException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgLengthException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidArgumentException object.
-///
-MgLengthException::MgLengthException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgLengthException::~MgLengthException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/LengthException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/LengthException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/LengthException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,68 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_LENGTH_EXCEPTION_H_
-#define MG_LENGTH_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a length of some item does not match the expected length.
-class MG_FOUNDATION_API MgLengthException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgLengthException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgLengthException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgLengthException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgDomainException object.
-    ///
-    virtual ~MgLengthException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgLengthException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgLengthException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/LogicException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/LogicException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/LogicException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgLogicException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgLogicException object.
-///
-MgLogicException::MgLogicException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgLogicException::~MgLogicException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/LogicException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/LogicException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/LogicException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_LOGIC_EXCEPTION_H_
-#define MG_LOGIC_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown to report errors presumably detectable
-/// before the program executes, such as violations of logical preconditions.
-///
-class MG_FOUNDATION_API MgLogicException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgLogicException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgLogicException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgLogicException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgLogicException object.
-    ///
-    virtual ~MgLogicException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgLogicException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgLogicException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgNotFiniteNumberException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgNotFiniteNumberException object.
-///
-MgNotFiniteNumberException::MgNotFiniteNumberException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgNotFiniteNumberException::~MgNotFiniteNumberException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NotFiniteNumberException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_NOT_FINITE_NUMBER_EXCEPTION_H_
-#define MG_NOT_FINITE_NUMBER_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a floating-point value is positive infinity,
-/// negative infinity, or Not-a-Number (NaN).
-///
-class MG_FOUNDATION_API MgNotFiniteNumberException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgNotFiniteNumberException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgNotFiniteNumberException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgNotFiniteNumberException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgNotFiniteNumberException object.
-    ///
-    virtual ~MgNotFiniteNumberException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgNotFiniteNumberException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgNotFiniteNumberException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/NotImplementedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NotImplementedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NotImplementedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgNotImplementedException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgNotImplementedException object.
-///
-MgNotImplementedException::MgNotImplementedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgNotImplementedException::~MgNotImplementedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/NotImplementedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NotImplementedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NotImplementedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_NOT_IMPLEMENTED_EXCEPTION_H_
-#define MG_NOT_IMPLEMENTED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an operation that has not been implemented yet is invoked.
-///
-class MG_FOUNDATION_API MgNotImplementedException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgNotImplementedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgNotImplementedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgNotImplementedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgNotImplementedException object.
-    ///
-    virtual ~MgNotImplementedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgNotImplementedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgNotImplementedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/NullArgumentException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullArgumentException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullArgumentException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgNullArgumentException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgNullArgumentException object.
-///
-MgNullArgumentException::MgNullArgumentException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgNullArgumentException::~MgNullArgumentException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/NullArgumentException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullArgumentException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullArgumentException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_NULL_ARGUMENT_EXCEPTION_H_
-#define MG_NULL_ARGUMENT_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a null argument is passed to a method
-/// that expects a non-null value.
-///
-class MG_FOUNDATION_API MgNullArgumentException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgNullArgumentException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgNullArgumentException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgNullArgumentException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgNullArgumentException object.
-    ///
-    virtual ~MgNullArgumentException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgNullArgumentException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgNullArgumentException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgNullPropertyValueException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgNullPropertyValueException object.
-///
-MgNullPropertyValueException::MgNullPropertyValueException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgNullPropertyValueException::~MgNullPropertyValueException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullPropertyValueException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,71 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_NULL_PROPERTY_VALUE_EXCEPTION_H_
-#define MG_NULL_PROPERTY_VALUE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-#include "Foundation.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a property value is null.
-///
-class MG_FOUNDATION_API MgNullPropertyValueException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgNullPropertyValueException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgNullPropertyValueException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgNullPropertyValueException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgNullPropertyValueException object.
-    ///
-    virtual ~MgNullPropertyValueException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgNullPropertyValueException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgNullPropertyValueException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/NullReferenceException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullReferenceException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullReferenceException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgNullReferenceException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgNullReferenceException object.
-///
-MgNullReferenceException::MgNullReferenceException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgNullReferenceException::~MgNullReferenceException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/NullReferenceException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/NullReferenceException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/NullReferenceException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_NULL_REFERENCE_EXCEPTION_H_
-#define MG_NULL_REFERENCE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when there is an attempt to dereference a null object reference.
-///
-class MG_FOUNDATION_API MgNullReferenceException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgNullReferenceException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgNullReferenceException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgNullReferenceException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgNullReferenceException object.
-    ///
-    virtual ~MgNullReferenceException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgNullReferenceException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgNullReferenceException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgObjectNotFoundException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgObjectNotFoundException object.
-///
-MgObjectNotFoundException::MgObjectNotFoundException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgObjectNotFoundException::~MgObjectNotFoundException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ObjectNotFoundException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_OBJECT_NOT_FOUND_EXCEPTION_H_
-#define MG_OBJECT_NOT_FOUND_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when attempting to access an object
-/// that cannot be found.
-///
-class MG_FOUNDATION_API MgObjectNotFoundException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgObjectNotFoundException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgObjectNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgObjectNotFoundException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgObjectNotFoundException object.
-    ///
-    virtual ~MgObjectNotFoundException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgObjectNotFoundException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgObjectNotFoundException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgOutOfMemoryException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgOutOfMemoryException object.
-///
-MgOutOfMemoryException::MgOutOfMemoryException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgOutOfMemoryException::~MgOutOfMemoryException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OutOfMemoryException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_OUT_OF_MEMORY_EXCEPTION_H_
-#define MG_OUT_OF_MEMORY_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when required memory cannot be allocated.
-///
-class MG_FOUNDATION_API MgOutOfMemoryException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgOutOfMemoryException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgOutOfMemoryException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgOutOfMemoryException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgOutOfMemoryException object.
-    ///
-    virtual ~MgOutOfMemoryException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgOutOfMemoryException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgOutOfMemoryException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgOutOfRangeException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgOutOfRangeException object.
-///
-MgOutOfRangeException::MgOutOfRangeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgOutOfRangeException::~MgOutOfRangeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OutOfRangeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,75 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_OUT_OF_RANGE_EXCEPTION_H_
-#define MG_OUT_OF_RANGE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a parameter value passed to a method
-/// is not in the valid range specified by its documentation.
-///
-/// \remarks
-/// This exception is generally thrown by the collection classes when the
-/// index passed to a method is less than zero, or greater or equal to the
-/// number of elements in the collection.
-///
-class MG_FOUNDATION_API MgOutOfRangeException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgOutOfRangeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgOutOfRangeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgOutOfRangeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgOutOfRangeException object.
-    ///
-    virtual ~MgOutOfRangeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgOutOfRangeException)
-
-CLASS_ID:
-    static const INT32 m_cls_id = Foundation_Exception_MgOutOfRangeException;
-
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/OverflowException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OverflowException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OverflowException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgOverflowException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgOverflowException object.
-///
-MgOverflowException::MgOverflowException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgOverflowException::~MgOverflowException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/OverflowException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/OverflowException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/OverflowException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,70 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_OVERFLOW_EXCEPTION_H_
-#define MG_OVERFLOW_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an arithmetic, casting, or conversion
-/// operation in a checked context results in an overflow.
-///
-class MG_FOUNDATION_API MgOverflowException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgOverflowException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgOverflowException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgOverflowException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgOverflowException object.
-    ///
-    virtual ~MgOverflowException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgOverflowException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgOverflowException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgPlatformNotSupportedException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgPlatformNotSupportedException object.
-///
-MgPlatformNotSupportedException::MgPlatformNotSupportedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgPlatformNotSupportedException::~MgPlatformNotSupportedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/PlatformNotSupportedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_PLATFORM_NOT_SUPPORTED_EXCEPTION_H_
-#define MG_PLATFORM_NOT_SUPPORTED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a feature does not run on a particular platform.
-///
-class MG_FOUNDATION_API MgPlatformNotSupportedException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgPlatformNotSupportedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgPlatformNotSupportedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgPlatformNotSupportedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgPlatformNotSupportedException object.
-    ///
-    virtual ~MgPlatformNotSupportedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgPlatformNotSupportedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgPlatformNotSupportedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgResourceTagNotFoundException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgResourceTagNotFoundException object.
-///
-MgResourceTagNotFoundException::MgResourceTagNotFoundException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the MgResourceTagNotFoundException object.
-///
-MgResourceTagNotFoundException::~MgResourceTagNotFoundException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourceTagNotFoundException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_RESOURCE_TAG_NOT_FOUND_EXCEPTION_H_
-#define MG_RESOURCE_TAG_NOT_FOUND_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a resource tag is not found.
-///
-class MG_FOUNDATION_API MgResourceTagNotFoundException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgResourceTagNotFoundException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgResourceTagNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgResourceTagNotFoundException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destruct the MgResourceTagNotFoundException object.
-    ///
-    virtual ~MgResourceTagNotFoundException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgResourceTagNotFoundException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgResourceTagNotFoundException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourcesException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourcesException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourcesException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgResourcesException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgResourcesException object.
-///
-MgResourcesException::MgResourcesException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgResourcesException::~MgResourcesException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourcesException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourcesException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourcesException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_RESOURCES_EXCEPTION_H_
-#define MG_RESOURCES_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs with the resources.
-///
-class MG_FOUNDATION_API MgResourcesException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgResourcesException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgFileNotFoundException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgResourcesException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgResourcesException object.
-    ///
-    virtual ~MgResourcesException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgResourcesException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgResourcesException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,49 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgResourcesLoadFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgResourcesLoadFailedException object.
-///
-MgResourcesLoadFailedException::MgResourcesLoadFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgResourcesLoadFailedException::~MgResourcesLoadFailedException() throw()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Retrieve the formatted exception message for the specified locale.
-///
-STRING MgResourcesLoadFailedException::GetExceptionMessage(CREFSTRING locale) throw()
-{
-    return MgException::GetExceptionMessage(locale, MgResources::FailedToLoadResourcesFile);
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ResourcesLoadFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,86 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_RESOURCES_LOADFAILED_EXCEPTION_H_
-#define MG_RESOURCES_LOADFAILED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs loading resources.
-/// \remarks
-/// Resources may fail to load if the file itself is not found or if there is
-/// a syntax error in the file.
-///
-class MG_FOUNDATION_API MgResourcesLoadFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgResourcesLoadFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgResourcesLoadFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgResourcesLoadFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgResourcesException object.
-    ///
-    virtual ~MgResourcesLoadFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgResourcesLoadFailedException)
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Retrieve the formatted exception message for the specified locale.
-    ///
-    /// \param locale
-    /// The locale identifier to format the details text.
-    /// Locale codes are 2 letters language codes defined by ISO 639-1.
-    /// Please refer to  http://www.loc.gov/standards/iso639-2/englangn.html
-    ///
-    /// \return
-    /// Formatted exception message
-    ///
-    virtual STRING GetExceptionMessage(CREFSTRING locale) throw();
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgResourcesLoadFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/RuntimeException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/RuntimeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/RuntimeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgRuntimeException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgRuntimeException object.
-///
-MgRuntimeException::MgRuntimeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgRuntimeException::~MgRuntimeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/RuntimeException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/RuntimeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/RuntimeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,74 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_RUNTIME_EXCEPTION_H_
-#define MG_RUNTIME_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an internal runtime error occurs.
-///
-/// \remarks
-/// Examples include a missing or invalid object type id or a failure on file input/output.
-/// This exception generally does not reflect an error in the application's
-/// logic but instead denotes an unexpected runtime situation.
-///
-class MG_FOUNDATION_API MgRuntimeException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgRuntimeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgRuntimeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgRuntimeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgRuntimeException object.
-    ///
-    virtual ~MgRuntimeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgRuntimeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgRuntimeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/StreamIoException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/StreamIoException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/StreamIoException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgStreamIoException, MgIoException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgStreamIoException object.
-///
-MgStreamIoException::MgStreamIoException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgIoException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgStreamIoException::~MgStreamIoException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/StreamIoException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/StreamIoException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/StreamIoException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,71 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_STREAM_IO_EXCEPTION_H_
-#define MG_STREAM_IO_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when low-level stream I/O problems occur
-/// during communication between server and web-tier.
-///
-class MG_FOUNDATION_API MgStreamIoException : public MgIoException
-{
-    DECLARE_CLASSNAME(MgStreamIoException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgStreamIoException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgStreamIoException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgStreamIoException object.
-    ///
-    virtual ~MgStreamIoException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgStreamIoException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgStreamIoException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/SystemException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/SystemException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/SystemException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,141 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-#include <exception>
-// The following three headers are needed to compile under Linux.
-#include <stdexcept>
-#include <typeinfo>
-#include <iostream>
-
-using namespace std;
-
-IMPLEMENT_EXCEPTION_ABSTRACT(MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a MgSystemException object.
-///
-MgSystemException::MgSystemException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgSystemException::~MgSystemException() throw()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-///<summary>
-/// Create a MgException from mapping a standard CPP exception to a MgException.
-///</summary>
-///
-MgException* MgSystemException::Create(exception& stdLibException,
-    CREFSTRING methodName, INT32 lineNumber, CREFSTRING fileName) throw()
-{
-    // The following string conversion is used to detect whether or not
-    // the given error message is unicode compliant.
-    // Without this check, the server will not be able to serialize
-    // this exception object correctly.
-
-    STRING messageId;
-    MgStringCollection arguments;
-    bool unicodeCompliant = false;
-
-    MG_TRY()
-
-    STRING wcStr;
-
-    MgUtil::MultiByteToWideChar(stdLibException.what(), wcStr);
-    arguments.Add(wcStr);
-
-    unicodeCompliant = true;
-
-    MG_CATCH_AND_RELEASE()
-
-    if (unicodeCompliant)
-    {
-        messageId = L"MgFormatInnerExceptionMessage";
-    }
-    else
-    {
-        messageId = L"MgFailedToRetrieveSystemExceptionMesage";
-        arguments.Clear();
-    }
-
-    // Use typeid to determine the specific standard library exception type.
-    // An equivalent MgException* is returned.
-    // If typeid cannot determine the specific standard library exception type
-    // a new MgUnclassifiedException is returned.
-
-    if (typeid(stdLibException) == typeid(std::domain_error))
-    {
-        return new MgDomainException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(invalid_argument))
-    {
-        return new MgInvalidArgumentException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(length_error))
-    {
-        return new MgLengthException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(overflow_error))
-    {
-        return new MgOverflowException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(out_of_range)
-          || typeid(stdLibException) == typeid(range_error))
-    {
-        return new MgOutOfRangeException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(underflow_error))
-    {
-        return new MgUnderflowException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(bad_alloc))
-    {
-        return new MgOutOfMemoryException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(bad_cast))
-    {
-        return new MgInvalidCastException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(logic_error))
-    {
-        return new MgLogicException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else if (typeid(stdLibException) == typeid(bad_exception)
-          || typeid(stdLibException) == typeid(bad_typeid)
-          || typeid(stdLibException) == typeid(ios_base::failure)
-          || typeid(stdLibException) == typeid(runtime_error))
-    {
-        return new MgRuntimeException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-    else
-    {
-        return new MgUnclassifiedException(methodName, lineNumber, fileName, NULL, messageId, &arguments);
-    }
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/SystemException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/SystemException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/SystemException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,78 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_SYSTEM_EXCEPTION_H_
-#define MG_SYSTEM_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-////////////////////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Base class for all exceptions representing a system error.
-///
-class MG_FOUNDATION_API MgSystemException : public MgException
-{
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgSystemException object.
-    ///
-    virtual ~MgSystemException() throw();
-
-INTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Create a MgException from mapping a standard CPP exception to a MgException.
-    ///
-    static MgException* Create(exception& stdLibException,
-        CREFSTRING methodName, INT32 lineNumber, CREFSTRING fileName) throw();
-
-protected:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgSystemException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgSystemException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_ABSTRACT(MgSystemException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgSystemException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgTemporaryFileNotAvailableException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgTemporaryFileNotAvailableException object.
-///
-MgTemporaryFileNotAvailableException::MgTemporaryFileNotAvailableException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgTemporaryFileNotAvailableException::~MgTemporaryFileNotAvailableException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/TemporaryFileNotAvailableException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,71 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_TEMPORARY_FILE_NOT_AVAILABLE_EXCEPTION_H_
-#define MG_TEMPORARY_FILE_NOT_AVAILABLE_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-#include "Foundation.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a temporary file is not available.
-///
-class MG_FOUNDATION_API MgTemporaryFileNotAvailableException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgTemporaryFileNotAvailableException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgTemporaryFileNotAvailableException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgTemporaryFileNotAvailableException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgTemporaryFileNotAvailableException object
-    ///
-    virtual ~MgTemporaryFileNotAvailableException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgTemporaryFileNotAvailableException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgTemporaryFileNotAvailableException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,84 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_ABSTRACT(MgThirdPartyException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgThirdPartyException object.
-///
-MgThirdPartyException::MgThirdPartyException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments),
-    m_errorCode(0)
-{
-    // The following string conversion is used to detect whether or not
-    // the given error message is unicode compliant.
-    // Without this check, the server will not be able to serialize
-    // this exception object correctly.
-
-    bool unicodeCompliant = false;
-
-    MG_TRY()
-
-    string mbStr;
-
-    for (INT32 i = 0; i < m_whyArguments.GetCount(); ++i)
-    {
-        MgUtil::WideCharToMultiByte(m_whyArguments.GetItem(i), mbStr);
-    }
-
-    unicodeCompliant = true;
-
-    MG_CATCH_AND_RELEASE()
-
-    if (!unicodeCompliant)
-    {
-        m_whyMessageId = L"MgFailedToRetrieveThirdPartyExceptionMesage";
-        m_whyArguments.Clear();
-    }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgThirdPartyException::~MgThirdPartyException() throw()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Get the error code.
-///
-INT32 MgThirdPartyException::GetErrorCode() throw()
-{
-    return m_errorCode;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Set the error code.
-///
-void MgThirdPartyException::SetErrorCode(INT32 errorCode) throw()
-{
-    m_errorCode = errorCode;
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/ThirdPartyException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,83 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_THIRD_PARTY_EXCEPTION_H_
-#define MG_THIRD_PARTY_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Base class for third party exceptions.
-///
-/// \remarks
-/// Third party exceptions are thrown from components such as FDO
-/// that are used by \ProdName but are not part of
-/// \ProdName itself.
-///
-class MG_FOUNDATION_API MgThirdPartyException : public MgException
-{
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgThirdPartyException object.
-    ///
-    virtual ~MgThirdPartyException() throw();
-
-INTERNAL_API:
-
-    INT32 GetErrorCode() throw();
-    void SetErrorCode(INT32 errorCode) throw();
-
-protected:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgThirdPartyException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgThirdPartyException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_ABSTRACT(MgThirdPartyException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgThirdPartyException;
-
-private:
-
-    INT32 m_errorCode;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgUnclassifiedException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgUnclassifiedException object.
-///
-MgUnclassifiedException::MgUnclassifiedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgUnclassifiedException::~MgUnclassifiedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/UnclassifiedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,72 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_UNCLASSIFIED_EXCEPTION_H_
-#define MG_UNCLASSIFIED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-#include "Foundation.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when the server or web-tier does not know the
-/// cause of the actual problem.
-///
-class MG_FOUNDATION_API MgUnclassifiedException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgUnclassifiedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgUnclassifiedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgUnclassifiedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgUnclassifiedException object.
-    ///
-    virtual ~MgUnclassifiedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgUnclassifiedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgUnclassifiedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/UnderflowException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/UnderflowException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/UnderflowException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgUnderflowException, MgSystemException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgUnderflowException object.
-///
-MgUnderflowException::MgUnderflowException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgSystemException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgUnderflowException::~MgUnderflowException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/UnderflowException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/UnderflowException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/UnderflowException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_UNDERFLOW_EXCEPTION_H_
-#define MG_UNDERFLOW_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an arithmetic underflow occurs.
-///
-class MG_FOUNDATION_API MgUnderflowException : public MgSystemException
-{
-    DECLARE_CLASSNAME(MgUnderflowException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgUnderflowException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgUnderflowException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgUnderflowException object.
-    ///
-    virtual ~MgUnderflowException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgUnderflowException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgUnderflowException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/XmlException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/XmlException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/XmlException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgXmlException, MgThirdPartyException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgXmlException object.
-///
-MgXmlException::MgXmlException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgThirdPartyException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgXmlException::~MgXmlException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/XmlException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/XmlException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/XmlException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_XML_EXCEPTION_H_
-#define MG_XML_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs while processing XML.
-///
-class MG_FOUNDATION_API MgXmlException : public MgThirdPartyException
-{
-    DECLARE_CLASSNAME(MgXmlException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgXmlException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgXmlException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgXmlException object.
-    ///
-    virtual ~MgXmlException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgXmlException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgXmlException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Foundation/Exception/XmlParserException.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/XmlParserException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/XmlParserException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgXmlParserException, MgThirdPartyException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgXmlParserException object.
-///
-MgXmlParserException::MgXmlParserException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgThirdPartyException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgXmlParserException::~MgXmlParserException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Foundation/Exception/XmlParserException.h
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/XmlParserException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Exception/XmlParserException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,71 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_XML_PARSER_EXCEPTION_H_
-#define MG_XML_PARSER_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-#include "Foundation.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Wrapper for exceptions thrown from the Xerces XML parser.
-///
-class MG_FOUNDATION_API MgXmlParserException : public MgThirdPartyException
-{
-    DECLARE_CLASSNAME(MgXmlParserException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgXmlParserException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgXmlParserException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgXmlParserException object.
-    ///
-    virtual ~MgXmlParserException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgXmlParserException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Foundation_Exception_MgXmlParserException;
-};
-
-#endif

Modified: trunk/MgDev/Common/Foundation/Foundation.h
===================================================================
--- trunk/MgDev/Common/Foundation/Foundation.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Foundation.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -142,58 +142,8 @@
 // Base exception classes and defines
 #include "Exception/ExceptionDefs.h"
 #include "Exception/Exception.h"
-#include "Exception/SystemException.h"
-#include "Exception/OutOfRangeException.h"
-#include "Exception/IoException.h"
-#include "Exception/FileIoException.h"
-#include "Exception/StreamIoException.h"
+#include "Exception/ExceptionCodes.h"
 
-#include "Exception/ApplicationException.h"
-#include "Exception/ArgumentOutOfRangeException.h"
-#include "Exception/ClassNotFoundException.h"
-#include "Exception/ConfigurationException.h"
-#include "Exception/ConfigurationLoadFailedException.h"
-#include "Exception/ConfigurationSaveFailedException.h"
-#include "Exception/DateTimeException.h"
-#include "Exception/DecryptionException.h"
-#include "Exception/DirectoryNotFoundException.h"
-#include "Exception/DivideByZeroException.h"
-#include "Exception/DomainException.h"
-#include "Exception/DuplicateDirectoryException.h"
-#include "Exception/DuplicateFileException.h"
-#include "Exception/DuplicateObjectException.h"
-#include "Exception/EncryptionException.h"
-#include "Exception/FileNotFoundException.h"
-#include "Exception/GridDensityException.h"
-#include "Exception/IndexOutOfRangeException.h"
-#include "Exception/InvalidArgumentException.h"
-#include "Exception/InvalidCastException.h"
-#include "Exception/InvalidMimeTypeException.h"
-#include "Exception/InvalidOperationException.h"
-#include "Exception/InvalidPropertyTypeException.h"
-#include "Exception/InvalidStreamHeaderException.h"
-#include "Exception/LengthException.h"
-#include "Exception/LogicException.h"
-#include "Exception/NotFiniteNumberException.h"
-#include "Exception/NotImplementedException.h"
-#include "Exception/NullArgumentException.h"
-#include "Exception/NullPropertyValueException.h"
-#include "Exception/NullReferenceException.h"
-#include "Exception/ObjectNotFoundException.h"
-#include "Exception/OutOfMemoryException.h"
-#include "Exception/OverflowException.h"
-#include "Exception/PlatformNotSupportedException.h"
-#include "Exception/ResourcesException.h"
-#include "Exception/ResourcesLoadFailedException.h"
-#include "Exception/ResourceTagNotFoundException.h"
-#include "Exception/RuntimeException.h"
-#include "Exception/TemporaryFileNotAvailableException.h"
-#include "Exception/ThirdPartyException.h"
-#include "Exception/UnclassifiedException.h"
-#include "Exception/UnderflowException.h"
-#include "Exception/XmlException.h"
-#include "Exception/XmlParserException.h"
-
 #ifndef SWIG_PUBLIC_API
 #include "System/ByteSourceFileImpl.h"
 #include "System/ByteSourceMemoryImpl.h"

Modified: trunk/MgDev/Common/Foundation/Foundation.vcxproj
===================================================================
--- trunk/MgDev/Common/Foundation/Foundation.vcxproj	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Foundation.vcxproj	2022-10-10 09:40:18 UTC (rev 9971)
@@ -192,96 +192,6 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="Exception\ApplicationException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ArgumentOutOfRangeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ClassNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationLoadFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationSaveFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DateTimeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DecryptionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DirectoryNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DivideByZeroException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DomainException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateDirectoryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateFileException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateObjectException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\EncryptionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Exception\Exception.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
@@ -296,224 +206,6 @@
       <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
       <XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
     </ClCompile>
-    <ClCompile Include="Exception\FileIoException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\FileNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\GridDensityException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\IndexOutOfRangeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidArgumentException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCastException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidMimeTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidOperationException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPropertyTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidStreamHeaderException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\IoException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LengthException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LogicException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\NotFiniteNumberException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\NotImplementedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\NullArgumentException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\NullPropertyValueException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\NullReferenceException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ObjectNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\OutOfMemoryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\OutOfRangeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\OverflowException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\PlatformNotSupportedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourcesException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourcesLoadFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceTagNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RuntimeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
-      <XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
-      <XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
-      <XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.obj</ObjectFileName>
-      <XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
-    </ClCompile>
-    <ClCompile Include="Exception\StreamIoException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\SystemException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\TemporaryFileNotAvailableException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ThirdPartyException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UnclassifiedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UnderflowException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\XmlException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\XmlParserException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Data\BatchPropertyCollection.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -604,6 +296,12 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="Exception\ExceptionCodes.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="System\AceStreamHelper.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -799,58 +497,9 @@
     <ClCompile Include="FoundationBuild.cpp" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Exception\ApplicationException.h" />
-    <ClInclude Include="Exception\ArgumentOutOfRangeException.h" />
-    <ClInclude Include="Exception\ClassNotFoundException.h" />
-    <ClInclude Include="Exception\ConfigurationException.h" />
-    <ClInclude Include="Exception\ConfigurationLoadFailedException.h" />
-    <ClInclude Include="Exception\ConfigurationSaveFailedException.h" />
-    <ClInclude Include="Exception\DateTimeException.h" />
-    <ClInclude Include="Exception\DecryptionException.h" />
-    <ClInclude Include="Exception\DirectoryNotFoundException.h" />
-    <ClInclude Include="Exception\DivideByZeroException.h" />
-    <ClInclude Include="Exception\DomainException.h" />
-    <ClInclude Include="Exception\DuplicateDirectoryException.h" />
-    <ClInclude Include="Exception\DuplicateFileException.h" />
-    <ClInclude Include="Exception\DuplicateObjectException.h" />
-    <ClInclude Include="Exception\EncryptionException.h" />
     <ClInclude Include="Exception\Exception.h" />
+    <ClInclude Include="Exception\ExceptionCodes.h" />
     <ClInclude Include="Exception\ExceptionDefs.h" />
-    <ClInclude Include="Exception\FileIoException.h" />
-    <ClInclude Include="Exception\FileNotFoundException.h" />
-    <ClInclude Include="Exception\GridDensityException.h" />
-    <ClInclude Include="Exception\IndexOutOfRangeException.h" />
-    <ClInclude Include="Exception\InvalidArgumentException.h" />
-    <ClInclude Include="Exception\InvalidCastException.h" />
-    <ClInclude Include="Exception\InvalidMimeTypeException.h" />
-    <ClInclude Include="Exception\InvalidOperationException.h" />
-    <ClInclude Include="Exception\InvalidPropertyTypeException.h" />
-    <ClInclude Include="Exception\InvalidStreamHeaderException.h" />
-    <ClInclude Include="Exception\IoException.h" />
-    <ClInclude Include="Exception\LengthException.h" />
-    <ClInclude Include="Exception\LogicException.h" />
-    <ClInclude Include="Exception\NotFiniteNumberException.h" />
-    <ClInclude Include="Exception\NotImplementedException.h" />
-    <ClInclude Include="Exception\NullArgumentException.h" />
-    <ClInclude Include="Exception\NullPropertyValueException.h" />
-    <ClInclude Include="Exception\NullReferenceException.h" />
-    <ClInclude Include="Exception\ObjectNotFoundException.h" />
-    <ClInclude Include="Exception\OutOfMemoryException.h" />
-    <ClInclude Include="Exception\OutOfRangeException.h" />
-    <ClInclude Include="Exception\OverflowException.h" />
-    <ClInclude Include="Exception\PlatformNotSupportedException.h" />
-    <ClInclude Include="Exception\ResourcesException.h" />
-    <ClInclude Include="Exception\ResourcesLoadFailedException.h" />
-    <ClInclude Include="Exception\ResourceTagNotFoundException.h" />
-    <ClInclude Include="Exception\RuntimeException.h" />
-    <ClInclude Include="Exception\StreamIoException.h" />
-    <ClInclude Include="Exception\SystemException.h" />
-    <ClInclude Include="Exception\TemporaryFileNotAvailableException.h" />
-    <ClInclude Include="Exception\ThirdPartyException.h" />
-    <ClInclude Include="Exception\UnclassifiedException.h" />
-    <ClInclude Include="Exception\UnderflowException.h" />
-    <ClInclude Include="Exception\XmlException.h" />
-    <ClInclude Include="Exception\XmlParserException.h" />
     <ClInclude Include="Data\BatchPropertyCollection.h" />
     <ClInclude Include="Data\Byte.h" />
     <ClInclude Include="Data\ByteReader.h" />

Modified: trunk/MgDev/Common/Foundation/Foundation.vcxproj.filters
===================================================================
--- trunk/MgDev/Common/Foundation/Foundation.vcxproj.filters	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/Foundation.vcxproj.filters	2022-10-10 09:40:18 UTC (rev 9971)
@@ -12,159 +12,9 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Exception\ApplicationException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ArgumentOutOfRangeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ClassNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationLoadFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ConfigurationSaveFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DateTimeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DecryptionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DirectoryNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DivideByZeroException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DomainException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateDirectoryException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateFileException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateObjectException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\EncryptionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Exception\Exception.cpp">
       <Filter>Exception</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\FileIoException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\FileNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\GridDensityException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\IndexOutOfRangeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidArgumentException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCastException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidMimeTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidOperationException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPropertyTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidStreamHeaderException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\IoException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LengthException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LogicException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\NotFiniteNumberException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\NotImplementedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\NullArgumentException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\NullPropertyValueException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\NullReferenceException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ObjectNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\OutOfMemoryException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\OutOfRangeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\OverflowException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\PlatformNotSupportedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourcesException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourcesLoadFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceTagNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RuntimeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\StreamIoException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\SystemException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\TemporaryFileNotAvailableException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ThirdPartyException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UnclassifiedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UnderflowException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\XmlException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\XmlParserException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Data\BatchPropertyCollection.cpp">
       <Filter>Data</Filter>
     </ClCompile>
@@ -307,53 +157,11 @@
     <ClCompile Include="System\LibraryInit.cpp">
       <Filter>System</Filter>
     </ClCompile>
+    <ClCompile Include="Exception\ExceptionCodes.cpp">
+      <Filter>Exception</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Exception\ApplicationException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ArgumentOutOfRangeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ClassNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ConfigurationException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ConfigurationLoadFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ConfigurationSaveFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DateTimeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DecryptionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DirectoryNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DivideByZeroException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DomainException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateDirectoryException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateFileException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateObjectException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\EncryptionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Exception\Exception.h">
       <Filter>Exception</Filter>
     </ClInclude>
@@ -360,111 +168,6 @@
     <ClInclude Include="Exception\ExceptionDefs.h">
       <Filter>Exception</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\FileIoException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\FileNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\GridDensityException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\IndexOutOfRangeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidArgumentException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidCastException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidMimeTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidOperationException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPropertyTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidStreamHeaderException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\IoException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LengthException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LogicException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\NotFiniteNumberException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\NotImplementedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\NullArgumentException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\NullPropertyValueException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\NullReferenceException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ObjectNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\OutOfMemoryException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\OutOfRangeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\OverflowException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\PlatformNotSupportedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourcesException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourcesLoadFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourceTagNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RuntimeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\StreamIoException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\SystemException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\TemporaryFileNotAvailableException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ThirdPartyException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UnclassifiedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UnderflowException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\XmlException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\XmlParserException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Data\BatchPropertyCollection.h">
       <Filter>Data</Filter>
     </ClInclude>
@@ -656,6 +359,9 @@
     <ClInclude Include="System\LibraryInit.h">
       <Filter>System</Filter>
     </ClInclude>
+    <ClInclude Include="Exception\ExceptionCodes.h">
+      <Filter>Exception</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Foundation.rc" />

Modified: trunk/MgDev/Common/Foundation/FoundationBuild.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/FoundationBuild.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/FoundationBuild.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -37,57 +37,8 @@
 #include "Data/LinuxNumericalConstants.cpp"
 #endif
 
-#include "Exception/ApplicationException.cpp"
-#include "Exception/ArgumentOutOfRangeException.cpp"
-#include "Exception/ClassNotFoundException.cpp"
-#include "Exception/ConfigurationException.cpp"
-#include "Exception/ConfigurationLoadFailedException.cpp"
-#include "Exception/ConfigurationSaveFailedException.cpp"
-#include "Exception/DateTimeException.cpp"
-#include "Exception/DecryptionException.cpp"
-#include "Exception/DirectoryNotFoundException.cpp"
-#include "Exception/DivideByZeroException.cpp"
-#include "Exception/DomainException.cpp"
-#include "Exception/DuplicateDirectoryException.cpp"
-#include "Exception/DuplicateFileException.cpp"
-#include "Exception/DuplicateObjectException.cpp"
-#include "Exception/EncryptionException.cpp"
 #include "Exception/Exception.cpp"
-#include "Exception/FileIoException.cpp"
-#include "Exception/FileNotFoundException.cpp"
-#include "Exception/GridDensityException.cpp"
-#include "Exception/IndexOutOfRangeException.cpp"
-#include "Exception/InvalidArgumentException.cpp"
-#include "Exception/InvalidCastException.cpp"
-#include "Exception/InvalidMimeTypeException.cpp"
-#include "Exception/InvalidOperationException.cpp"
-#include "Exception/InvalidPropertyTypeException.cpp"
-#include "Exception/InvalidStreamHeaderException.cpp"
-#include "Exception/IoException.cpp"
-#include "Exception/LengthException.cpp"
-#include "Exception/LogicException.cpp"
-#include "Exception/NotFiniteNumberException.cpp"
-#include "Exception/NotImplementedException.cpp"
-#include "Exception/NullArgumentException.cpp"
-#include "Exception/NullPropertyValueException.cpp"
-#include "Exception/NullReferenceException.cpp"
-#include "Exception/ObjectNotFoundException.cpp"
-#include "Exception/OutOfMemoryException.cpp"
-#include "Exception/OutOfRangeException.cpp"
-#include "Exception/OverflowException.cpp"
-#include "Exception/PlatformNotSupportedException.cpp"
-#include "Exception/ResourcesException.cpp"
-#include "Exception/ResourcesLoadFailedException.cpp"
-#include "Exception/ResourceTagNotFoundException.cpp"
-#include "Exception/RuntimeException.cpp"
-#include "Exception/StreamIoException.cpp"
-#include "Exception/SystemException.cpp"
-#include "Exception/TemporaryFileNotAvailableException.cpp"
-#include "Exception/ThirdPartyException.cpp"
-#include "Exception/UnclassifiedException.cpp"
-#include "Exception/UnderflowException.cpp"
-#include "Exception/XmlException.cpp"
-#include "Exception/XmlParserException.cpp"
+#include "Exception/ExceptionCodes.cpp"
 
 #include "System/AceStreamHelper.cpp"
 #include "System/ByteSourceFileImpl.cpp"

Modified: trunk/MgDev/Common/Foundation/System/ByteSourceFileImpl.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ByteSourceFileImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ByteSourceFileImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -66,7 +66,7 @@
 
     if (bytesRead < 0)
     {
-        throw new MgFileIoException(L"ByteSourceFileImpl.Read",
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"ByteSourceFileImpl.Read",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -95,7 +95,7 @@
 {
     if (m_temporary == false)
     {
-        throw new MgInvalidOperationException(L"ByteSourceFileImpl.Rename",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"ByteSourceFileImpl.Rename",
             __LINE__,__WFILE__, NULL, L"", NULL);
     }
 
@@ -123,13 +123,13 @@
         if(errno == ENOENT)
         {
             MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-            throw new MgFileNotFoundException(L"ByteSourceFileImpl.LoadFile",
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"ByteSourceFileImpl.LoadFile",
                 __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
         }
         else
         {
             MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-            throw new MgFileIoException(L"ByteSourceFileImpl.LoadFile",
+            throw new MgException(MgExceptionCodes::MgFileIoException, L"ByteSourceFileImpl.LoadFile",
                 __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
         }
     }

Modified: trunk/MgDev/Common/Foundation/System/ByteSourceMemoryImpl.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ByteSourceMemoryImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ByteSourceMemoryImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -31,7 +31,7 @@
 
     if(m_data == NULL)
     {
-        throw new MgOutOfMemoryException(L"ByteSourceMemoryImpl.ByteSourceMemoryImpl",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"ByteSourceMemoryImpl.ByteSourceMemoryImpl",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -132,7 +132,7 @@
 
         if (stat != MgStreamHelper::mssDone)
         {
-            throw new MgStreamIoException(L"ByteSourceSocketStreamImpl.Read",
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"ByteSourceSocketStreamImpl.Read",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -155,7 +155,7 @@
 
             if (stat != MgStreamHelper::mssDone)
             {
-                throw new MgStreamIoException(L"ByteSourceSocketStreamImpl.Read",
+                throw new MgException(MgExceptionCodes::MgStreamIoException, L"ByteSourceSocketStreamImpl.Read",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -196,6 +196,6 @@
 
 void ByteSourceSocketStreamImpl::Rewind()
 {
-    throw new MgInvalidOperationException(L"ByteSourceSocketStreamImpl.Rewind",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"ByteSourceSocketStreamImpl.Rewind",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/Foundation/System/ByteSourceStreamImpl.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ByteSourceStreamImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ByteSourceStreamImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -64,7 +64,7 @@
 
     if (bytesReceived == -1)
     {
-        throw new MgStreamIoException(L"ByteSourceMgStreamImpl.Read",
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"ByteSourceMgStreamImpl.Read",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -86,6 +86,6 @@
 
 void ByteSourceMgStreamImpl::Rewind()
 {
-    throw new MgInvalidOperationException(L"ByteSourceMgStreamImpl.Rewind",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"ByteSourceMgStreamImpl.Rewind",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/Foundation/System/ClassFactory.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ClassFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ClassFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -57,7 +57,7 @@
     ClassCreatorFunc func = m_classCreators[classId];
     if (NULL == func)
     {
-        throw new MgClassNotFoundException(L"MgClassFactory.CreateMgObject", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgClassFactory.CreateMgObject", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MgObject* obj = (*func)();
@@ -69,7 +69,7 @@
 {
     if (0 >= classId || NULL == creator)
     {
-        throw new MgInvalidArgumentException(L"MgClassFactory.RegisterClass", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgClassFactory.RegisterClass", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     m_classCreators[classId] = creator;
@@ -81,9 +81,6 @@
 
 static bool initStatic = InitializeStaticData();
 
-#define EXCEPTION_CLASS_CREATOR(className) \
-    fact->Register(Foundation_Exception_##className, className::CreateObject);
-
 bool InitializeStaticData()
 {
     MgClassFactory* fact = MgClassFactory::GetInstance();
@@ -98,52 +95,7 @@
     fact->Register(Foundation_Property_StringProperty,MgStringProperty::CreateObject);
     fact->Register(Foundation_Property_PropertyDefinition,MgPropertyDefinition::CreateObject);
 
-    EXCEPTION_CLASS_CREATOR(MgArgumentOutOfRangeException)
-    EXCEPTION_CLASS_CREATOR(MgClassNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgConfigurationException)
-    EXCEPTION_CLASS_CREATOR(MgConfigurationLoadFailedException)
-    EXCEPTION_CLASS_CREATOR(MgConfigurationSaveFailedException)
-    EXCEPTION_CLASS_CREATOR(MgDateTimeException)
-    EXCEPTION_CLASS_CREATOR(MgDecryptionException)
-    EXCEPTION_CLASS_CREATOR(MgDirectoryNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgDivideByZeroException)
-    EXCEPTION_CLASS_CREATOR(MgDomainException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateDirectoryException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateFileException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateObjectException)
-    EXCEPTION_CLASS_CREATOR(MgEncryptionException)
-    EXCEPTION_CLASS_CREATOR(MgFileIoException)
-    EXCEPTION_CLASS_CREATOR(MgFileNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgIndexOutOfRangeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidArgumentException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidCastException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidMimeTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidOperationException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidPropertyTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidStreamHeaderException)
-    EXCEPTION_CLASS_CREATOR(MgIoException)
-    EXCEPTION_CLASS_CREATOR(MgLengthException)
-    EXCEPTION_CLASS_CREATOR(MgLogicException)
-    EXCEPTION_CLASS_CREATOR(MgNotFiniteNumberException)
-    EXCEPTION_CLASS_CREATOR(MgNotImplementedException)
-    EXCEPTION_CLASS_CREATOR(MgNullArgumentException)
-    EXCEPTION_CLASS_CREATOR(MgNullPropertyValueException)
-    EXCEPTION_CLASS_CREATOR(MgNullReferenceException)
-    EXCEPTION_CLASS_CREATOR(MgObjectNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgOutOfMemoryException)
-    EXCEPTION_CLASS_CREATOR(MgOutOfRangeException)
-    EXCEPTION_CLASS_CREATOR(MgOverflowException)
-    EXCEPTION_CLASS_CREATOR(MgPlatformNotSupportedException)
-    EXCEPTION_CLASS_CREATOR(MgResourcesException)
-    EXCEPTION_CLASS_CREATOR(MgResourcesLoadFailedException)
-    EXCEPTION_CLASS_CREATOR(MgResourceTagNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgRuntimeException)
-    EXCEPTION_CLASS_CREATOR(MgStreamIoException)
-    EXCEPTION_CLASS_CREATOR(MgTemporaryFileNotAvailableException)
-    EXCEPTION_CLASS_CREATOR(MgUnclassifiedException)
-    EXCEPTION_CLASS_CREATOR(MgUnderflowException)
-    EXCEPTION_CLASS_CREATOR(MgXmlException)
-    EXCEPTION_CLASS_CREATOR(MgXmlParserException)
+    fact->Register(Foundation_Exception_MgException, MgException::CreateObject);
 
     return true;
 }

Modified: trunk/MgDev/Common/Foundation/System/Configuration.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Configuration.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/Configuration.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -108,7 +108,7 @@
                 MgStringCollection arguments;
                 arguments.Add(fileName);
 
-                throw new MgConfigurationLoadFailedException(
+                throw new MgException(MgExceptionCodes::MgConfigurationLoadFailedException, 
                     L"MgConfiguration.LoadConfiguration",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -154,7 +154,8 @@
         MgStringCollection arguments;
         arguments.Add(fileName);
 
-        throw new MgConfigurationSaveFailedException(
+        throw new MgException(
+            L"MgConfigurationSaveFailedException",
             L"MgConfiguration.SaveConfiguration",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -440,7 +441,7 @@
             else
             {
                 // Everything in the ini file is treated as a string so we should not be here
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException,
                     L"MgConfiguration::GetProperties", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -517,7 +518,7 @@
             else
             {
                 // Everything in the ini file is treated as a string so we should not be here
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException,
                     L"MgConfiguration.SetProperties", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
@@ -528,7 +529,7 @@
         MgStringCollection arguments;
         arguments.Add(section);
 
-        throw new MgConfigurationException(L"MgConfiguration.SetProperties",
+        throw new MgException(MgExceptionCodes::MgConfigurationException, L"MgConfiguration.SetProperties",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -602,7 +603,7 @@
         MgStringCollection arguments;
         arguments.Add(section);
 
-        throw new MgConfigurationException(L"MgConfiguration.RemoveProperties",
+        throw new MgException(MgExceptionCodes::MgConfigurationException, L"MgConfiguration.RemoveProperties",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -702,7 +703,7 @@
 
             if (0.0 == strLength)
             {
-                throw new MgConfigurationException(
+                throw new MgException(MgExceptionCodes::MgConfigurationException, 
                     L"MgConfiguration.ValidateValue",
                     __LINE__, __WFILE__, &whatArguments,
                     L"MgConfigurationPropertyValueIsNotSpecified", &whyArguments);
@@ -717,7 +718,8 @@
 
                 if (minimumValue == maximumValue)
                 {
-                    throw new MgConfigurationException(
+                    throw new MgException(
+                        L"MgConfigurationException",
                         L"MgConfiguration.ValidateValue",
                         __LINE__, __WFILE__, &whatArguments,
                         L"MgConfigurationPropertyLengthIsInvalid", &whyArguments);
@@ -726,7 +728,8 @@
                 {
                     whyArguments.Add(maximumValue);
 
-                    throw new MgConfigurationException(
+                    throw new MgException(
+                        L"MgConfigurationException",
                         L"MgConfiguration.ValidateValue",
                         __LINE__, __WFILE__, &whatArguments,
                         L"MgConfigurationPropertyLengthIsOutOfRange", &whyArguments);
@@ -746,7 +749,7 @@
             whyArguments.Add(value);
             whyArguments.Add(validationInfo->m_reservedCharacters);
 
-            throw new MgConfigurationException(
+            throw new MgException(MgExceptionCodes::MgConfigurationException, 
                 L"MgConfiguration.ValidateValue",
                 __LINE__, __WFILE__, &whatArguments,
                 L"MgConfigurationPropertyValueContainsReservedCharacters", &whyArguments);
@@ -769,7 +772,8 @@
             whyArguments.Add(validationInfo->GetMinimumValue());
             whyArguments.Add(validationInfo->GetMaximumValue());
 
-            throw new MgConfigurationException(
+            throw new MgException(
+                L"MgConfigurationException",
                 L"MgConfiguration.ValidateValue",
                 __LINE__, __WFILE__, &whatArguments,
                 L"MgConfigurationPropertyValueIsOutOfRange", &whyArguments);

Modified: trunk/MgDev/Common/Foundation/System/ConfigurationHeap.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/ConfigurationHeap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/ConfigurationHeap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -37,7 +37,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgConfigImpExp.ImportConfig",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgConfigImpExp.ImportConfig",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -144,7 +144,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgConfigImpExp.ImportConfig",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgConfigImpExp.ImportConfig",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -361,7 +361,7 @@
         section = new MgConfigurationSection(sectionPath);
         if (section == NULL)
         {
-            throw new MgOutOfMemoryException(L"MgConfigurationHeap.AddSection", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgConfigurationHeap.AddSection", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         m_sectionCollection->Add(section);
     }

Modified: trunk/MgDev/Common/Foundation/System/Disposable.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Disposable.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/Disposable.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
         ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgDisposable::Addref(). Class Name: %W. Called with Reference Count = 0.\n"), GetClassName().c_str()));
 #endif
 
-        throw new MgLogicException(L"MgDisposable.AddRef", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgLogicException, L"MgDisposable.AddRef", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return ++m_refCount;
@@ -91,7 +91,7 @@
             ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgDisposable::Release(). Class Name: %W. Called with Reference Count <= 0.\n"), GetClassName().c_str()));
 #endif
 
-            throw new MgLogicException(L"MgDisposable.Release", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgLogicException, L"MgDisposable.Release", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         --m_refCount;

Modified: trunk/MgDev/Common/Foundation/System/DisposableCollection.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/DisposableCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/DisposableCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -78,7 +78,7 @@
 MgDisposable* MgDisposableCollection::GetItem(INT32 index) const
 {
     if (index >= m_size || index < 0)
-        throw new MgIndexOutOfRangeException(L"GetItem",__LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"GetItem",__LINE__, __WFILE__, NULL, L"", NULL);
     // EXC::Create(Exception::NLSGetMessage(_NLSID(_5_INDEXOUTOFBOUNDS)));
 
     return SAFE_ADDREF(m_list[index]);
@@ -101,7 +101,7 @@
         m_list[index] = SAFE_ADDREF(value);
     }
     else
-        throw new MgIndexOutOfRangeException(L"SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
     // EXC::Create(GisException::NLSGetMessage(GIS_NLSID(GIS_5_INDEXOUTOFBOUNDS)));
 }
 
@@ -147,7 +147,7 @@
         m_size++;
     }
     else
-        throw new MgIndexOutOfRangeException(L"Insert", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"Insert", __LINE__, __WFILE__, NULL, L"", NULL);
     // EXC::Create(GisException::NLSGetMessage(GIS_NLSID(GIS_5_INDEXOUTOFBOUNDS)));
 }
 
@@ -221,7 +221,7 @@
         m_list[--m_size] = NULL;
     }
     else
-        throw new MgIndexOutOfRangeException(L"RemoveAt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"RemoveAt", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -281,7 +281,7 @@
 /// </returns>
 MgByteReader* MgDisposableCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"MgDisposableCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgDisposableCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return NULL;
 }
@@ -295,7 +295,7 @@
 /// <returns>Returns nothing.</returns>
 void MgDisposableCollection::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgDisposableCollection.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgDisposableCollection.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -307,7 +307,7 @@
 /// <returns>Returns nothing.</returns>
 void MgDisposableCollection::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgDisposableCollection.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgDisposableCollection.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 

Modified: trunk/MgDev/Common/Foundation/System/FileUtil.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/FileUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/FileUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -68,7 +68,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFileUtil.ValidateFileName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -82,7 +82,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(sm_reservedCharacters);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFileUtil.ValidateFileName",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
@@ -93,7 +93,7 @@
         arguments.Add(L"1");
         arguments.Add(fileName);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFileUtil.ValidateFileName",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -231,7 +231,7 @@
         MgStringCollection arguments;
         arguments.Add(pathname);
 
-        throw new MgFileIoException(L"MgFileUtil.GetFileStatus",
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.GetFileStatus",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -384,7 +384,7 @@
             MgStringCollection arguments;
             arguments.Add(path);
 
-            throw new MgDuplicateDirectoryException(L"MgFileUtil.CreateDirectory",
+            throw new MgException(MgExceptionCodes::MgDuplicateDirectoryException, L"MgFileUtil.CreateDirectory",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -450,7 +450,7 @@
             case EACCES:
             default:
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgFileUtil.MkDir",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.MkDir",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
                 break;
         }
@@ -497,7 +497,7 @@
             case EACCES:
             default:
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgFileUtil.DeleteDirectory",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.DeleteDirectory",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
                 break;
         }
@@ -534,7 +534,7 @@
             MgStringCollection arguments;
             arguments.Add(path);
 
-            throw new MgDirectoryNotFoundException(L"MgFileUtil.CleanDirectory",
+            throw new MgException(MgExceptionCodes::MgDirectoryNotFoundException, L"MgFileUtil.CleanDirectory",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -623,7 +623,7 @@
         MgStringCollection arguments;
         arguments.Add(path);
 
-        throw new MgFileIoException(L"MgFileUtil.ChangeDirectory",
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.ChangeDirectory",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -632,7 +632,7 @@
         MgStringCollection arguments;
         arguments.Add(path);
 
-        throw new MgDirectoryNotFoundException(L"MgFileUtil.ChangeDirectory",
+        throw new MgException(MgExceptionCodes::MgDirectoryNotFoundException, L"MgFileUtil.ChangeDirectory",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -667,7 +667,7 @@
         MgStringCollection arguments;
         arguments.Add(path);
 
-        throw new MgDirectoryNotFoundException(L"MgFileUtil.GetFilesInDirectory",
+        throw new MgException(MgExceptionCodes::MgDirectoryNotFoundException, L"MgFileUtil.GetFilesInDirectory",
             __LINE__, __WFILE__, &arguments, L"", NULL);
 
         return false;
@@ -771,7 +771,7 @@
             MgStringCollection arguments;
             arguments.Add(pathname);
 
-            throw new MgFileNotFoundException(L"MgFileUtil.DeleteFile",
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgFileUtil.DeleteFile",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -792,7 +792,7 @@
             case EACCES:
             default:
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgFileUtil.DeleteFile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.DeleteFile",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
                 break;
         }
@@ -827,7 +827,7 @@
         MgStringCollection arguments;
         arguments.Add(destPathname);
 
-        throw new MgDuplicateFileException(L"MgFileUtil.CopyFile",
+        throw new MgException(MgExceptionCodes::MgDuplicateFileException, L"MgFileUtil.CopyFile",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -840,7 +840,7 @@
         MgStringCollection arguments;
         arguments.Add(destPathname);
 
-        throw new MgDuplicateFileException(L"MgFileUtil.CopyFile",
+        throw new MgException(MgExceptionCodes::MgDuplicateFileException, L"MgFileUtil.CopyFile",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -913,7 +913,7 @@
         MgStringCollection arguments;
         arguments.Add(newPathname);
 
-        throw new MgDuplicateFileException(L"MgFileUtil.RenameFile",
+        throw new MgException(MgExceptionCodes::MgDuplicateFileException, L"MgFileUtil.RenameFile",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -928,7 +928,7 @@
         MgStringCollection arguments;
         arguments.Add(newPathname);
 
-        throw new MgDuplicateFileException(L"MgFileUtil.RenameFile",
+        throw new MgException(MgExceptionCodes::MgDuplicateFileException, L"MgFileUtil.RenameFile",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -947,7 +947,7 @@
         {
             case ENOENT: // File or path specified by oldname not found.
                 arguments.Add(oldPathname);
-                throw new MgFileNotFoundException(L"MgFileUtil.RenameFile",
+                throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgFileUtil.RenameFile",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
                 break;
 
@@ -962,7 +962,7 @@
                 MgStringCollection whyArguments;
                 whyArguments.Add(L"");
 
-                throw new MgInvalidArgumentException(L"MgFileUtil.RenameFile",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFileUtil.RenameFile",
                     __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
             }
                 break;
@@ -974,7 +974,7 @@
             default:
                 arguments.Add(newPathname);
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgFileUtil.RenameFile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgFileUtil.RenameFile",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
                 break;
         }
@@ -1100,7 +1100,7 @@
 
         if (0 == tempFileName)
         {
-            throw new MgTemporaryFileNotAvailableException(
+            throw new MgException(MgExceptionCodes::MgTemporaryFileNotAvailableException,
                 L"MgFileUtil.GenerateTempFileName", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 

Modified: trunk/MgDev/Common/Foundation/System/FoundationClassId.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/FoundationClassId.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/FoundationClassId.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -43,6 +43,9 @@
 #define Foundation_Data_Stream                            FOUNDATION_DATA_ID+8
 
 // Foundation Exception
+//
+// NOTE: Although we removed these exceptions, we are keeping the ids in to prevent these ids from being
+// accidentally used for new classes in the future
 #define Foundation_Exception_MgApplicationException                             FOUNDATION_EXCEPTION_ID+0
 #define Foundation_Exception_MgArgumentOutOfRangeException                      FOUNDATION_EXCEPTION_ID+1
 #define Foundation_Exception_MgClassNotFoundException                           FOUNDATION_EXCEPTION_ID+2

Modified: trunk/MgDev/Common/Foundation/System/GuardDisposable.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/GuardDisposable.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/GuardDisposable.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -40,7 +40,7 @@
         ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgGuardDisposable::Addref(). Class Name: %W. Called with Reference Count = 0.\n"), GetClassName().c_str()));
 #endif
 
-        throw new MgLogicException(L"MgGuardDisposable.AddRef", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgLogicException, L"MgGuardDisposable.AddRef", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return ++m_refCount;
@@ -61,7 +61,7 @@
             ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgGuardDisposable::Release(). Class Name: %W. Called with Reference Count <= 0.\n"), GetClassName().c_str()));
 #endif
 
-            throw new MgLogicException(L"MgGuardDisposable.Release", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgLogicException, L"MgGuardDisposable.Release", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         --m_refCount;

Modified: trunk/MgDev/Common/Foundation/System/MemoryStreamHelper.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/MemoryStreamHelper.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/MemoryStreamHelper.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -29,7 +29,7 @@
 {
     m_curPtrRead = m_curPtrWrite = m_buffer = new INT8[m_blockSize];
     if(m_buffer == NULL)
-        throw new MgOutOfMemoryException(L"MgMemoryStreamHelper.MgMemoryStreamHelper", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgMemoryStreamHelper.MgMemoryStreamHelper", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_endBuffer = m_buffer + m_blockSize;
     m_blockCount = 1;
@@ -255,7 +255,7 @@
         //allocate the new block
         INT8* newBlock = new INT8[newBlockCount * m_blockSize];
         if(!newBlock)
-            throw new MgOutOfMemoryException(L"MgMemoryStreamHelper.WriteBytes", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgMemoryStreamHelper.WriteBytes", __LINE__, __WFILE__, NULL, L"", NULL);
 
         //initialize new block with current stream content
         size_t writePos = m_curPtrWrite - m_buffer;

Modified: trunk/MgDev/Common/Foundation/System/Resources.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Resources.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/Resources.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -311,7 +311,7 @@
             arguments.Add(locale.c_str());
             arguments.Add(MgResources::InvalidExtendedLocale);
 
-            throw new MgResourcesLoadFailedException(L"MgResources.LoadResources",
+            throw new MgException(MgExceptionCodes::MgResourcesLoadFailedException, L"MgResources.LoadResources",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -380,7 +380,7 @@
             arguments.Add(locale.c_str());
             arguments.Add(sCause);
 
-            throw new MgResourcesLoadFailedException(L"MgResources.LoadResources",
+            throw new MgException(MgExceptionCodes::MgResourcesLoadFailedException, L"MgResources.LoadResources",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -523,7 +523,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgResources.FormatMessage",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgResources.FormatMessage",
             __LINE__, __WFILE__, &arguments, L"MgArgumentsMismatch", NULL);
     }
 
@@ -620,7 +620,7 @@
                         STRING sCause = MgResources::FormatMessage(MgResources::NoParentSectionForResourceDirective, &args2);
 
                         arguments.Add(sCause);
-                        throw new MgResourcesLoadFailedException(L"MgResources.ParseFile", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgResourcesLoadFailedException, L"MgResources.ParseFile", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
             }

Modified: trunk/MgDev/Common/Foundation/System/StreamHelper.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/StreamHelper.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/StreamHelper.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -121,7 +121,7 @@
     }
     else
     {
-        throw new MgStreamIoException(L"MgStreamHelper.GetString", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgStreamHelper.GetString", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
         stat = MgStreamHelper::mssError;
     }
 

Modified: trunk/MgDev/Common/Foundation/System/StreamParser.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/StreamParser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/StreamParser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,12 +82,12 @@
         {
             // The stream may contain garbage when the connection is dropped for
             // some reason. This exception may be ignored to reduce noise.
-            throw new MgInvalidStreamHeaderException(L"MgStreamParser.ParseStreamHeader",
+            throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamParser.ParseStreamHeader",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else if (MgStreamParser::StreamVersion != pStreamData->GetVersion())
         {
-            throw new MgStreamIoException(L"MgStreamParser.ParseStreamHeader",
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgStreamParser.ParseStreamHeader",
                 __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
         }
     }

Modified: trunk/MgDev/Common/Foundation/System/StreamReader.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/StreamReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/StreamReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,7 +77,7 @@
 void MgStreamReader::GetOperationHeader(MgOperationPacket& operPacket)
 {
     MG_TRY()
-        throw new MgNotImplementedException(L"MgStreamReader.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgStreamReader.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgStreamReader.GetOperationHeader")
 }
 
@@ -92,7 +92,7 @@
 void MgStreamReader::GetOperationResponseHeader(MgOperationResponsePacket& mop)
 {
     MG_TRY()
-        throw new MgNotImplementedException(L"MgStreamReader.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgStreamReader.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgStreamReader.GetOperationResponseHeader")
 }
 
@@ -153,7 +153,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matString)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetString",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetString",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -179,7 +179,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT64)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetInt64",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -205,7 +205,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT32)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetInt32",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -233,7 +233,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT16)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetInt16",
         __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -262,7 +262,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matFloat)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetSingle",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -288,7 +288,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matDouble)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetDouble",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -314,7 +314,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT8)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetBoolean",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -342,7 +342,7 @@
 
     if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT8)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetByte",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -373,7 +373,7 @@
 
     if (bsap.m_ArgumentType != (UINT32)MgPacketParser::mphArgumentBinaryStream)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetStream",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetStream",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -415,13 +415,13 @@
             if (errno == EEXIST)
             {
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileNotFoundException(L"MgStreamReader.GetStream",
+                throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgStreamReader.GetStream",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
             }
             else
             {
                 MG_FILE_IO_EXCEPTION_ADD_ERRNO();
-                throw new MgFileIoException(L"MgStreamReader.GetStream",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgStreamReader.GetStream",
                     __LINE__, __WFILE__, &arguments, L"MgFileIoErrNo", &errNoArgs);
             }
         }
@@ -528,7 +528,7 @@
 
     if ((UINT32)MgPacketParser::matClassId != map.m_ArgumentType)
     {
-        throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetClassId",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetClassId",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -552,7 +552,7 @@
 
     if ( MgStreamParser::mshStreamEnd != dataRead )
     {
-        throw new MgInvalidStreamHeaderException( L"MgStreamReader.GetStreamEnd",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgStreamReader.GetStreamEnd",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/Foundation/System/StreamWriter.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/StreamWriter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/StreamWriter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -73,7 +73,7 @@
     MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
 
     MG_TRY()
-        throw new MgNotImplementedException(L"MgStreamWriter.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgStreamWriter.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgStreamWriter.WriteOperationHeader")
 
     return stat;

Modified: trunk/MgDev/Common/Foundation/System/Util.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Util.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/Util.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -187,7 +187,7 @@
         arguments.Add(L"1");
         arguments.Add(wcStr);
 
-        throw new MgInvalidArgumentException(L"MgUtil.WideCharToMultiByte",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUtil.WideCharToMultiByte",
             __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
     }
 }
@@ -226,7 +226,7 @@
         arguments.Add(L"1");
         arguments.Add((NULL == wcBuf) ? L"" : wcBuf);
 
-        throw new MgInvalidArgumentException(L"MgUtil.WideCharToMultiByte",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUtil.WideCharToMultiByte",
             __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
     }
 
@@ -292,7 +292,7 @@
         arguments.Add(L"1");
         arguments.Add(L"const string&");
 
-        throw new MgInvalidArgumentException(L"MgUtil.WideCharToMultiByte",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUtil.WideCharToMultiByte",
             __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
     }
 }
@@ -331,7 +331,7 @@
         arguments.Add(L"1");
         arguments.Add(L"const char*");
 
-        throw new MgInvalidArgumentException(L"MgUtil.WideCharToMultiByte",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUtil.WideCharToMultiByte",
             __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
     }
 
@@ -490,7 +490,7 @@
             MgStringCollection whyArguments;
             whyArguments.Add(reservedChars);
 
-            throw new MgInvalidArgumentException(L"CheckReseveredCharater",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"CheckReseveredCharater",
                 __LINE__,  __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
         }
     }
@@ -536,7 +536,7 @@
             arguments.Add(L"1");
             arguments.Add(str);
 
-            throw new MgInvalidArgumentException(L"MgUtil.CheckBeginEnd",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUtil.CheckBeginEnd",
                 __LINE__,  __WFILE__, &arguments, L"MgInvalidStringTrim", NULL);
         }
     }
@@ -758,7 +758,7 @@
 
     if (0 == str)
     {
-        throw new MgOutOfMemoryException(L"MgUtil.GenerateUuid",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgUtil.GenerateUuid",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -847,7 +847,7 @@
 
     #ifdef _WIN32
 
-        throw new MgPlatformNotSupportedException(L"MgUtil.GetLinuxMemoryStatus", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgPlatformNotSupportedException, L"MgUtil.GetLinuxMemoryStatus", __LINE__, __WFILE__, NULL, L"", NULL);
 
     #else
 
@@ -861,7 +861,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(MgUtil::LinuxFilesystemMeminfo);
-            throw new MgFileNotFoundException(L"MgUtil.GetLinuxMemoryStatus", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgUtil.GetLinuxMemoryStatus", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         /*

Modified: trunk/MgDev/Common/Foundation/System/Util.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/Util.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/Util.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -612,8 +612,8 @@
 {                        \
     MgStringCollection args; \
     args.Add(L###pointer); \
-    throw new MgNullReferenceException(methodname, \
-                                       __LINE__, __WFILE__, NULL, L"MgNullPointer", &args); \
+    throw new MgException(MgExceptionCodes::MgNullReferenceException, methodname, \
+        __LINE__, __WFILE__, NULL, L"MgNullPointer", &args); \
 }
 
 #define CHECKARGUMENTNULL(pointer, methodname)      \
@@ -621,8 +621,8 @@
 {                        \
     MgStringCollection args; \
     args.Add(L###pointer); \
-    throw new MgNullArgumentException(methodname, \
-                                       __LINE__, __WFILE__, NULL, L"MgNullArgument", &args); \
+    throw new MgException(MgExceptionCodes::MgNullArgumentException, methodname, \
+        __LINE__, __WFILE__, NULL, L"MgNullArgument", &args); \
 }
 
 #define CHECKARGUMENTEMPTYSTRING(str, methodname)      \
@@ -630,8 +630,8 @@
 {                        \
     MgStringCollection args; \
     args.Add(L###str); \
-    throw new MgInvalidArgumentException(methodname, \
-                                         __LINE__, __WFILE__, NULL, L"MgEmptyStringArgument", &args); \
+    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, methodname, \
+        __LINE__, __WFILE__, NULL, L"MgEmptyStringArgument", &args); \
 }
 
 #define MG_CHECK_RANGE(value, min, max, methodName)                           \
@@ -646,8 +646,8 @@
             MgStringCollection args;                                          \
             args.Add(minStr.str());                                           \
             args.Add(maxStr.str());                                           \
-            args.Add(L###value);                                                \
-            throw new MgArgumentOutOfRangeException(                          \
+            args.Add(L###value);                                              \
+            throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException,           \
                 methodName, __LINE__, __WFILE__, NULL, L"MgArgumentOutOfRange", &args); \
         }                                                                     \
         else if (value < min)                                                 \

Modified: trunk/MgDev/Common/Foundation/System/XmlDefs.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/XmlDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/XmlDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -81,13 +81,13 @@
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(X2W(e.getMessage()));                                   \
-        mgException = new MgXmlParserException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(L"MgXmlParserException", methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
     }                                                                         \
     catch (const DOMException& e)                                             \
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(X2W(e.msg));                                            \
-        mgException = new MgXmlParserException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(L"MgXmlParserException", methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Common/Foundation/System/XmlUtil.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/XmlUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Foundation/System/XmlUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -321,7 +321,7 @@
     CHECKARGUMENTNULL(elementName, L"MgXmlUtil.GetNodeList");
     if (0 == ::strlen(elementName))
     {
-        throw new MgNullArgumentException(L"MgXmlUtil.GetNodeList",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgXmlUtil.GetNodeList",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -346,7 +346,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgXmlUtil.GetNodeList",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgXmlUtil.GetNodeList",
             __LINE__, __WFILE__, &arguments, L"MgInvalidNode", NULL);
     }
 
@@ -403,7 +403,7 @@
     CHECKARGUMENTNULL(elementName, L"MgXmlUtil.GetElementNode");
     if (0 == ::strlen(elementName))
     {
-        throw new MgNullArgumentException(L"MgXmlUtil.GetElementNode",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgXmlUtil.GetElementNode",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -424,7 +424,7 @@
     }
     else if (required)
     {
-        throw new MgXmlParserException(L"MgXmlUtil.GetElementNode",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgXmlUtil.GetElementNode",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else
@@ -479,7 +479,7 @@
 
     if (NULL == elementNode && required)
     {
-        throw new MgXmlParserException(L"MgXmlUtil.GetElementNode",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgXmlUtil.GetElementNode",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -530,7 +530,7 @@
     {
         if (required)
         {
-            throw new MgXmlParserException(L"MgXmlUtil.GetElementValue",
+            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgXmlUtil.GetElementValue",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -589,7 +589,7 @@
     }
     else
     {
-        throw new MgXmlParserException(L"MgXmlUtil.GetElementValue",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgXmlUtil.GetElementValue",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -640,7 +640,7 @@
 
     if (NULL == textNode)
     {
-        throw new MgXmlParserException(L"MgXmlUtil.SetElementValue",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgXmlUtil.SetElementValue",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (elementValue != X2W(textNode->getNodeValue()))

Modified: trunk/MgDev/Common/Geometry/AgfStream.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/AgfStream.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/AgfStream.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -158,116 +158,116 @@
 //
 void MgAgfStream::GetStreamHeader(MgStreamHeader& msh)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetOperationHeader(MgOperationPacket& operPacket)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetOperationResponseHeader(MgOperationResponsePacket& mop)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetArgumentHeader(MgArgumentPacket& map)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgByteReader* MgAgfStream::GetStream()
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetStream", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetStream", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::GetData(void* value, INT32 length)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetData", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetData", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetClassId(INT32& value)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetClassId", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetClassId", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetStreamEnd()
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
 MgObject* MgAgfStream::GetObject()
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetObject", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetObject", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgAgfStream::GetString(REFSTRING wcStr)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.GetString", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.GetString", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteStreamHeader(MgStreamHeader& msh)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteOperationHeader(MgOperationPacket& operPacket)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteOperationResponseHeader( MgOperationResponsePacket& mop )
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteArgumentHeader(MgArgumentPacket& map)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteString(CREFSTRING value)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteString", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteString", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteStream(MgByteReader* byteReader)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteStream", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteStream", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteClassId(INT32 value)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteClassId", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteClassId", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteStreamEnd()
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteObject(MgObject* obj)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteObject", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteObject", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteResponseHeader(MgPacketParser::MgECode eCode, UINT32 noOfRetValues)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgStreamHelper::MgStreamStatus MgAgfStream::WriteControlPacket(MgControlPacket& packet)
 {
-    throw new MgNotImplementedException(L"MgAgfStream.WriteControlPacket", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgAgfStream.WriteControlPacket", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/Geometry/ArcSegment.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/ArcSegment.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/ArcSegment.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -132,7 +132,7 @@
 {
     //should not be called on geometry components
     //components are serialized by the containing geometries
-    throw new MgNotImplementedException(L"MgArcSegment.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgArcSegment.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -142,7 +142,7 @@
 {
     //should not be called on geometry components
     //components are deserialized by the containing geometries
-    throw new MgNotImplementedException(L"MgArcSegment.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgArcSegment.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -182,7 +182,7 @@
                 arguments.Add(L"2");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgBuffer.BufferGeometry",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgBuffer.BufferGeometry",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryType", NULL);
             }
         }

Modified: trunk/MgDev/Common/Geometry/Buffer/oobject.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/oobject.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Buffer/oobject.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -55,7 +55,7 @@
 
     if (!memPtr)
     {
-        throw new MgOutOfMemoryException(L"OpsObject.AllocMem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"OpsObject.AllocMem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return memPtr;
@@ -94,7 +94,7 @@
     void *newMemPtr = ::realloc(memPtr, nBytes);
     if (!newMemPtr && nBytes != 0)
     {
-        throw new MgOutOfMemoryException(L"OpsObject.ReallocMem", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"OpsObject.ReallocMem", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     return newMemPtr;
 

Modified: trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -79,7 +79,7 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.MgCoordinateSystemFactory", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.MgCoordinateSystemFactory", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.MgCoordinateSystemFactory")
@@ -106,7 +106,7 @@
 
     if (NULL == sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgCoordinateSystemFactory.Create",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -144,7 +144,7 @@
 
     if (NULL == sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgCoordinateSystemFactory.CreateFromCode",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -201,7 +201,7 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.GetCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.GetCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.GetCatalog")
 
@@ -216,7 +216,7 @@
     pNew=new CCoordinateSystemTransform(pSource, pTarget);
     if (NULL == pNew)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetTransform", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetTransform", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.GetTransform")
 
@@ -243,12 +243,12 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     code=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Unknown, wkt, MgCoordinateSystemCodeFormat::Mentor);
 
@@ -276,12 +276,12 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Check to see if this is an EPSG code. ie: "EPSG:4326"
@@ -319,27 +319,27 @@
     categoryNames = new MgStringCollection();
     if (!categoryNames)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ToString", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=sm_pCatalog->GetCategoryDictionary();
     if (!pCtDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
     }
     Ptr<MgCoordinateSystemEnum> pEnum=pCtDict->GetEnum();
     if (!pEnum)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     UINT32 nNbCategories=pCtDict->GetSize();
     categoryNames=pEnum->NextName(nNbCategories);
     if (categoryNames->GetCount()!=nNbCategories)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.EnumerateCategories")
@@ -367,26 +367,26 @@
     pCoordinateSystems = new MgBatchPropertyCollection();
     if (!pCoordinateSystems)
     {
-        throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=sm_pCatalog->GetCategoryDictionary();
     if (!pCtDict)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
     }
     Ptr<MgCoordinateSystemCategory> pCategory=pCtDict->GetCategory(category);
     if (!pCategory)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryInDictionaryException", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryInDictionaryException", NULL);
     }
     Ptr<MgCoordinateSystemEnum> pEnum=pCategory->GetEnum();
     if (!pEnum)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     for ( ; ; )
@@ -463,12 +463,12 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     wchar_t wszEpsg[255];
     #ifdef _WIN32
@@ -502,12 +502,12 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING strEpsgCode=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Unknown, wkt, MgCoordinateSystemCodeFormat::Epsg);
     nEpsg = (INT32)wcstol(strEpsgCode.c_str(), NULL, 10);
@@ -536,13 +536,13 @@
 
     if (!sm_pCatalog)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
     if (!pConverter)
     {
-        throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     try
@@ -592,7 +592,7 @@
             // Check the consistency of all these parameters.
             if (!gridSpecification->IsConsistent ())
             {
-                throw new MgInvalidArgumentException(L"MgCoordinateSystemFactory.GridSpecification", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCoordinateSystemFactory.GridSpecification", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
     MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.GridSpecification")
@@ -666,7 +666,7 @@
     {
         if (bSetExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetMgrs", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetMgrs", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -695,7 +695,7 @@
     {
         if (bSetExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetMgrsEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetMgrsEllipsoid", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -724,7 +724,7 @@
     {
         if (bSetExceptionsOn)
         {
-            throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -768,7 +768,7 @@
         {
             if (bSetExceptionsOn)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             else
             {
@@ -818,7 +818,7 @@
         {
             if (bSetExceptionsOn)
             {
-                throw new MgOutOfMemoryException(L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgCoordinateSystemFactory.GetMgrsDatum", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             else
             {

Modified: trunk/MgDev/Common/Geometry/CurvePolygon.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/CurvePolygon.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/CurvePolygon.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
 MgCurveRing* MgCurvePolygon::GetInteriorRing(INT32 index)
 {
     if (m_innerRings == NULL)
-        throw new MgArgumentOutOfRangeException(L"MgCurvePolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgCurvePolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return m_innerRings->GetItem(index);
 }

Modified: trunk/MgDev/Common/Geometry/CurveRing.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/CurveRing.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/CurveRing.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -147,7 +147,7 @@
 {
     //should not be called on geometry components
     //components are serialized by the containing geometries
-    throw new MgNotImplementedException(L"MgCurveRing.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgCurveRing.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -157,7 +157,7 @@
 {
     //should not be called on geometry components
     //components are deserialized by the containing geometries
-    throw new MgNotImplementedException(L"MgCurveRing.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgCurveRing.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/Geometry/CurveString.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/CurveString.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/CurveString.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,7 +32,7 @@
         arguments.Add(L"1");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgCurveString.MgCurveString",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCurveString.MgCurveString",
             __LINE__, __WFILE__, &arguments, L"MgGeometryEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/Geometry/Envelope.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Envelope.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Envelope.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgEnvelope.MgEnvelope",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgEnvelope.MgEnvelope",
             __LINE__, __WFILE__, &arguments, L"MgCoordinateDimensionDifferent", NULL);
     }
 
@@ -78,7 +78,7 @@
             arguments.Add(L"2");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgEnvelope.MgEnvelope",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgEnvelope.MgEnvelope",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
         }
 
@@ -100,7 +100,7 @@
             arguments.Add(L"2");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgEnvelope.MgEnvelope",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgEnvelope.MgEnvelope",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
         }
 
@@ -139,7 +139,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgEnvelope.MgEnvelope",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgEnvelope.MgEnvelope",
             __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
     }
 
@@ -155,7 +155,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgEnvelope.MgEnvelope",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgEnvelope.MgEnvelope",
             __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
     }
 
@@ -273,11 +273,11 @@
 
         Ptr<MgCoordinateXY> ll = new MgCoordinateXY(llx, lly);
         if(ll == NULL)
-            throw new MgOutOfMemoryException(L"MgEnvelope.ExpandToInclude", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgEnvelope.ExpandToInclude", __LINE__, __WFILE__, NULL, L"", NULL);
 
         Ptr<MgCoordinateXY> ur = new MgCoordinateXY(urx, ury);
         if(ur == NULL)
-            throw new MgOutOfMemoryException(L"MgEnvelope.ExpandToInclude", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgEnvelope.ExpandToInclude", __LINE__, __WFILE__, NULL, L"", NULL);
 
         m_lowerLeft  = SAFE_ADDREF((MgCoordinate*)ll);
         m_upperRight = SAFE_ADDREF((MgCoordinate*)ur);
@@ -443,11 +443,11 @@
 
         Ptr<MgCoordinateXY> ll = new MgCoordinateXY(minX, minY);
         if (ll == NULL)
-            throw new MgOutOfMemoryException(L"MgEnvelope.Grow", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgEnvelope.Grow", __LINE__, __WFILE__, NULL, L"", NULL);
 
         Ptr<MgCoordinateXY> ur = new MgCoordinateXY(maxX, maxY);
         if (ur == NULL)
-            throw new MgOutOfMemoryException(L"MgEnvelope.Grow", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgEnvelope.Grow", __LINE__, __WFILE__, NULL, L"", NULL);
 
         m_lowerLeft  = SAFE_ADDREF((MgCoordinate*)ll);
         m_upperRight = SAFE_ADDREF((MgCoordinate*)ur);

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemComputationFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemComputationFailedException object.
-///
-MgCoordinateSystemComputationFailedException::MgCoordinateSystemComputationFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemComputationFailedException::~MgCoordinateSystemComputationFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemComputationFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_COORDINATE_SYSTEM_COMPUTATION_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_COMPUTATION_FAILED_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a coordinate system computation fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemComputationFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemComputationFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemComputationFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemComputationFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemConversionFailedException object.
-    ///
-    virtual ~MgCoordinateSystemComputationFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemComputationFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemComputationFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemConversionFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemConversionFailedException object.
-///
-MgCoordinateSystemConversionFailedException::MgCoordinateSystemConversionFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemConversionFailedException::~MgCoordinateSystemConversionFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemConversionFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_COORDINATE_SYSTEM_CONVERSION_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_CONVERSION_FAILED_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a coordinate system conversion fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemConversionFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemConversionFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemConversionFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemConversionFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemConversionFailedException object.
-    ///
-    virtual ~MgCoordinateSystemConversionFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemConversionFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemConversionFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemInitializationFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemInitializationFailedException object.
-///
-MgCoordinateSystemInitializationFailedException::MgCoordinateSystemInitializationFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemInitializationFailedException::~MgCoordinateSystemInitializationFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,68 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_COORDINATE_SYSTEM_INITIALIZATION_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_INITIALIZATION_FAILED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// The exception is thrown when the coordinate system initialization fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemInitializationFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemInitializationFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemInitializationFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemInitializationFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemInitializationFailedException object.
-    ///
-    virtual ~MgCoordinateSystemInitializationFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemInitializationFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemInitializationFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemLoadFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemLoadFailedException object.
-///
-MgCoordinateSystemLoadFailedException::MgCoordinateSystemLoadFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemLoadFailedException::~MgCoordinateSystemLoadFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemLoadFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,68 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_COORDINATE_SYSTEM_LOAD_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_LOAD_FAILED_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// The exception is thrown when the coordinate system load fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemLoadFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemLoadFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemLoadFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemLoadFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemLoadFailedException object.
-    ///
-    virtual ~MgCoordinateSystemLoadFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemLoadFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemLoadFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemMeasureFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemMeasureFailedException object.
-///
-MgCoordinateSystemMeasureFailedException::MgCoordinateSystemMeasureFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemMeasureFailedException::~MgCoordinateSystemMeasureFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_COORDINATE_SYSTEM_MEASURE_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_MEASURE_FAILED_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a coordinate system measurement fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemMeasureFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemMeasureFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemMeasureFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemMeasureFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemConversionFailedException object.
-    ///
-    virtual ~MgCoordinateSystemMeasureFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemMeasureFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemMeasureFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgCoordinateSystemTransformFailedException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgCoordinateSystemTransformFailedException object.
-///
-MgCoordinateSystemTransformFailedException::MgCoordinateSystemTransformFailedException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgCoordinateSystemTransformFailedException::~MgCoordinateSystemTransformFailedException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/CoordinateSystemTransformFailedException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_COORDINATE_SYSTEM_TRANSFORM_FAILED_EXCEPTION_H_
-#define MG_COORDINATE_SYSTEM_TRANSFORM_FAILED_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when a coordinate system transform fails.
-///
-class MG_GEOMETRY_API MgCoordinateSystemTransformFailedException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgCoordinateSystemTransformFailedException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgCoordinateSystemTransformFailedException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgCoordinateSystemTransformFailedException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgCoordinateSystemTransformFailedException object.
-    ///
-    virtual ~MgCoordinateSystemTransformFailedException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgCoordinateSystemTransformFailedException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgCoordinateSystemTransformFailedException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/GeometryException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/GeometryException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/GeometryException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgGeometryException, MgThirdPartyException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgGeometryException object.
-///
-MgGeometryException::MgGeometryException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgThirdPartyException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgGeometryException::~MgGeometryException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/GeometryException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/GeometryException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/GeometryException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_GEOMETRY_EXCEPTION_H_
-#define MG_GEOMETRY_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when an error occurs calculating geometry.
-///
-class MG_GEOMETRY_API MgGeometryException : public MgThirdPartyException
-{
-    DECLARE_CLASSNAME(MgGeometryException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgGeometryException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgGeometryException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgGeometryException object.
-    ///
-    virtual ~MgGeometryException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgGeometryException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgGeometryException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidCoordinateSystemException object.
-///
-MgInvalidCoordinateSystemException::MgInvalidCoordinateSystemException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidCoordinateSystemException::~MgInvalidCoordinateSystemException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_INVALID_COORDINATE_SYSTEM_EXCEPTION_H_
-#define MG_INVALID_COORDINATE_SYSTEM_EXCEPTION_H_
-
-/// \ingroup Exceptions_Module
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when the Coordinate System API encounters a problem.
-///
-class MG_GEOMETRY_API MgInvalidCoordinateSystemException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgInvalidCoordinateSystemException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidCoordinateSystemException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidCoordinateSystemException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidCoordinateSystemException object.
-    ///
-    virtual ~MgInvalidCoordinateSystemException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgInvalidCoordinateSystemException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemTypeException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidCoordinateSystemTypeException object.
-///
-MgInvalidCoordinateSystemTypeException::MgInvalidCoordinateSystemTypeException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidCoordinateSystemTypeException::~MgInvalidCoordinateSystemTypeException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_INVALID_COORDINATE_SYSTEM_TYPE_EXCEPTION_H_
-#define MG_INVALID_COORDINATE_SYSTEM_TYPE_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when the coordinate system type is invalid.
-///
-class MG_GEOMETRY_API MgInvalidCoordinateSystemTypeException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgInvalidCoordinateSystemTypeException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidCoordinateSystemTypeException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidCoordinateSystemTypeException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidCoordinateSystemTypeException object.
-    ///
-    virtual ~MgInvalidCoordinateSystemTypeException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemTypeException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgInvalidCoordinateSystemTypeException;
-};
-
-#endif

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,40 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "Foundation.h"
-
-IMPLEMENT_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemUnitsException, MgApplicationException)
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Construct a MgInvalidCoordinateSystemUnitsException object.
-///
-MgInvalidCoordinateSystemUnitsException::MgInvalidCoordinateSystemUnitsException(CREFSTRING methodName,
-    INT32 lineNumber, CREFSTRING fileName, MgStringCollection* whatArguments,
-    CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
-    MgApplicationException(methodName, lineNumber, fileName,
-        whatArguments, whyMessageId, whyArguments)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destruct the object.
-///
-MgInvalidCoordinateSystemUnitsException::~MgInvalidCoordinateSystemUnitsException() throw()
-{
-}

Deleted: trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h
===================================================================
--- trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,69 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-/// \ingroup Exceptions_Module
-
-#ifndef MG_INVALID_COORDINATE_SYSTEM_UNITS_EXCEPTION_H_
-#define MG_INVALID_COORDINATE_SYSTEM_UNITS_EXCEPTION_H_
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Thrown when the coordinate system units are invalid.
-///
-class MG_GEOMETRY_API MgInvalidCoordinateSystemUnitsException : public MgApplicationException
-{
-    DECLARE_CLASSNAME(MgInvalidCoordinateSystemUnitsException)
-
-EXTERNAL_API:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Construct a MgInvalidCoordinateSystemUnitsException object.
-    ///
-    /// \param methodName
-    /// Name of the method where the exception occurred.
-    /// \param lineNumber
-    /// Line number where the exception occurred.
-    /// \param fileName
-    /// File name where the exception occurred.
-    /// \param whatArguments
-    /// Collection of arguments used to format the message that describes what the exception is.
-    /// \param whyMessageId
-    /// ID of the message that describes why the exception occurs.
-    /// \param whyArguments
-    /// Collection of arguments used to format the message that describes why the exception occurs.
-    ///
-    MgInvalidCoordinateSystemUnitsException(CREFSTRING methodName, INT32 lineNumber,
-        CREFSTRING fileName, MgStringCollection* whatArguments,
-        CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Destructor for a MgInvalidCoordinateSystemUnitsException object.
-    ///
-    virtual ~MgInvalidCoordinateSystemUnitsException() throw();
-
-INTERNAL_API:
-
-    DECLARE_EXCEPTION_DEFAULTS(MgInvalidCoordinateSystemUnitsException)
-
-CLASS_ID:
-
-    static const INT32 m_cls_id = Geometry_Exception_MgInvalidCoordinateSystemUnitsException;
-};
-
-#endif

Modified: trunk/MgDev/Common/Geometry/GeometricEntity.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/GeometricEntity.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometricEntity.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -31,7 +31,7 @@
 //
 MgGeometricPathIterator* MgGeometricEntity::GetPath()
 {
-    throw new MgNotImplementedException(L"MgGeometricEntityImpl.GetPath", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgGeometricEntityImpl.GetPath", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/Geometry/Geometry.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Geometry.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Geometry.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -143,7 +143,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgGeometry.Buffer",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgGeometry.Buffer",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeZero", NULL);
     }
 

Modified: trunk/MgDev/Common/Geometry/Geometry.vcxproj
===================================================================
--- trunk/MgDev/Common/Geometry/Geometry.vcxproj	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Geometry.vcxproj	2022-10-10 09:40:18 UTC (rev 9971)
@@ -390,66 +390,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemComputationFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemConversionFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemInitializationFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemLoadFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemMeasureFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemTransformFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\GeometryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="GeometrySimplifier.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
@@ -894,16 +834,6 @@
     <ClInclude Include="Buffer\wingedge.h" />
     <ClInclude Include="Buffer\worklist.h" />
     <ClInclude Include="Buffer\xordtree.h" />
-    <ClInclude Include="Exception\CoordinateSystemComputationFailedException.h" />
-    <ClInclude Include="Exception\CoordinateSystemConversionFailedException.h" />
-    <ClInclude Include="Exception\CoordinateSystemInitializationFailedException.h" />
-    <ClInclude Include="Exception\CoordinateSystemLoadFailedException.h" />
-    <ClInclude Include="Exception\CoordinateSystemMeasureFailedException.h" />
-    <ClInclude Include="Exception\CoordinateSystemTransformFailedException.h" />
-    <ClInclude Include="Exception\GeometryException.h" />
-    <ClInclude Include="Exception\InvalidCoordinateSystemException.h" />
-    <ClInclude Include="Exception\InvalidCoordinateSystemTypeException.h" />
-    <ClInclude Include="Exception\InvalidCoordinateSystemUnitsException.h" />
     <ClInclude Include="GeometrySimplifier.h" />
     <ClInclude Include="GeometrySimplificationAlgorithmType.h" />
     <ClInclude Include="GeosInclude.h" />

Modified: trunk/MgDev/Common/Geometry/Geometry.vcxproj.filters
===================================================================
--- trunk/MgDev/Common/Geometry/Geometry.vcxproj.filters	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Geometry.vcxproj.filters	2022-10-10 09:40:18 UTC (rev 9971)
@@ -4,9 +4,6 @@
     <Filter Include="Buffer">
       <UniqueIdentifier>{56bc0c4e-6931-49c4-97b5-fe957c164eba}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Exception">
-      <UniqueIdentifier>{47d9650a-b1ea-478c-94f5-afbd136dda2b}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Parse">
       <UniqueIdentifier>{9be50487-b080-45ca-9ee4-edd823e4210e}</UniqueIdentifier>
     </Filter>
@@ -120,36 +117,6 @@
     <ClCompile Include="Buffer\xordtree.cpp">
       <Filter>Buffer</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemComputationFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemConversionFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemInitializationFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemLoadFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemMeasureFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\CoordinateSystemTransformFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\GeometryException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidCoordinateSystemUnitsException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Parse\ArrayHelper.cpp">
       <Filter>Parse</Filter>
     </ClCompile>
@@ -508,36 +475,6 @@
     <ClInclude Include="Buffer\xordtree.h">
       <Filter>Buffer</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemComputationFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemConversionFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemInitializationFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemLoadFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemMeasureFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\CoordinateSystemTransformFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\GeometryException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidCoordinateSystemException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidCoordinateSystemTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidCoordinateSystemUnitsException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Parse\Array.h">
       <Filter>Parse</Filter>
     </ClInclude>

Modified: trunk/MgDev/Common/Geometry/GeometryBuild.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/GeometryBuild.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometryBuild.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -121,15 +121,4 @@
 #include "CoordinateSystem/CoordinateSystemCache.cpp"
 #include "CoordinateSystem/CoordinateSystemFactory.cpp"
 
-#include "Exception/CoordinateSystemComputationFailedException.cpp"
-#include "Exception/CoordinateSystemConversionFailedException.cpp"
-#include "Exception/CoordinateSystemInitializationFailedException.cpp"
-#include "Exception/CoordinateSystemLoadFailedException.cpp"
-#include "Exception/CoordinateSystemMeasureFailedException.cpp"
-#include "Exception/CoordinateSystemTransformFailedException.cpp"
-#include "Exception/GeometryException.cpp"
-#include "Exception/InvalidCoordinateSystemException.cpp"
-#include "Exception/InvalidCoordinateSystemTypeException.cpp"
-#include "Exception/InvalidCoordinateSystemUnitsException.cpp"
-
 #include "GeometryClassFactory.cpp"

Modified: trunk/MgDev/Common/Geometry/GeometryClassFactory.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/GeometryClassFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometryClassFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -48,17 +48,6 @@
     fact->Register(Geometry_CoordinateXYZM, MgCoordinateXYZM::CreateObject);
     fact->Register(Geometry_CoordinateXYM, MgCoordinateXYM::CreateObject);
 
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemComputationFailedException)
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemConversionFailedException)
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemInitializationFailedException)
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemLoadFailedException)
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemMeasureFailedException)
-    EXCEPTION_CLASS_CREATOR(MgCoordinateSystemTransformFailedException)
-    EXCEPTION_CLASS_CREATOR(MgGeometryException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidCoordinateSystemException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidCoordinateSystemTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidCoordinateSystemUnitsException)
-
     return true;
 }
 

Modified: trunk/MgDev/Common/Geometry/GeometryClassId.h
===================================================================
--- trunk/MgDev/Common/Geometry/GeometryClassId.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometryClassId.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -135,6 +135,9 @@
 #define CoordinateSystem_CoordinateSystemGeodeticStandaloneTransformDefParams           GEOMETRY_COORDINATE_SYSTEM_ID+46
 
 // Exceptions
+//
+// NOTE: Although we removed these exceptions, we are keeping the ids in to prevent these ids from being
+// accidentally used for new classes in the future
 #define Geometry_Exception_MgCoordinateSystemComputationFailedException     GEOMETRY_EXCEPTION_ID+0
 #define Geometry_Exception_MgCoordinateSystemConversionFailedException      GEOMETRY_EXCEPTION_ID+1
 #define Geometry_Exception_MgCoordinateSystemInitializationFailedException  GEOMETRY_EXCEPTION_ID+2

Modified: trunk/MgDev/Common/Geometry/GeometryCommon.h
===================================================================
--- trunk/MgDev/Common/Geometry/GeometryCommon.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometryCommon.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -169,17 +169,6 @@
 #include "CoordinateSystem/CoordinateSystemMgrs.h"                          //for MgCoordinateSystemMgrs
 #include "CoordinateSystem/CoordinateSystemFactory.h"
 
-#include "Exception/CoordinateSystemComputationFailedException.h"
-#include "Exception/CoordinateSystemConversionFailedException.h"
-#include "Exception/CoordinateSystemInitializationFailedException.h"
-#include "Exception/CoordinateSystemLoadFailedException.h"
-#include "Exception/CoordinateSystemMeasureFailedException.h"
-#include "Exception/CoordinateSystemTransformFailedException.h"
-#include "Exception/GeometryException.h"
-#include "Exception/InvalidCoordinateSystemException.h"
-#include "Exception/InvalidCoordinateSystemTypeException.h"
-#include "Exception/InvalidCoordinateSystemUnitsException.h"
-
 // Represent NAN for double
 #define DoubleNan std::numeric_limits<double>::quiet_NaN()
 

Modified: trunk/MgDev/Common/Geometry/GeometrySimplifier.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/GeometrySimplifier.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/GeometrySimplifier.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -41,7 +41,7 @@
     if (algorithm != MgGeometrySimplificationAlgorithmType::DouglasPeucker &&
         algorithm != MgGeometrySimplificationAlgorithmType::TopologyPreserving)
     {
-        throw new MgInvalidArgumentException(L"MgGeometrySimplifier.Simplify", __LINE__, __WFILE__, NULL, L"MgInvalidGeometrySimplficationAlgorithm", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgGeometrySimplifier.Simplify", __LINE__, __WFILE__, NULL, L"MgInvalidGeometrySimplficationAlgorithm", NULL);
     }
 
     STRING inputWKt = geom->ToAwkt(true);

Modified: trunk/MgDev/Common/Geometry/LineString.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/LineString.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/LineString.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -35,7 +35,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgLineString.MgLineString",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLineString.MgLineString",
             __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
     }
 

Modified: trunk/MgDev/Common/Geometry/LinearRing.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/LinearRing.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/LinearRing.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -33,7 +33,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgLinearRing.MgLinearRing",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLinearRing.MgLinearRing",
             __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
     }
 
@@ -161,7 +161,7 @@
 {
     //should not be called on geometry components
     //components are serialized by the containing geometries
-    throw new MgNotImplementedException(L"MgLinearRing.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLinearRing.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -171,7 +171,7 @@
 {
     //should not be called on geometry components
     //components are deserialized by the containing geometries
-    throw new MgNotImplementedException(L"MgLinearRing.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLinearRing.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/Geometry/LinearSegment.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/LinearSegment.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/LinearSegment.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -34,7 +34,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgLinearSegment.MgLinearSegment",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLinearSegment.MgLinearSegment",
             __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
     }
 
@@ -152,7 +152,7 @@
 {
     //should not be called on geometry components
     //components are serialized by the containing geometries
-    throw new MgNotImplementedException(L"MgLinearSegment.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLinearSegment.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -162,7 +162,7 @@
 {
     //should not be called on geometry components
     //components are deserialized by the containing geometries
-    throw new MgNotImplementedException(L"MgLinearSegment.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLinearSegment.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/Geometry/Parse/Array.h
===================================================================
--- trunk/MgDev/Common/Geometry/Parse/Array.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Parse/Array.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -324,7 +324,7 @@
 {
     if (i >= GetCount() || i < 0)
     {
-        throw new MgIndexOutOfRangeException(L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return *(this->GetData()+i);
@@ -335,7 +335,7 @@
 T& GisArray<T>::GetValue(INT32 i)
 {
     if (i >= GetCount() || i < 0)
-        throw new MgIndexOutOfRangeException(L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return *(this->GetData()+i);
 }
@@ -345,7 +345,7 @@
 void GisArray<T>::SetValue(INT32 i, T newElement)
 {
     if (i >= GetCount() || i < 0)
-        throw new MgIndexOutOfRangeException(L"GisArray<T>.SetValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"GisArray<T>.SetValue", __LINE__, __WFILE__, NULL, L"", NULL);
 
     *(this->GetData()+i) = newElement;
 }

Modified: trunk/MgDev/Common/Geometry/Parse/ArrayHelper.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Parse/ArrayHelper.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Parse/ArrayHelper.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -27,7 +27,7 @@
 {
     // Disallow possible re-allocation if object is shared.
     if (array->m_metadata.refCount > 1)
-        throw new MgInvalidOperationException(L"GisArrayHelper.Append", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"GisArrayHelper.Append", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if ( array->m_metadata.size + numElements > array->m_metadata.alloc )
         array = AllocMore(array, numElements, false /*exactly*/, elementSize);   // We could calculate the difference here, allocating less.
@@ -44,7 +44,7 @@
 {
     // Disallow possible re-allocation if object is shared.
     if (array->m_metadata.refCount > 1)
-        throw new MgInvalidOperationException(L"GisArrayHelper.SetSize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"GisArrayHelper.SetSize", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if ( numElements > array->m_metadata.alloc )
     {
@@ -67,10 +67,10 @@
 {
     // Disallow possible re-allocation if object is shared.
     if (array->m_metadata.refCount > 1)
-        throw new MgInvalidOperationException(L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (numElements < array->m_metadata.size || numElements < MIN_ALLOC)
-        throw new MgInvalidOperationException(L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (array->m_metadata.alloc != numElements)
     {
@@ -131,7 +131,7 @@
 
     GenericArray* newArray = (GenericArray*) new unsigned char[newAllocBytes];
     if (0==newArray)
-        throw new MgOutOfMemoryException(L"GisArrayHelper.AllocMore", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"GisArrayHelper.AllocMore", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // Copy data from old array.
     if (0!=array)

Modified: trunk/MgDev/Common/Geometry/Parse/LexAwkt.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Parse/LexAwkt.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Parse/LexAwkt.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -321,7 +321,7 @@
         if (!iswdigit(m_ch))
         {
             // Exponent shall contain digits
-            throw new MgNotFiniteNumberException(L"GisLexAwkt.getnumber", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNotFiniteNumberException, L"GisLexAwkt.getnumber", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         pstr = getdigits(pstr);
         *pstr = CHR_NULL;

Modified: trunk/MgDev/Common/Geometry/Parse/ParseAwkt.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Parse/ParseAwkt.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Parse/ParseAwkt.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
         arguments.Add(L"1");
         arguments.Add(pwzAwkt);
 
-        throw new MgInvalidArgumentException(L"MgParseAwkt.ParseAwkt",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgParseAwkt.ParseAwkt",
             __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
     }
 
@@ -544,7 +544,7 @@
         m_types->GetCount() != m_dims->GetCount() ||
         m_types->GetCount() != m_starts->GetCount())
     {
-        throw new MgInvalidArgumentException(L"MgParseAwkt.ParseAwkt", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgParseAwkt.ParseAwkt", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     _types type = (_types) (*m_types)[0];
@@ -617,7 +617,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgParseAwkt.SetGeometryType",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgParseAwkt.SetGeometryType",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
         }
         break;
@@ -804,7 +804,7 @@
             arguments.Add(L"0");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgParseAwkt.ParseAwkt",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgParseAwkt.ParseAwkt",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
         }
         break;

Modified: trunk/MgDev/Common/Geometry/Polygon.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Polygon.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Polygon.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
 MgLinearRing* MgPolygon::GetInteriorRing(INT32 index)
 {
     if (m_innerRings == NULL)
-        throw new MgArgumentOutOfRangeException(L"MgPolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgPolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return m_innerRings->GetItem(index);
 }

Modified: trunk/MgDev/Common/Geometry/Spatial/MathUtility.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Spatial/MathUtility.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Spatial/MathUtility.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgMathUtility.LUDecompose",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgMathUtility.LUDecompose",
             __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryNoDimension", NULL);
     }
 
@@ -182,7 +182,7 @@
             arguments.Add(L"3");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgMathUtility.LUDecompose",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgMathUtility.LUDecompose",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryBadProportion", NULL);
         }
 

Modified: trunk/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -71,7 +71,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -170,7 +170,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryType", NULL);
         }
     }
@@ -247,7 +247,7 @@
                 arguments.Add(L"2");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgSpatialUtility.AppendLinearizedCurveSegmentsToDistinctCollection",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtility.AppendLinearizedCurveSegmentsToDistinctCollection",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryComponentType", NULL);
             }
         }
@@ -558,7 +558,7 @@
     CHECKARGUMENTNULL(seg2To, L"MgSpatialUtility.SegmentIntersection")
     if (magnitude < 1.0E-04)
     {
-        throw new MgInvalidArgumentException(L"MgSpatialUtility.SegmentIntersection", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtility.SegmentIntersection", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Compute a tolerance which is appropriate for the data we are working

Modified: trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -339,7 +339,7 @@
     if (MgMathUtility::LUDecompose(3, a, eindex ) == 0)
     {
         // Zero result means that points were collinear.
-        throw new MgInvalidArgumentException(L"MgSpatialUtilityCircularArc.ComputeCenterFromThreePositions", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtilityCircularArc.ComputeCenterFromThreePositions", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     /* Perform row exchanges for b */
@@ -388,7 +388,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgSpatialUtilityCircularArc.Linearize",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtilityCircularArc.Linearize",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -401,7 +401,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgSpatialUtilityCircularArc.Linearize",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtilityCircularArc.Linearize",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -540,7 +540,7 @@
 
         MgStringCollection arguments;
         arguments.Add(buffer);
-        throw new MgInvalidArgumentException(L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     if (MgMathUtility::SnapToZero(maximumError) <= 0.0)
@@ -550,7 +550,7 @@
 
         MgStringCollection arguments;
         arguments.Add(buffer);
-        throw new MgInvalidArgumentException(L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     double arcStep = 0.0;

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/Controller.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/Controller.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/Controller.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -78,7 +78,7 @@
             arguments.Add(m_mapCmdSetViewCenterX);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -104,7 +104,7 @@
             arguments.Add(m_mapCmdSetViewCenterY);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -130,7 +130,7 @@
             arguments.Add(m_mapCmdSetViewScale);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -142,7 +142,7 @@
             arguments.Add(m_mapCmdSetViewScale);
             arguments.Add(sScale);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
         }
 
@@ -165,7 +165,7 @@
             arguments.Add(m_mapCmdSetDisplayDpi);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -177,7 +177,7 @@
             arguments.Add(m_mapCmdSetDisplayDpi);
             arguments.Add(sDpi);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
         }
 
@@ -197,7 +197,7 @@
             arguments.Add(m_mapCmdSetDisplayWidth);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -209,7 +209,7 @@
             arguments.Add(m_mapCmdSetDisplayWidth);
             arguments.Add(sWidth);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
         }
 
@@ -229,7 +229,7 @@
             arguments.Add(m_mapCmdSetDisplayHeight);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -241,7 +241,7 @@
             arguments.Add(m_mapCmdSetDisplayHeight);
             arguments.Add(sHeight);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
         }
 
@@ -261,7 +261,7 @@
             arguments.Add(m_mapCmdShowLayers);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -281,7 +281,7 @@
             arguments.Add(m_mapCmdHideLayers);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -301,7 +301,7 @@
             arguments.Add(m_mapCmdShowGroups);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -321,7 +321,7 @@
             arguments.Add(m_mapCmdHideGroups);
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgController.ApplyMapViewCommands",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ApplyMapViewCommands",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
         }
 
@@ -441,7 +441,7 @@
         arguments.Add(L"1");
         arguments.Add(strEnvelope);
 
-        throw new MgInvalidArgumentException(L"MgController.ParseEnvelope",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgController.ParseEnvelope",
             __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelope", NULL);
     }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/DwfController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/DwfController.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/DwfController.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -96,7 +96,7 @@
                 arguments.Add(m_mapCmdSetDataExtent);
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgDwfController.ApplyMapViewCommands",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDwfController.ApplyMapViewCommands",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyTypeForCommand", NULL);
             }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -153,7 +153,7 @@
 //
 MgByteReader* MgHtmlController::GetLayerImageMap(CREFSTRING mapName, CREFSTRING layerName)
 {
-    throw new MgNotImplementedException(L"MgHtmlController.GetLayerImageMap", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHtmlController.GetLayerImageMap", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -825,7 +825,7 @@
 //
 STRING MgHtmlController::ScriptViewUpdate(bool forceFullRefresh)
 {
-    throw new MgNotImplementedException(L"MgHtmlController.ScriptViewUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHtmlController.ScriptViewUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -836,7 +836,7 @@
 STRING MgHtmlController::ScriptViewUpdate(MgPoint* center, double scale,
     bool forceFullRefresh)
 {
-    throw new MgNotImplementedException(L"MgHtmlController.ScriptViewUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHtmlController.ScriptViewUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -65,65 +65,6 @@
 #include "MapLayer/Map.h"
 #include "MapLayer/Selection.h"
 
-#include "Exception/AllProviderConnectionsUsedException.h"
-#include "Exception/AuthenticationFailedException.h"
-#include "Exception/ConnectionFailedException.h"
-#include "Exception/ConnectionNotOpenException.h"
-#include "Exception/DbException.h"
-#include "Exception/DbXmlException.h"
-#include "Exception/DuplicateGroupException.h"
-#include "Exception/DuplicateNameException.h"
-#include "Exception/DuplicateParameterException.h"
-#include "Exception/DuplicateRepositoryException.h"
-#include "Exception/DuplicateRoleException.h"
-#include "Exception/DuplicateServerException.h"
-#include "Exception/DuplicateSessionException.h"
-#include "Exception/DuplicateUserException.h"
-#include "Exception/DwfException.h"
-#include "Exception/DwfSectionNotFoundException.h"
-#include "Exception/DwfSectionResourceNotFoundException.h"
-#include "Exception/EndOfStreamException.h"
-#include "Exception/EvaluationExpiredException.h"
-#include "Exception/GroupNotFoundException.h"
-#include "Exception/InvalidDwfPackageException.h"
-#include "Exception/InvalidDwfSectionException.h"
-#include "Exception/InvalidFeatureSourceException.h"
-#include "Exception/InvalidIpAddressException.h"
-#include "Exception/InvalidLicenseException.h"
-#include "Exception/InvalidLogEntryException.h"
-#include "Exception/InvalidOperationVersionException.h"
-#include "Exception/InvalidPasswordException.h"
-#include "Exception/InvalidPrintLayoutFontSizeUnitsException.h"
-#include "Exception/InvalidPrintLayoutPositionUnitsException.h"
-#include "Exception/InvalidPrintLayoutSizeUnitsException.h"
-#include "Exception/InvalidSerialNumberException.h"
-#include "Exception/InvalidServerNameException.h"
-#include "Exception/LicenseException.h"
-#include "Exception/LicenseExpiredException.h"
-#include "Exception/LogOpenFailedException.h"
-#include "Exception/OperationProcessingException.h"
-#include "Exception/ParameterNotFoundException.h"
-#include "Exception/PathTooLongException.h"
-#include "Exception/PermissionDeniedException.h"
-#include "Exception/PortNotAvailableException.h"
-#include "Exception/PrintToScaleModeNotSelectedException.h"
-#include "Exception/RasterTransformationNotSupportedException.h"
-#include "Exception/RepositoryCreationFailedException.h"
-#include "Exception/RepositoryNotFoundException.h"
-#include "Exception/RepositoryNotOpenException.h"
-#include "Exception/RepositoryOpenFailedException.h"
-#include "Exception/RoleNotFoundException.h"
-#include "Exception/ServerNotFoundException.h"
-#include "Exception/ServerNotOnlineException.h"
-#include "Exception/SessionExpiredException.h"
-#include "Exception/SessionNotFoundException.h"
-#include "Exception/StylizeLayerFailedException.h"
-#include "Exception/UnauthorizedAccessException.h"
-#include "Exception/UnknownTileProviderException.h"
-#include "Exception/UnsupportedTileProviderException.h"
-#include "Exception/UnsupportedProviderThreadModelException.h"
-#include "Exception/UriFormatException.h"
-
 #ifndef SWIG_PUBLIC_API
 #include "Net/IOperationHandler.h"
 #include "Services/Command.h"

Modified: trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj	2022-10-10 09:40:18 UTC (rev 9971)
@@ -198,18 +198,6 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="Exception\UnknownTileProviderException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UnsupportedTileProviderException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="MapLayer\Layer.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -246,342 +234,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\AllProviderConnectionsUsedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\AuthenticationFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ConnectionFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ConnectionNotOpenException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DbException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DbXmlException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateGroupException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateNameException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateParameterException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateRepositoryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateRoleException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateServerException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateSessionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateUserException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionResourceNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\EndOfStreamException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\EvaluationExpiredException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\GroupNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfPackageException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfSectionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidFeatureSourceException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidIpAddressException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLicenseException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLogEntryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidOperationVersionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPasswordException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutFontSizeUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutPositionUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutSizeUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidSerialNumberException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidServerNameException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LicenseException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LicenseExpiredException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LogOpenFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\OperationProcessingException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ParameterNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\PathTooLongException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\PermissionDeniedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\PortNotAvailableException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\PrintToScaleModeNotSelectedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RasterTransformationNotSupportedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryCreationFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryNotOpenException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryOpenFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\RoleNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ServerNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ServerNotOnlineException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\SessionExpiredException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\SessionNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\StylizeLayerFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UnauthorizedAccessException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UnsupportedProviderThreadModelException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UriFormatException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Net\IOperationHandler.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -957,8 +609,6 @@
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Exception\UnknownTileProviderException.h" />
-    <ClInclude Include="Exception\UnsupportedTileProviderException.h" />
     <ClInclude Include="MapLayer\Layer.h" />
     <ClInclude Include="MapLayer\Map.h" />
     <ClInclude Include="MapLayer\Selection.h" />
@@ -965,62 +615,6 @@
     <ClInclude Include="Controller\Controller.h" />
     <ClInclude Include="Controller\DwfController.h" />
     <ClInclude Include="Controller\HtmlController.h" />
-    <ClInclude Include="Exception\AllProviderConnectionsUsedException.h" />
-    <ClInclude Include="Exception\AuthenticationFailedException.h" />
-    <ClInclude Include="Exception\ConnectionFailedException.h" />
-    <ClInclude Include="Exception\ConnectionNotOpenException.h" />
-    <ClInclude Include="Exception\DbException.h" />
-    <ClInclude Include="Exception\DbXmlException.h" />
-    <ClInclude Include="Exception\DuplicateGroupException.h" />
-    <ClInclude Include="Exception\DuplicateNameException.h" />
-    <ClInclude Include="Exception\DuplicateParameterException.h" />
-    <ClInclude Include="Exception\DuplicateRepositoryException.h" />
-    <ClInclude Include="Exception\DuplicateRoleException.h" />
-    <ClInclude Include="Exception\DuplicateServerException.h" />
-    <ClInclude Include="Exception\DuplicateSessionException.h" />
-    <ClInclude Include="Exception\DuplicateUserException.h" />
-    <ClInclude Include="Exception\DwfException.h" />
-    <ClInclude Include="Exception\DwfSectionNotFoundException.h" />
-    <ClInclude Include="Exception\DwfSectionResourceNotFoundException.h" />
-    <ClInclude Include="Exception\EndOfStreamException.h" />
-    <ClInclude Include="Exception\EvaluationExpiredException.h" />
-    <ClInclude Include="Exception\GroupNotFoundException.h" />
-    <ClInclude Include="Exception\InvalidDwfPackageException.h" />
-    <ClInclude Include="Exception\InvalidDwfSectionException.h" />
-    <ClInclude Include="Exception\InvalidFeatureSourceException.h" />
-    <ClInclude Include="Exception\InvalidIpAddressException.h" />
-    <ClInclude Include="Exception\InvalidLicenseException.h" />
-    <ClInclude Include="Exception\InvalidLogEntryException.h" />
-    <ClInclude Include="Exception\InvalidOperationVersionException.h" />
-    <ClInclude Include="Exception\InvalidPasswordException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutFontSizeUnitsException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutPositionUnitsException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutSizeUnitsException.h" />
-    <ClInclude Include="Exception\InvalidSerialNumberException.h" />
-    <ClInclude Include="Exception\InvalidServerNameException.h" />
-    <ClInclude Include="Exception\LicenseException.h" />
-    <ClInclude Include="Exception\LicenseExpiredException.h" />
-    <ClInclude Include="Exception\LogOpenFailedException.h" />
-    <ClInclude Include="Exception\OperationProcessingException.h" />
-    <ClInclude Include="Exception\ParameterNotFoundException.h" />
-    <ClInclude Include="Exception\PathTooLongException.h" />
-    <ClInclude Include="Exception\PermissionDeniedException.h" />
-    <ClInclude Include="Exception\PortNotAvailableException.h" />
-    <ClInclude Include="Exception\PrintToScaleModeNotSelectedException.h" />
-    <ClInclude Include="Exception\RasterTransformationNotSupportedException.h" />
-    <ClInclude Include="Exception\RepositoryCreationFailedException.h" />
-    <ClInclude Include="Exception\RepositoryNotFoundException.h" />
-    <ClInclude Include="Exception\RepositoryNotOpenException.h" />
-    <ClInclude Include="Exception\RepositoryOpenFailedException.h" />
-    <ClInclude Include="Exception\RoleNotFoundException.h" />
-    <ClInclude Include="Exception\ServerNotFoundException.h" />
-    <ClInclude Include="Exception\ServerNotOnlineException.h" />
-    <ClInclude Include="Exception\SessionExpiredException.h" />
-    <ClInclude Include="Exception\SessionNotFoundException.h" />
-    <ClInclude Include="Exception\StylizeLayerFailedException.h" />
-    <ClInclude Include="Exception\UnauthorizedAccessException.h" />
-    <ClInclude Include="Exception\UnsupportedProviderThreadModelException.h" />
-    <ClInclude Include="Exception\UriFormatException.h" />
     <ClInclude Include="Net\IOperationHandler.h" />
     <ClInclude Include="Services\Command.h" />
     <ClInclude Include="Services\ConnectionProperties.h" />

Modified: trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj.filters
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj.filters	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcxproj.filters	2022-10-10 09:40:18 UTC (rev 9971)
@@ -7,9 +7,6 @@
     <Filter Include="Controller">
       <UniqueIdentifier>{f2931e10-9b2a-4c65-a45b-87b247a19774}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Exception">
-      <UniqueIdentifier>{684cecbd-a4b2-476a-8c9d-c98ee8d65678}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Net">
       <UniqueIdentifier>{19455d03-2a41-470e-af83-3e03cccc5d8c}</UniqueIdentifier>
     </Filter>
@@ -42,174 +39,6 @@
     <ClCompile Include="Controller\HtmlController.cpp">
       <Filter>Controller</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\AllProviderConnectionsUsedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\AuthenticationFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ConnectionFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ConnectionNotOpenException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DbException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DbXmlException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateGroupException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateNameException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateParameterException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateRepositoryException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateRoleException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateServerException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateSessionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateUserException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionResourceNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\EndOfStreamException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\EvaluationExpiredException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\GroupNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfPackageException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfSectionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidFeatureSourceException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidIpAddressException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLicenseException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLogEntryException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidOperationVersionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPasswordException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutFontSizeUnitsException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutPositionUnitsException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutSizeUnitsException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidSerialNumberException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidServerNameException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LicenseException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LicenseExpiredException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LogOpenFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\OperationProcessingException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ParameterNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\PathTooLongException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\PermissionDeniedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\PortNotAvailableException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\PrintToScaleModeNotSelectedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RasterTransformationNotSupportedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryCreationFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryNotOpenException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RepositoryOpenFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\RoleNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ServerNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ServerNotOnlineException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\SessionExpiredException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\SessionNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\StylizeLayerFailedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UnauthorizedAccessException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UnsupportedProviderThreadModelException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UriFormatException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Net\IOperationHandler.cpp">
       <Filter>Net</Filter>
     </ClCompile>
@@ -394,12 +223,6 @@
     <ClCompile Include="Util\TimerUtil.cpp">
       <Filter>Util</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\UnknownTileProviderException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UnsupportedTileProviderException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Metatile.cpp">
       <Filter>Services</Filter>
     </ClCompile>
@@ -423,174 +246,6 @@
     <ClInclude Include="Controller\HtmlController.h">
       <Filter>Controller</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\AllProviderConnectionsUsedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\AuthenticationFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ConnectionFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ConnectionNotOpenException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DbException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DbXmlException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateGroupException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateNameException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateParameterException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateRepositoryException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateRoleException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateServerException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateSessionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateUserException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DwfException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DwfSectionNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DwfSectionResourceNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\EndOfStreamException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\EvaluationExpiredException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\GroupNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidDwfPackageException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidDwfSectionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidFeatureSourceException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidIpAddressException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidLicenseException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidLogEntryException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidOperationVersionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPasswordException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutFontSizeUnitsException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutPositionUnitsException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutSizeUnitsException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidSerialNumberException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidServerNameException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LicenseException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LicenseExpiredException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LogOpenFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\OperationProcessingException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ParameterNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\PathTooLongException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\PermissionDeniedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\PortNotAvailableException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\PrintToScaleModeNotSelectedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RasterTransformationNotSupportedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RepositoryCreationFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RepositoryNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RepositoryNotOpenException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RepositoryOpenFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\RoleNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ServerNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ServerNotOnlineException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\SessionExpiredException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\SessionNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\StylizeLayerFailedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UnauthorizedAccessException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UnsupportedProviderThreadModelException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UriFormatException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Net\IOperationHandler.h">
       <Filter>Net</Filter>
     </ClInclude>
@@ -778,12 +433,6 @@
     <ClInclude Include="Util\TimerUtil.h">
       <Filter>Util</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\UnknownTileProviderException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UnsupportedTileProviderException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Metatile.h">
       <Filter>Services</Filter>
     </ClInclude>

Modified: trunk/MgDev/Common/MapGuideCommon/MapGuideCommonBuild.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapGuideCommonBuild.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapGuideCommonBuild.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -18,64 +18,6 @@
 #include  "Controller/Controller.cpp"
 #include  "Controller/DwfController.cpp"
 #include  "Controller/HtmlController.cpp"
-#include  "Exception/AllProviderConnectionsUsedException.cpp"
-#include  "Exception/AuthenticationFailedException.cpp"
-#include  "Exception/ConnectionFailedException.cpp"
-#include  "Exception/ConnectionNotOpenException.cpp"
-#include  "Exception/DbException.cpp"
-#include  "Exception/DbXmlException.cpp"
-#include  "Exception/DuplicateGroupException.cpp"
-#include  "Exception/DuplicateNameException.cpp"
-#include  "Exception/DuplicateParameterException.cpp"
-#include  "Exception/DuplicateRepositoryException.cpp"
-#include  "Exception/DuplicateRoleException.cpp"
-#include  "Exception/DuplicateServerException.cpp"
-#include  "Exception/DuplicateSessionException.cpp"
-#include  "Exception/DuplicateUserException.cpp"
-#include  "Exception/DwfException.cpp"
-#include  "Exception/DwfSectionNotFoundException.cpp"
-#include  "Exception/DwfSectionResourceNotFoundException.cpp"
-#include  "Exception/EndOfStreamException.cpp"
-#include  "Exception/EvaluationExpiredException.cpp"
-#include  "Exception/GroupNotFoundException.cpp"
-#include  "Exception/InvalidDwfPackageException.cpp"
-#include  "Exception/InvalidDwfSectionException.cpp"
-#include  "Exception/InvalidFeatureSourceException.cpp"
-#include  "Exception/InvalidIpAddressException.cpp"
-#include  "Exception/InvalidLicenseException.cpp"
-#include  "Exception/InvalidLogEntryException.cpp"
-#include  "Exception/InvalidOperationVersionException.cpp"
-#include  "Exception/InvalidPasswordException.cpp"
-#include  "Exception/InvalidPrintLayoutFontSizeUnitsException.cpp"
-#include  "Exception/InvalidPrintLayoutPositionUnitsException.cpp"
-#include  "Exception/InvalidPrintLayoutSizeUnitsException.cpp"
-#include  "Exception/InvalidSerialNumberException.cpp"
-#include  "Exception/InvalidServerNameException.cpp"
-#include  "Exception/LicenseException.cpp"
-#include  "Exception/LicenseExpiredException.cpp"
-#include  "Exception/LogOpenFailedException.cpp"
-#include  "Exception/OperationProcessingException.cpp"
-#include  "Exception/ParameterNotFoundException.cpp"
-#include  "Exception/PathTooLongException.cpp"
-#include  "Exception/PermissionDeniedException.cpp"
-#include  "Exception/PortNotAvailableException.cpp"
-#include  "Exception/PrintToScaleModeNotSelectedException.cpp"
-#include  "Exception/RasterTransformationNotSupportedException.cpp"
-#include  "Exception/RepositoryCreationFailedException.cpp"
-#include  "Exception/RepositoryNotFoundException.cpp"
-#include  "Exception/RepositoryNotOpenException.cpp"
-#include  "Exception/RepositoryOpenFailedException.cpp"
-#include  "Exception/RoleNotFoundException.cpp"
-#include  "Exception/ServerNotFoundException.cpp"
-#include  "Exception/ServerNotOnlineException.cpp"
-#include  "Exception/SessionExpiredException.cpp"
-#include  "Exception/SessionNotFoundException.cpp"
-#include  "Exception/StylizeLayerFailedException.cpp"
-#include  "Exception/UnauthorizedAccessException.cpp"
-#include  "Exception/UnknownTileProviderException.cpp"
-#include  "Exception/UnsupportedTileProviderException.cpp"
-#include  "Exception/UnsupportedProviderThreadModelException.cpp"
-#include  "Exception/UriFormatException.cpp"
 #include  "MapLayer/Layer.cpp"
 #include  "MapLayer/Map.cpp"
 #include  "MapLayer/Selection.cpp"

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -362,7 +362,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidFeatureSourceException(L"MgLayer::UpdateFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, L"MgLayer::UpdateFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     unique_ptr<MdfModel::FeatureSource> featureSource;
@@ -389,7 +389,7 @@
 
         if (string::npos == endIndex)
         {
-            throw new MgXmlParserException(L"MgLayer.UpdateFeatures",
+            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgLayer.UpdateFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
@@ -445,7 +445,7 @@
         Ptr<MgDataPropertyDefinition> prop = dynamic_cast<MgDataPropertyDefinition*>(idProps->GetItem(nIds));
         if (0 == (MgDataPropertyDefinition*)prop)
         {
-            throw new MgInvalidCastException(L"MgLayer.PopulateIdentityProperties",
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgLayer.PopulateIdentityProperties",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         MgLayer::IdProperty idProp;

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -118,7 +118,7 @@
     else if (resource->GetResourceType() == MgResourceType::TileSetDefinition)
         CreateFromTileSet(resourceService, resource, mapName);
     else
-        throw new MgInvalidResourceTypeException(L"MgMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_CATCH_AND_THROW(L"MgMap.Create")
 }
@@ -176,7 +176,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // build the runtime map object from the parsed definition
@@ -205,7 +205,7 @@
             STRING errorMsg = parser.GetErrorMessage();
             MgStringCollection arguments;
             arguments.Add(errorMsg);
-            throw new MgInvalidMapDefinitionException(L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         tdef.reset(parser.DetachTileSetDefinition());
@@ -445,7 +445,7 @@
                 //attach the layer to its group
                 itKg = knownGroups.find(groupName);
                 if(itKg == knownGroups.end())
-                    throw new MgInvalidMapDefinitionException(L"MgMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
 
                 rtLayer->SetGroup(itKg->second);
             }
@@ -628,7 +628,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // build the runtime map object from the parsed definition
@@ -923,7 +923,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgMap.Open",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgMap.Open",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -1031,7 +1031,7 @@
     {
         if (NULL == m_siteConnection.p || m_name.empty())
         {
-            throw new MgNullReferenceException(L"MgMap.Save",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgMap.Save",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
@@ -1114,7 +1114,7 @@
         {
             // If this exception is thrown then the calling code should probably initialize the
             // resource service using SetDelayedLoadResourceService()
-            throw new MgInvalidOperationException(L"MgMap.UnpackLayersAndGroups", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgMap.UnpackLayersAndGroups", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -1234,7 +1234,7 @@
             MgStringCollection args;
             args.Add(layer->GetName());
             args.Add(parent->GetName());
-            throw new MgGroupNotFoundException(L"MgMap.PackLayersAndGroups", __LINE__, __WFILE__, NULL, L"MgLayerBelongsToGroupNotInMap", &args);
+            throw new MgException(MgExceptionCodes::MgGroupNotFoundException, L"MgMap.PackLayersAndGroups", __LINE__, __WFILE__, NULL, L"MgLayerBelongsToGroupNotInMap", &args);
         }
         stream->WriteString(parent != NULL? parent->GetName(): L"");
         stream->WriteObject(layer);
@@ -1366,7 +1366,7 @@
 
     if (version != m_serializeVersion)
     {
-        throw new MgStreamIoException(L"MgMap.Deserialize", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgMap.Deserialize", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
     }
 
     //resource id for MgMap

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Selection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -125,7 +125,7 @@
     if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId();
     if (sessionId.empty())
     {
-        throw new MgSessionExpiredException(L"MgSelection.Open",__LINE__,__WFILE__, NULL, L"MgSelectionOpenWithEmptySession", NULL);
+        throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSelection.Open",__LINE__,__WFILE__, NULL, L"MgSelectionOpenWithEmptySession", NULL);
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(GetResourceName(sessionId, mapName));
@@ -143,7 +143,7 @@
     if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId();
     if (sessionId.empty())
     {
-        throw new MgSessionExpiredException(L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"MgSelectionSaveWithEmptySession", NULL);
+        throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"MgSelectionSaveWithEmptySession", NULL);
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(GetResourceName(sessionId, mapName));
@@ -157,7 +157,7 @@
 {
     if (sessionId.empty())
     {
-        throw new MgSessionExpiredException(L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"MgSelectionSaveWithEmptySession", NULL);
+        throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSelection.Save",__LINE__,__WFILE__, NULL, L"MgSelectionSaveWithEmptySession", NULL);
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(GetResourceName(sessionId, mapName));

Modified: trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -173,12 +173,12 @@
 
     if (MgStreamParser::mshStreamStart != msh.m_streamStart)
     {
-        throw new MgInvalidStreamHeaderException(L"MgCommand.GetResponse",
+        throw new MgException(MgExceptionCodes::MgInvalidStreamHeaderException, L"MgCommand.GetResponse",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (MgStreamParser::StreamVersion != msh.m_streamVersion)
     {
-        throw new MgStreamIoException(L"MgCommand.GetResponse",
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgCommand.GetResponse",
             __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
     }
 
@@ -342,7 +342,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgCommand.GetResponseResult",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgCommand.GetResponseResult",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidDataType", NULL);
         }
     }

Modified: trunk/MgDev/Common/MapGuideCommon/Services/MapPlot.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/MapPlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/MapPlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -237,7 +237,7 @@
 // Serialize data to TCP/IP stream
 void MgMapPlot::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgMapPlot.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapPlot.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -245,7 +245,7 @@
 // Deserialize data from TCP/IP stream
 void MgMapPlot::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgMapPlot.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapPlot.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/PackageStatusInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/PackageStatusInformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/PackageStatusInformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -197,7 +197,7 @@
      && MgPackageApiName::LoadPackage != m_apiName
      && MgPackageApiName::MakePackage != m_apiName)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgPackageStatusInformation.GetStatusMessage",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -275,7 +275,7 @@
     if (MgPackageApiName::LoadPackage != apiName &&
         MgPackageApiName::MakePackage != apiName)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgPackageStatusInformation.SetApiName",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Common/MapGuideCommon/Services/PrintLayout.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/PrintLayout.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/PrintLayout.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -263,7 +263,7 @@
                         && positionUnits != L"meters" && positionUnits != L"inches" && positionUnits != L"percent")
                     {
                         // invalid print layout position units
-                        throw new MgInvalidPrintLayoutPositionUnitsException(L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(logoNode, "ResourceId", resId, false);
@@ -278,7 +278,7 @@
                         && sizeUnits != L"inches" && sizeUnits != L"meters")
                     {
                         // invalid print layout size units
-                        throw new MgInvalidPrintLayoutSizeUnitsException(L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutSizeUnitsException, L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(logoNode, "Rotation", rotation, false);
@@ -325,7 +325,7 @@
                         && positionUnits != L"percent" && positionUnits != L"meters" && positionUnits != L"inches")
                     {
                         // invalid print layout position units
-                        throw new MgInvalidPrintLayoutPositionUnitsException(L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 DOMNode* fontNode = pXmlUtil->GetElementNode(textNode, "Font", false);
@@ -338,7 +338,7 @@
                         && fontSizeUnits != L"points" && fontSizeUnits != L"meters" && fontSizeUnits != L"inches")
                     {
                         // invalid print layout font size units
-                        throw new MgInvalidPrintLayoutFontSizeUnitsException(L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(textNode, "Value", value, false);

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyDataReader.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -811,7 +811,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgProxyDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -850,7 +850,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgProxyDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -20,7 +20,7 @@
 #define CHECK_FEATURESET_COUNT(pointer, methodname)        \
 if (0 == pointer->GetCount())                           \
 {                                                       \
-    throw new MgEmptyFeatureSetException(methodname,    \
+    throw new MgException(MgExceptionCodes::MgEmptyFeatureSetException, methodname,    \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -27,7 +27,7 @@
 #define CHECK_PROPERTY_TYPE(property, type, methodname) \
 if (property != type)                                   \
 {                                                       \
-    throw new MgInvalidPropertyTypeException(methodname, \
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, methodname, \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -689,7 +689,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgProxyFeatureReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyFeatureReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -712,7 +712,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgProxyFeatureReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyFeatureReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -990,7 +990,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgProxyFeatureReader::GetGeometry(CREFSTRING propertyName, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgProxyFeatureReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyFeatureReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1003,7 +1003,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgProxyFeatureReader::GetGeometry(INT32 index, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgProxyFeatureReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyFeatureReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1069,7 +1069,7 @@
 
 MgFeatureSet* MgProxyFeatureReader::GetFeatures(INT32 count)
 {
-    throw new MgNotImplementedException(L"MgProxyFeatureReader.GetFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyFeatureReader.GetFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -835,7 +835,7 @@
                                                           CREFSTRING className,
                                                           MgFeatureQueryOptions* options)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgProxyFeatureService::GetLockedFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -623,7 +623,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgProxyGwsFeatureReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyGwsFeatureReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -662,7 +662,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgProxyGwsFeatureReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxyGwsFeatureReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -933,7 +933,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgProxyGwsFeatureReader::GetGeometry(CREFSTRING propertyName, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgProxyGwsFeatureReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyGwsFeatureReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -946,7 +946,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgProxyGwsFeatureReader::GetGeometry(INT32 index, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgProxyGwsFeatureReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyGwsFeatureReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1012,6 +1012,6 @@
 
 MgFeatureSet* MgProxyGwsFeatureReader::GetFeatures(INT32 count)
 {
-    throw new MgNotImplementedException(L"MgProxyGwsFeatureReader.GetFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgProxyGwsFeatureReader.GetFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -20,7 +20,7 @@
 #define CHECK_FEATURESET_COUNT(pointer, methodname)        \
 if (0 == pointer->GetCount())                           \
 {                                                       \
-    throw new MgEmptyFeatureSetException(methodname,    \
+    throw new MgException(MgExceptionCodes::MgEmptyFeatureSetException, methodname,    \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -27,7 +27,7 @@
 #define CHECK_PROPERTY_TYPE(property, type, methodname) \
 if (property != type)                                   \
 {                                                       \
-    throw new MgInvalidPropertyTypeException(methodname, \
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, methodname, \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -626,7 +626,7 @@
 
 void MgProxySqlDataReader::Serialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgProxySqlDataReader.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgProxySqlDataReader.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -807,7 +807,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgProxySqlDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxySqlDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -846,7 +846,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgProxySqlDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgProxySqlDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -898,7 +898,7 @@
 /// MgFdoException
 MgRaster* MgProxySqlDataReader::GetRaster(CREFSTRING propertyName)
 {
-    throw new MgInvalidPropertyTypeException(L"MgProxySqlDataReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgProxySqlDataReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 /// <summary>Gets the raster object of the specified property.
@@ -912,7 +912,7 @@
 /// MgFdoException
 MgRaster* MgProxySqlDataReader::GetRaster(INT32 index)
 {
-    throw new MgInvalidPropertyTypeException(L"MgProxySqlDataReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgProxySqlDataReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
     {
         m_isOpen = false;
 
-        throw new MgConnectionFailedException(L"MgServerConnection.Open",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerConnection.Open",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -332,7 +332,7 @@
 
             if (!msc->IsOpen())
             {
-                throw new MgConnectionNotOpenException(L"MgServerConnection.Acquire", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgConnectionNotOpenException, L"MgServerConnection.Acquire", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             msc->SetStack(stack);

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -135,7 +135,7 @@
     int acquired = m_activeConnections.acquire(future);
     if (acquired == -1)
     {
-        throw new MgConnectionFailedException(L"MgServerConnectionStack.Pop",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerConnectionStack.Pop",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -221,7 +221,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgInvalidServerNameException(
+        throw new MgException(MgExceptionCodes::MgInvalidServerNameException, 
             L"MgServerInformation.CheckName",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -246,7 +246,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"[]=");
 
-        throw new MgInvalidArgumentException(L"MgServerInformation.CheckDescription",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerInformation.CheckDescription",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 }
@@ -268,7 +268,7 @@
         MgStringCollection arguments;
         arguments.Add(address);
 
-        throw new MgInvalidIpAddressException(
+        throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, 
             L"MgServerInformation.CheckAddress",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -302,7 +302,7 @@
         arguments.Add(L"1");
         arguments.Add(serviceName);
 
-        throw new MgInvalidArgumentException(L"MgServerInformation.ToServiceType",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerInformation.ToServiceType",
             __LINE__, __WFILE__, &arguments, L"MgNameNotFound", NULL);
     }
 
@@ -336,7 +336,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgServerInformation.ToServiceName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerInformation.ToServiceName",
             __LINE__, __WFILE__, &arguments, L"MgInvalidServiceType", NULL);
     }
 
@@ -370,7 +370,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgServerInformation.ToServiceFlag",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerInformation.ToServiceFlag",
             __LINE__, __WFILE__, &arguments, L"MgInvalidServiceType", NULL);
     }
 
@@ -414,7 +414,7 @@
                 // Everything in the config file is treated as a string
                 // so we should not be here.
 
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                     L"MgServerInformation::ToServiceFlags", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -590,7 +590,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgServerInformation.IsServiceEnabled",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerInformation.IsServiceEnabled",
             __LINE__, __WFILE__, &arguments, L"MgInvalidServiceType", NULL);
     }
 
@@ -640,7 +640,7 @@
         if (m_address != serverInfo.m_address &&
             0 != MgIpUtil::CompareAddresses(m_address, serverInfo.m_address))
         {
-            throw new MgInvalidOperationException(L"MgServerInformation.CopyFrom",
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerInformation.CopyFrom",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/Site.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/Site.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/Site.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -35,7 +35,7 @@
 
 #define CHECK_SITE_CONN(methodName)                                           \
     if (NULL == this->m_pSiteConn)                                            \
-        throw new MgConnectionNotOpenException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+        throw new MgException(MgExceptionCodes::MgConnectionNotOpenException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
 
 #define CHECK_EMPTY_CREFSTRING(str, methodName)                               \
     if (((CREFSTRING)str).empty())                                            \
@@ -43,7 +43,7 @@
         MgStringCollection arguments;                                         \
         arguments.Add(L"1");                                                  \
         arguments.Add(MgResources::BlankArgument);                            \
-        throw new MgInvalidArgumentException(methodName, __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL); \
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, methodName, __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL); \
     }                                                                         \
 
 /// \defgroup MgSite MgSite

Modified: trunk/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
     // We can not have null userInformation
     if (NULL == userInformation)
     {
-        throw new MgAuthenticationFailedException(L"MgSiteConnection.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, L"MgSiteConnection.Open", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     m_connProp = NULL;
@@ -99,7 +99,7 @@
             MgConfigProperties::DefaultConfigurationFilename :
             m_config->GetFileName());
 
-        throw new MgConfigurationException(L"MgSiteConnection.Open",
+        throw new MgException(MgExceptionCodes::MgConfigurationException, L"MgSiteConnection.Open",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -130,7 +130,7 @@
     if (m_connProp == NULL)
     {
         // There might not be any MapGuide servers running for the site
-        throw new MgConnectionFailedException(L"MgSiteConnection.Open",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgSiteConnection.Open",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -210,7 +210,7 @@
 
     if (service == NULL)
     {
-        throw new MgServiceNotSupportedException(L"CreateService",
+        throw new MgException(MgExceptionCodes::MgServiceNotSupportedException, L"CreateService",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -439,7 +439,7 @@
 
     // Send HTTP request to the URL specified for authentication.
 
-    throw new MgNotImplementedException(L"MgSiteConnection.AuthenticateWithHttpServer",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSiteConnection.AuthenticateWithHttpServer",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -473,7 +473,7 @@
         // THIS SHOULD NEVER BE CALLED!!
         // Servers should be going through the service manager and not MgSiteConnection
         // to get their services.
-        throw new MgNotImplementedException(L"MgSiteConnection.GetConnectionProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSiteConnection.GetConnectionProperties", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return connProp.Detach();
@@ -491,7 +491,7 @@
 
     if (m_connProp->IsLocal())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteConnection.GetConnectionPropertiesFromSiteServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -572,7 +572,7 @@
     }
     else
     {
-        throw new MgConnectionNotOpenException(L"MgSiteConnection.GetSite", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionNotOpenException, L"MgSiteConnection.GetSite", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return site.Detach();
@@ -582,7 +582,7 @@
 {
     if (NULL == m_connProp.p)
     {
-        throw new MgConnectionNotOpenException(L"MgSiteConnection.GetUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionNotOpenException, L"MgSiteConnection.GetUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     return  m_connProp->GetUserInfo();
 }

Modified: trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -331,7 +331,7 @@
             // We have a session, but it will not exist on any other machine so we force the session exception
             MgStringCollection args;
             args.Add(sessionId);
-            throw new MgSessionExpiredException(L"MgSiteManager.GetConnectionProperties",__LINE__,__WFILE__, NULL, L"MgSessionExpired", &args);
+            throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSiteManager.GetConnectionProperties",__LINE__,__WFILE__, NULL, L"MgSessionExpired", &args);
         }
     }
     else
@@ -347,7 +347,7 @@
     if (NULL == connProps.p)
     {
         // There might not be any MapGuide servers running for the site
-        throw new MgConnectionFailedException(
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, 
             L"MgSiteManager.GetConnectionProperties",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Common/MapGuideCommon/System/CryptographyManager.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/CryptographyManager.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/System/CryptographyManager.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -41,27 +41,27 @@
                 break;                                                        \
                                                                               \
             case ecInvalidOperation:                                          \
-                cryptographyException = new MgInvalidOperationException(      \
+                cryptographyException = new MgException(MgExceptionCodes::MgInvalidOperationException,       \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecNullArgument:                                              \
-                cryptographyException = new MgNullArgumentException(          \
+                cryptographyException = new MgException(MgExceptionCodes::MgNullArgumentException,           \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecInvalidArgument:                                           \
-                cryptographyException = new MgInvalidArgumentException(       \
+                cryptographyException = new MgException(MgExceptionCodes::MgInvalidArgumentException,        \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecLengthError:                                               \
-                cryptographyException = new MgLengthException(                \
+                cryptographyException = new MgException(MgExceptionCodes::MgLengthException,                 \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecDateTimeError:                                             \
-                cryptographyException = new MgDateTimeException(              \
+                cryptographyException = new MgException(MgExceptionCodes::MgDateTimeException,               \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
@@ -68,23 +68,23 @@
             case ecFileIoError:                                               \
             case ecReadError:                                                 \
             case ecWriteError:                                                \
-                cryptographyException = new MgFileIoException(                \
+                cryptographyException = new MgException(MgExceptionCodes::MgFileIoException,                 \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecEncryptionError:                                           \
-                cryptographyException = new MgEncryptionException(            \
+                cryptographyException = new MgException(MgExceptionCodes::MgEncryptionException,             \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecDecryptionError:                                           \
-                cryptographyException = new MgDecryptionException(            \
+                cryptographyException = new MgException(MgExceptionCodes::MgDecryptionException,             \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecUnclassified:                                              \
             default:                                                          \
-                cryptographyException = new MgUnclassifiedException(          \
+                cryptographyException = new MgException(MgExceptionCodes::MgUnclassifiedException,           \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
         }                                                                     \
@@ -97,12 +97,12 @@
     }                                                                         \
     catch (exception& e)                                                      \
     {                                                                         \
-        cryptographyException = MgSystemException::Create(                    \
+        cryptographyException = MgException::Create(                          \
             e, methodName, __LINE__, __WFILE__);                              \
     }                                                                         \
     catch (...)                                                               \
     {                                                                         \
-        cryptographyException = new MgUnclassifiedException(                  \
+        cryptographyException = new MgException(MgExceptionCodes::MgUnclassifiedException,                   \
             methodName, __LINE__, __WFILE__, NULL, L"", NULL);                \
     }                                                                         \
 

Modified: trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonClassId.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonClassId.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonClassId.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -33,6 +33,9 @@
 
 
 // MapGuide Exceptions
+//
+// NOTE: Although we removed these exceptions, we are keeping the ids in to prevent these ids from being
+// accidentally used for new classes in the future
 #define MapGuide_Exception_MgAuthenticationFailedException              MAPGUIDE_EXCEPTION_ID+0
 #define MapGuide_Exception_MgConnectionFailedException                  MAPGUIDE_EXCEPTION_ID+1
 #define MapGuide_Exception_MgConnectionNotOpenException                 MAPGUIDE_EXCEPTION_ID+2

Modified: trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -35,63 +35,6 @@
     MgClassFactory* fact = MgClassFactory::GetInstance();
 
     //put in the map any class that can be serialized
-    EXCEPTION_CLASS_CREATOR(MgAllProviderConnectionsUsedException)
-    EXCEPTION_CLASS_CREATOR(MgAuthenticationFailedException)
-    EXCEPTION_CLASS_CREATOR(MgConnectionFailedException)
-    EXCEPTION_CLASS_CREATOR(MgConnectionNotOpenException)
-    EXCEPTION_CLASS_CREATOR(MgDbException)
-    EXCEPTION_CLASS_CREATOR(MgDbXmlException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateGroupException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateNameException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateParameterException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateRepositoryException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateRoleException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateServerException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateSessionException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateUserException)
-    EXCEPTION_CLASS_CREATOR(MgDwfException)
-    EXCEPTION_CLASS_CREATOR(MgDwfSectionNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgDwfSectionResourceNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgEndOfStreamException)
-    EXCEPTION_CLASS_CREATOR(MgEvaluationExpiredException)
-    EXCEPTION_CLASS_CREATOR(MgGroupNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidDwfPackageException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidDwfSectionException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidFeatureSourceException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidIpAddressException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidLicenseException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidLogEntryException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidOperationVersionException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidPasswordException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidPrintLayoutFontSizeUnitsException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidPrintLayoutPositionUnitsException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidPrintLayoutSizeUnitsException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidSerialNumberException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidServerNameException)
-    EXCEPTION_CLASS_CREATOR(MgLicenseException)
-    EXCEPTION_CLASS_CREATOR(MgLicenseExpiredException)
-    EXCEPTION_CLASS_CREATOR(MgLogOpenFailedException)
-    EXCEPTION_CLASS_CREATOR(MgOperationProcessingException)
-    EXCEPTION_CLASS_CREATOR(MgParameterNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgPathTooLongException)
-    EXCEPTION_CLASS_CREATOR(MgPermissionDeniedException)
-    EXCEPTION_CLASS_CREATOR(MgPortNotAvailableException)
-    EXCEPTION_CLASS_CREATOR(MgPrintToScaleModeNotSelectedException)
-    EXCEPTION_CLASS_CREATOR(MgRasterTransformationNotSupportedException)
-    EXCEPTION_CLASS_CREATOR(MgRepositoryCreationFailedException)
-    EXCEPTION_CLASS_CREATOR(MgRepositoryNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgRepositoryNotOpenException)
-    EXCEPTION_CLASS_CREATOR(MgRepositoryOpenFailedException)
-    EXCEPTION_CLASS_CREATOR(MgRoleNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgServerNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgServerNotOnlineException)
-    EXCEPTION_CLASS_CREATOR(MgSessionExpiredException)
-    EXCEPTION_CLASS_CREATOR(MgSessionNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgUnauthorizedAccessException)
-    EXCEPTION_CLASS_CREATOR(MgUnknownTileProviderException)
-    EXCEPTION_CLASS_CREATOR(MgUnsupportedTileProviderException)
-    EXCEPTION_CLASS_CREATOR(MgUnsupportedProviderThreadModelException)
-    EXCEPTION_CLASS_CREATOR(MgUriFormatException)
 
     fact->Register(MapGuide_MapLayer_Map, MgMap::CreateObject);
     fact->Register(MapGuide_MapLayer_Layer, MgLayer::CreateObject);

Modified: trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -208,7 +208,7 @@
         arguments.Add(L"1");
         arguments.Add(sessionId);
 
-        throw new MgInvalidArgumentException(L"MgUserInformation.SetMgSessionId",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUserInformation.SetMgSessionId",
             __LINE__, __WFILE__, &arguments, L"MgInvalidSessionsId", NULL);
     }
 }
@@ -224,7 +224,7 @@
     // the locale can be either in the form "en" or "en-US"
     if (MG_LOCALE_LENGTH != locale.length() && MG_EXTENDED_LOCALE_LENGTH != locale.length())
     {
-        throw new MgLengthException(L"MgUserInformation.SetLocale",
+        throw new MgException(MgExceptionCodes::MgLengthException, L"MgUserInformation.SetLocale",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -233,7 +233,7 @@
         size_t dashChar = locale.find(L"-");
         if (ExtendedLocaleDashLocation != dashChar)
         {
-            throw new MgLengthException(L"MgUserInformation.SetLocale",
+            throw new MgException(MgExceptionCodes::MgLengthException, L"MgUserInformation.SetLocale",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
@@ -301,7 +301,7 @@
         {
             MgStringCollection args;
             args.Add(m_locale);
-            throw new MgInvalidArgumentException(L"MgUserInformation.CreateMgSessionId", __LINE__, __WFILE__, NULL, L"MgInvalidLocale", &args);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUserInformation.CreateMgSessionId", __LINE__, __WFILE__, NULL, L"MgInvalidLocale", &args);
         }
         locale = m_locale;
     }
@@ -369,7 +369,7 @@
 
 MgByteReader* MgUserInformation::GetReader()
 {
-    throw new MgNotImplementedException(L"MgUserInformation.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgUserInformation.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////
@@ -425,7 +425,7 @@
     if (NULL == userInfo)
     {
         // No user information should mean that we have opened the connection to the site server yet.
-        throw new MgConnectionNotOpenException(L"MgSiteConnection.GetCurrentUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionNotOpenException, L"MgSiteConnection.GetCurrentUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     SAFE_ADDREF(userInfo);

Modified: trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -98,7 +98,7 @@
             MgStringCollection arguments;
             arguments.Add(address);
 
-            throw new MgInvalidIpAddressException(L"MgIpUtil.IsIpv4Address",
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, L"MgIpUtil.IsIpv4Address",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -232,7 +232,7 @@
                 MgStringCollection arguments;
                 arguments.Add(address);
 
-                throw new MgInvalidIpAddressException(L"MgIpUtil.IsIpv6Address",
+                throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, L"MgIpUtil.IsIpv6Address",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
 
@@ -350,7 +350,7 @@
 
     if (localHostName.empty())
     {
-        throw new MgDomainException(L"MgIpUtil.GetLocalHostName",
+        throw new MgException(MgExceptionCodes::MgDomainException, L"MgIpUtil.GetLocalHostName",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -410,7 +410,7 @@
             MgStringCollection arguments;
             arguments.Add(address);
 
-            throw new MgInvalidIpAddressException(L"MgIpUtil.ValidateAddress",
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, L"MgIpUtil.ValidateAddress",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -501,7 +501,7 @@
             MgStringCollection arguments;
             arguments.Add(name);
 
-            throw new MgInvalidIpAddressException(L"MgIpUtil.HostNameToAddress",
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, L"MgIpUtil.HostNameToAddress",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -588,7 +588,7 @@
             MgStringCollection arguments;
             arguments.Add(address);
 
-            throw new MgInvalidIpAddressException(L"MgIpUtil.HostAddressToName",
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, L"MgIpUtil.HostAddressToName",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else

Modified: trunk/MgDev/Common/MapGuideCommon/Util/TimerUtil.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Util/TimerUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/MapGuideCommon/Util/TimerUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,6 +77,6 @@
 void MgTimerUtil::GetFrequency(LARGE_INTEGER* pFrequency)
 {
     if(!QueryPerformanceFrequency(pFrequency))
-        throw new MgUnclassifiedException(L"MgTimerUtil.GetFrequency", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTimerUtil.GetFrequency", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 #endif

Modified: trunk/MgDev/Common/PlatformBase/Data/IntCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Data/IntCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Data/IntCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -309,7 +309,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgIntCollection.ValidateIndex",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgIntCollection.ValidateIndex",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooBig", NULL);
     }
     else if (index < 0)
@@ -321,7 +321,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgIntCollection.ValidateIndex",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgIntCollection.ValidateIndex",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooSmall", NULL);
     }
 }

Modified: trunk/MgDev/Common/PlatformBase/Data/SerializableCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Data/SerializableCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Data/SerializableCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -215,7 +215,7 @@
 /// </returns>
 MgByteReader* MgSerializableCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"MgSerializableCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSerializableCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return NULL;
 }

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/ChangeList.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/ChangeList.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/ChangeList.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
 //
 void MgChangeList::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgChangeList.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgChangeList.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -118,7 +118,7 @@
 //
 void MgChangeList::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgChangeList.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgChangeList.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -211,7 +211,7 @@
 {
     if (m_type == MgLayerType::BaseMap)
     {
-        throw new MgInvalidOperationException(L"MgLayerBase.SetVisible",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgLayerBase.SetVisible",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -432,7 +432,7 @@
 void MgLayerBase::Serialize(MgStream* stream)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgLayerBase.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgLayerBase.Serialize");
 }
 
@@ -443,7 +443,7 @@
 void MgLayerBase::Deserialize(MgStream* stream)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgLayerBase.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgLayerBase.Deserialize");
 }
 
@@ -577,7 +577,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidLayerDefinitionException(L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidLayerDefinitionException, L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the feature layer definition from the parser - it's
@@ -600,7 +600,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidLayerDefinitionException(L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidLayerDefinitionException, L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the feature layer definition from the parser - it's
@@ -648,7 +648,7 @@
             STRING errorMsg = parser.GetErrorMessage();
             MgStringCollection arguments;
             arguments.Add(errorMsg);
-            throw new MgInvalidLayerDefinitionException(L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidLayerDefinitionException, L"MgLayerBase::GetLayerDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         MdfModel::LayerDefinition* ldef = parser.DetachLayerDefinition();
@@ -755,7 +755,7 @@
 ///
 MgClassDefinition* MgLayerBase::GetClassDefinition()
 {
-    throw new MgNotImplementedException(L"MgLayerBase.GetClassDefinition",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.GetClassDefinition",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -769,7 +769,7 @@
 ///
 MgFeatureReader* MgLayerBase::SelectFeatures(MgFeatureQueryOptions* options)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.SelectFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.SelectFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -783,7 +783,7 @@
 ///
 MgFeatureReader* MgLayerBase::SelectFeatures(MgFeatureQueryOptions* options, CREFSTRING coordinateSystem)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.SelectFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.SelectFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -797,7 +797,7 @@
 ///
 MgDataReader* MgLayerBase::SelectAggregate(MgFeatureAggregateOptions* options)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.SelectAggregate",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.SelectAggregate",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -809,49 +809,49 @@
 ///
 MgPropertyCollection* MgLayerBase::UpdateFeatures(MgFeatureCommandCollection* commands)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.UpdateFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.UpdateFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgPropertyCollection* MgLayerBase::UpdateFeatures(MgFeatureCommandCollection* commands, MgTransaction* transaction)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.UpdateFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.UpdateFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgTransaction* MgLayerBase::BeginTransaction()
 {
-    throw new MgNotImplementedException(L"MgLayerBase.BeginTransaction",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.BeginTransaction",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgFeatureReader* MgLayerBase::InsertFeatures(MgPropertyCollection* properties, MgTransaction* transaction)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.InsertFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.InsertFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgFeatureReader* MgLayerBase::InsertFeatures(MgBatchPropertyCollection* properties, MgTransaction* transaction)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.InsertFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.InsertFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 INT32 MgLayerBase::UpdateMatchingFeatures(MgPropertyCollection* properties, CREFSTRING filter, MgTransaction* transaction)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.UpdateMatchingFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.UpdateMatchingFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 INT32 MgLayerBase::DeleteFeatures(CREFSTRING filter, MgTransaction* transaction)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.DeleteFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.DeleteFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgSpatialContextReader* MgLayerBase::GetSpatialContexts(bool bActiveOnly)
 {
-    throw new MgNotImplementedException(L"MgLayerBase.GetSpatialContexts",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgLayerBase.GetSpatialContexts",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -137,7 +137,7 @@
 void MgMapBase::Create(MgResourceService* resourceService, MgResourceIdentifier* mapDefinition, CREFSTRING mapName)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgMapBase.Create", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapBase.Create", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgMapBase.Create")
 }
 
@@ -201,7 +201,7 @@
 void MgMapBase::Open(MgResourceService* resourceService, CREFSTRING mapName)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgMapBase.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapBase.Open", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgMapBase.Open")
 }
 
@@ -279,7 +279,7 @@
 
     if (index >= scaleCount || index < 0)
     {
-        throw new MgIndexOutOfRangeException(L"MgMapBase.GetFiniteDisplayScaleAt",
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgMapBase.GetFiniteDisplayScaleAt",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -396,7 +396,7 @@
 void MgMapBase::Serialize(MgStream* stream)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgMapBase.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapBase.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgMapBase.Serialize")
 }
 
@@ -407,7 +407,7 @@
 void MgMapBase::Deserialize(MgStream* stream)
 {
     MG_TRY()
-    throw new MgNotImplementedException(L"MgMapBase.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapBase.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgMapBase.Deserialize")
 }
 
@@ -672,7 +672,7 @@
     {
         changeList = new MgChangeList(objectId, layer);
         if(changeList == NULL)
-            throw new MgOutOfMemoryException(L"MgMapBase.TrackChange", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgMapBase.TrackChange", __LINE__, __WFILE__, NULL, L"", NULL);
 
         m_changeLists->Add(changeList);
     }
@@ -680,7 +680,7 @@
     //create a change record and adds it to the change list
     Ptr<MgObjectChange> change = new MgObjectChange(type);
     if(change == NULL)
-        throw new MgOutOfMemoryException(L"MgMapBase.TrackChange", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgMapBase.TrackChange", __LINE__, __WFILE__, NULL, L"", NULL);
 
     change->SetParam(param);
 
@@ -773,7 +773,7 @@
 ///
 MgService* MgMapBase::GetService(INT32 serviceType)
 {
-    throw new MgNotImplementedException(L"MgMapBase.GetService",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgMapBase.GetService",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -795,7 +795,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the map definition from the parser - it's
@@ -818,7 +818,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMapBase::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the map definition from the parser - it's

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,12 +92,12 @@
 
 MgFeatureReader* MgSelectionBase::GetSelectedFeatures(MgLayerBase* layer, CREFSTRING className, bool mappedOnly)
 {
-    throw new MgNotImplementedException(L"MgSelectionBase.GetSelectedFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSelectionBase.GetSelectedFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgFeatureReader* MgSelectionBase::GetSelectedFeatures(MgLayerBase* layer, CREFSTRING className, MgStringCollection* propertyNames)
 {
-    throw new MgNotImplementedException(L"MgSelectionBase.GetSelectedFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSelectionBase.GetSelectedFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 // Read selection from XML document.  Previous selection is cleared.
@@ -438,7 +438,7 @@
 {
     if (0 == (MgMapBase*)m_map)
     {
-        throw new MgInvalidMapDefinitionException(L"MgSelectionBase.GetLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgSelectionBase.GetLayers", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgReadOnlyLayerCollection> selLayers = new MgReadOnlyLayerCollection();
@@ -673,7 +673,7 @@
                     }
                     break;
                 default:
-                    throw new MgNotImplementedException(L"MgSelectionBase.GenerateFilters", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSelectionBase.GenerateFilters", __LINE__, __WFILE__, NULL, L"", NULL);
                     break;
                 }
 
@@ -1033,7 +1033,7 @@
 //
 void MgSelectionBase::Open(MgResourceService* resourceService, CREFSTRING mapName)
 {
-    throw new MgNotImplementedException(L"MgSelectionBase.Save", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSelectionBase.Save", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -1042,7 +1042,7 @@
 //
 void MgSelectionBase::Save(MgResourceService* resourceService, CREFSTRING mapName)
 {
-    throw new MgNotImplementedException(L"MgSelectionBase.Save", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgSelectionBase.Save", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/Watermark.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/Watermark.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/Watermark.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -39,7 +39,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidWatermarkDefinitionException(L"MgWatermark::GetWatermarkDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidWatermarkDefinitionException, L"MgWatermark::GetWatermarkDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the watermark definition from the parser - it's
@@ -62,7 +62,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidWatermarkDefinitionException(L"MgWatermark::GetWatermarkDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidWatermarkDefinitionException, L"MgWatermark::GetWatermarkDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the watermark definition from the parser - it's

Modified: trunk/MgDev/Common/PlatformBase/PlatformBase.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/PlatformBase.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/PlatformBase.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -54,33 +54,6 @@
 #include "Data/StringPropertyCollection.h"
 #include "Data/Vector3D.h"
 
-// Exceptions
-#include "Exception/ArrayTypeMismatchException.h"
-#include "Exception/DuplicateResourceDataException.h"
-#include "Exception/DuplicateResourceException.h"
-#include "Exception/EmptyFeatureSetException.h"
-#include "Exception/FdoException.h"
-#include "Exception/FeatureServiceException.h"
-#include "Exception/InvalidLayerDefinitionException.h"
-#include "Exception/InvalidMapDefinitionException.h"
-#include "Exception/InvalidWatermarkDefinitionException.h"
-#include "Exception/InvalidRepositoryNameException.h"
-#include "Exception/InvalidRepositoryTypeException.h"
-#include "Exception/InvalidResourceDataNameException.h"
-#include "Exception/InvalidResourceDataTypeException.h"
-#include "Exception/InvalidResourceNameException.h"
-#include "Exception/InvalidResourcePathException.h"
-#include "Exception/InvalidResourcePreProcessingTypeException.h"
-#include "Exception/InvalidResourceTypeException.h"
-#include "Exception/InvalidSymbolDefinitionException.h"
-#include "Exception/LayerNotFoundException.h"
-#include "Exception/ResourceBusyException.h"
-#include "Exception/ResourceDataNotFoundException.h"
-#include "Exception/ResourceNotFoundException.h"
-#include "Exception/ServiceNotAvailableException.h"
-#include "Exception/ServiceNotSupportedException.h"
-#include "Exception/UserNotFoundException.h"
-
 // Predeclare certain headers required by headers below
 #include "Services/ResourceDefs.h"
 #include "Services/ResourceIdentifier.h"

Modified: trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj
===================================================================
--- trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj	2022-10-10 09:40:18 UTC (rev 9971)
@@ -298,156 +298,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\ArrayTypeMismatchException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateResourceDataException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateResourceException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\EmptyFeatureSetException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\FdoException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\FeatureServiceException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLayerDefinitionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidMapDefinitionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidRepositoryNameException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidRepositoryTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceDataNameException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceDataTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceNameException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourcePathException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourcePreProcessingTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceTypeException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidSymbolDefinitionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidWatermarkDefinitionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\LayerNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceBusyException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceDataNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ServiceNotAvailableException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\ServiceNotSupportedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\UserNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Services\BaseServiceDefs.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -872,31 +722,6 @@
     <ClInclude Include="Data\Size2D.h" />
     <ClInclude Include="Data\StringPropertyCollection.h" />
     <ClInclude Include="Data\Vector3D.h" />
-    <ClInclude Include="Exception\ArrayTypeMismatchException.h" />
-    <ClInclude Include="Exception\DuplicateResourceDataException.h" />
-    <ClInclude Include="Exception\DuplicateResourceException.h" />
-    <ClInclude Include="Exception\EmptyFeatureSetException.h" />
-    <ClInclude Include="Exception\FdoException.h" />
-    <ClInclude Include="Exception\FeatureServiceException.h" />
-    <ClInclude Include="Exception\InvalidLayerDefinitionException.h" />
-    <ClInclude Include="Exception\InvalidMapDefinitionException.h" />
-    <ClInclude Include="Exception\InvalidRepositoryNameException.h" />
-    <ClInclude Include="Exception\InvalidRepositoryTypeException.h" />
-    <ClInclude Include="Exception\InvalidResourceDataNameException.h" />
-    <ClInclude Include="Exception\InvalidResourceDataTypeException.h" />
-    <ClInclude Include="Exception\InvalidResourceNameException.h" />
-    <ClInclude Include="Exception\InvalidResourcePathException.h" />
-    <ClInclude Include="Exception\InvalidResourcePreProcessingTypeException.h" />
-    <ClInclude Include="Exception\InvalidResourceTypeException.h" />
-    <ClInclude Include="Exception\InvalidSymbolDefinitionException.h" />
-    <ClInclude Include="Exception\InvalidWatermarkDefinitionException.h" />
-    <ClInclude Include="Exception\LayerNotFoundException.h" />
-    <ClInclude Include="Exception\ResourceBusyException.h" />
-    <ClInclude Include="Exception\ResourceDataNotFoundException.h" />
-    <ClInclude Include="Exception\ResourceNotFoundException.h" />
-    <ClInclude Include="Exception\ServiceNotAvailableException.h" />
-    <ClInclude Include="Exception\ServiceNotSupportedException.h" />
-    <ClInclude Include="Exception\UserNotFoundException.h" />
     <ClInclude Include="Services\BaseService.h" />
     <ClInclude Include="Services\BaseServiceDefs.h" />
     <ClInclude Include="Services\ClassDefinition.h" />

Modified: trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj.filters
===================================================================
--- trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj.filters	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/PlatformBase.vcxproj.filters	2022-10-10 09:40:18 UTC (rev 9971)
@@ -4,9 +4,6 @@
     <Filter Include="Data">
       <UniqueIdentifier>{c998d541-b8ef-434e-8be3-ec2660bb9c7c}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Exception">
-      <UniqueIdentifier>{b129b7be-89b1-4995-a47d-e092302b4eae}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Services">
       <UniqueIdentifier>{23ebfbb2-7b3a-49f3-b894-7c930d568034}</UniqueIdentifier>
     </Filter>
@@ -75,81 +72,6 @@
     <ClCompile Include="Data\Vector3D.cpp">
       <Filter>Data</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\ArrayTypeMismatchException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateResourceDataException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DuplicateResourceException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\EmptyFeatureSetException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\FdoException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\FeatureServiceException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLayerDefinitionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidMapDefinitionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidRepositoryNameException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidRepositoryTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceDataNameException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceDataTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceNameException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourcePathException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourcePreProcessingTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidResourceTypeException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidSymbolDefinitionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidWatermarkDefinitionException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\LayerNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceBusyException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceDataNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ResourceNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ServiceNotAvailableException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\ServiceNotSupportedException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\UserNotFoundException.cpp">
-      <Filter>Exception</Filter>
-    </ClCompile>
     <ClCompile Include="Services\BaseServiceDefs.cpp">
       <Filter>Services</Filter>
     </ClCompile>
@@ -411,81 +333,6 @@
     <ClInclude Include="Data\Vector3D.h">
       <Filter>Data</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\ArrayTypeMismatchException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateResourceDataException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DuplicateResourceException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\EmptyFeatureSetException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\FdoException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\FeatureServiceException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidLayerDefinitionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidMapDefinitionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidRepositoryNameException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidRepositoryTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourceDataNameException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourceDataTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourceNameException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourcePathException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourcePreProcessingTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidResourceTypeException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidSymbolDefinitionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidWatermarkDefinitionException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\LayerNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourceBusyException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourceDataNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ResourceNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ServiceNotAvailableException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\ServiceNotSupportedException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\UserNotFoundException.h">
-      <Filter>Exception</Filter>
-    </ClInclude>
     <ClInclude Include="Services\BaseService.h">
       <Filter>Services</Filter>
     </ClInclude>

Modified: trunk/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/PlatformBaseBuild.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -34,31 +34,6 @@
 #include "Data/SingleProperty.cpp"
 #include "Data/StringPropertyCollection.cpp"
 #include "Data/Vector3D.cpp"
-#include "Exception/ArrayTypeMismatchException.cpp"
-#include "Exception/DuplicateResourceDataException.cpp"
-#include "Exception/DuplicateResourceException.cpp"
-#include "Exception/EmptyFeatureSetException.cpp"
-#include "Exception/FdoException.cpp"
-#include "Exception/FeatureServiceException.cpp"
-#include "Exception/InvalidMapDefinitionException.cpp"
-#include "Exception/InvalidLayerDefinitionException.cpp"
-#include "Exception/InvalidWatermarkDefinitionException.cpp"
-#include "Exception/InvalidRepositoryNameException.cpp"
-#include "Exception/InvalidRepositoryTypeException.cpp"
-#include "Exception/InvalidResourceDataNameException.cpp"
-#include "Exception/InvalidResourceDataTypeException.cpp"
-#include "Exception/InvalidResourceNameException.cpp"
-#include "Exception/InvalidResourcePathException.cpp"
-#include "Exception/InvalidResourcePreProcessingTypeException.cpp"
-#include "Exception/InvalidResourceTypeException.cpp"
-#include "Exception/InvalidSymbolDefinitionException.cpp"
-#include "Exception/LayerNotFoundException.cpp"
-#include "Exception/ResourceBusyException.cpp"
-#include "Exception/ResourceDataNotFoundException.cpp"
-#include "Exception/ResourceNotFoundException.cpp"
-#include "Exception/ServiceNotAvailableException.cpp"
-#include "Exception/ServiceNotSupportedException.cpp"
-#include "Exception/UserNotFoundException.cpp"
 #include "MapLayer/ChangeList.cpp"
 #include "MapLayer/LayerBase.cpp"
 #include "MapLayer/LayerCollection.cpp"

Modified: trunk/MgDev/Common/PlatformBase/Services/ClassDefinitionCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ClassDefinitionCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ClassDefinitionCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -215,5 +215,5 @@
 
 MgByteReader* MgClassDefinitionCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"ClassDefinitionCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"ClassDefinitionCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/DataPropertyDefinition.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/DataPropertyDefinition.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/DataPropertyDefinition.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -274,7 +274,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgDataPropertyDefinition::ValidateArgument",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDataPropertyDefinition::ValidateArgument",
         __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooSmall", NULL);
    }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/DeleteFeatures.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/DeleteFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/DeleteFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -40,7 +40,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgDeleteFeatures.MgDeleteFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgDeleteFeatures.MgDeleteFeatures",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureCommandType.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureCommandType.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureCommandType.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,7 +63,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgFeatureCommandType.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFeatureCommandType.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -461,7 +461,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgFeatureQueryOptions.ValidateEmptyArgument",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFeatureQueryOptions.ValidateEmptyArgument",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureSchema.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureSchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureSchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -46,7 +46,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgFeatureSchema.SetName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFeatureSchema.SetName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     m_name = name;

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureSchemaCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureSchemaCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureSchemaCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -261,5 +261,5 @@
 
 MgByteReader* MgFeatureSchemaCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"FeatureSchemaCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"FeatureSchemaCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureService.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
                                                                               CREFSTRING schemaName,
                                                                               CREFSTRING className)
 {
-    throw new MgNotImplementedException(L"MgFeatureService.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgFeatureService.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -74,6 +74,6 @@
                                                                      CREFSTRING schemaName,
                                                                      MgStringCollection* classNames)
 {
-    throw new MgNotImplementedException(L"MgFeatureService.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgFeatureService.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureService.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureService.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureService.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -2326,7 +2326,7 @@
 #define MG_CHECK_FEATURE_SET_COUNT(pointer, methodname)                       \
 if (0 == pointer->GetCount())                                                 \
 {                                                                             \
-    throw new MgEmptyFeatureSetException(methodname,                          \
+    throw new MgException(MgExceptionCodes::MgEmptyFeatureSetException, methodname,                          \
         __LINE__, __WFILE__, NULL, L"", NULL);                                \
 }
 
@@ -2333,7 +2333,7 @@
 #define MG_CHECK_PROPERTY_TYPE(property, type, methodname)                    \
 if (property != type)                                                         \
 {                                                                             \
-    throw new MgInvalidPropertyTypeException(methodname,                      \
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, methodname,                      \
         __LINE__, __WFILE__, NULL, L"", NULL);                                \
 }
 ///\endcond

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureSpatialOperations.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureSpatialOperations.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureSpatialOperations.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgFeatureSpatialOperations.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFeatureSpatialOperations.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/GeometryTypeInfo.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/GeometryTypeInfo.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/GeometryTypeInfo.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -76,7 +76,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgGeometryTypeInfo::SetTypes",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgGeometryTypeInfo::SetTypes",
         __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooBig", NULL);
     }
     else if(0 > count)
@@ -88,7 +88,7 @@
         arguments.Add(L"1");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgGeometryTypeInfo::SetTypes",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgGeometryTypeInfo::SetTypes",
         __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooSmall", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/InsertFeatures.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/InsertFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/InsertFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -43,7 +43,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgInsertFeatures.MgInsertFeatures", __LINE__,
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgInsertFeatures.MgInsertFeatures", __LINE__,
             __WFILE__, &arguments, L"MgPropertyValuesEmpty", NULL);
     }
 
@@ -76,7 +76,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgInsertFeatures.MgInsertFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgInsertFeatures.MgInsertFeatures",
             __LINE__, __WFILE__, &arguments, L"MgPropertyValuesEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/LockFeatures.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/LockFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/LockFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -37,7 +37,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgLockFeatures.MgLockFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLockFeatures.MgLockFeatures",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/ObjectPropertyType.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ObjectPropertyType.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ObjectPropertyType.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -64,7 +64,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgObjectPropertyType.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgObjectPropertyType.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/OrderingOption.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/OrderingOption.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/OrderingOption.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -56,7 +56,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgOrderingOption.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgOrderingOption.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/Parameter.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/Parameter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/Parameter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -21,7 +21,7 @@
 
 #define CHECK_NULL_PARAMETER(method_name) \
     if (NULL == m_parameter) \
-        throw new MgInvalidOperationException(method_name, __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, method_name, __LINE__, __WFILE__, NULL, L"", NULL);
 
 ///////////////////////////////////////////////////////////////////
 /// <summary>

Modified: trunk/MgDev/Common/PlatformBase/Services/ParameterCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ParameterCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ParameterCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -244,5 +244,5 @@
 
 MgByteReader* MgParameterCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"MgParameterCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgParameterCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PlatformBaseClassId.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -55,6 +55,9 @@
 #define PlatformBase_Data_Margin                                    PLATFORMBASE_DATA_ID+15
 
 // Platform Exceptions
+//
+// NOTE: Although we removed these exceptions, we are keeping the ids in to prevent these ids from being
+// accidentally used for new classes in the future
 #define PlatformBase_Exception_MgArrayTypeMismatchException                 PLATFORMBASE_EXCEPTION_ID+0
 #define PlatformBase_Exception_MgDuplicateResourceDataException             PLATFORMBASE_EXCEPTION_ID+1
 #define PlatformBase_Exception_MgDuplicateResourceException                 PLATFORMBASE_EXCEPTION_ID+2

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/MapViewportBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/MapViewportBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/MapViewportBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -160,7 +160,7 @@
     {
         if (mapViewport->GetType() != m_type)
         {
-            throw new MgInvalidResourceTypeException(L"MgMapViewportBase.PopulateFromResource",
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgMapViewportBase.PopulateFromResource",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -250,7 +250,7 @@
         MgStringCollection arguments;
         arguments.Add(errorMsg);
 
-        throw new MgXmlParserException(L"MgPrintLayoutBase.PopulateFromResource",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgPrintLayoutBase.PopulateFromResource",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -438,7 +438,7 @@
         MgStringCollection arguments;
         arguments.Add(errorMsg);
 
-        throw new MgXmlParserException(L"MgPrintLayoutElementBase.PopulateFromResource",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgPrintLayoutElementBase.PopulateFromResource",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutElementCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -215,6 +215,6 @@
 // Creates an XML document representing the collection.
 MgByteReader* MgPrintLayoutElementCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"PrintLayoutElementCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"PrintLayoutElementCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutServiceBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutServiceBase.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PrintLayoutServiceBase.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -102,7 +102,7 @@
 
     if (!resId->IsResourceTypeOf(MgResourceType::PrintLayoutDefinition))
     {
-        throw new MgInvalidResourceTypeException(L"MgPrintLayoutServiceBase.CreatePrintLayout",
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgPrintLayoutServiceBase.CreatePrintLayout",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -120,7 +120,7 @@
     CHECKARGUMENTNULL(resId, L"MgPrintLayoutServiceBase.CreatePrintLayoutElement");
     if (!resId->IsResourceTypeOf(MgResourceType::PrintLayoutElementDefinition))
     {
-        throw new MgInvalidResourceTypeException(L"MgPrintLayoutServiceBase.CreatePrintLayoutElement",
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgPrintLayoutServiceBase.CreatePrintLayoutElement",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PropertyMappingCollection.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PropertyMappingCollection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/PrintLayoutService/PropertyMappingCollection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -213,6 +213,6 @@
 
 MgByteReader* MgPropertyMappingCollection::ToXml()
 {
-    throw new MgNotImplementedException(L"PropertyMappingCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"PropertyMappingCollection.ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/Raster.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/Raster.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/Raster.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -199,7 +199,7 @@
     // and accessing it.
     if (L"" == m_handle || m_featureService == NULL)
     {
-        throw new MgInvalidOperationException(L"MgRaster.GetStream", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgRaster.GetStream", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgByteReader> byteReader;
@@ -279,7 +279,7 @@
         MgStringCollection arguments;
         arguments.Add(L"Raster");
 
-        throw new MgNullPropertyValueException(L"MgRaster.NullCheck",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgRaster.NullCheck",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/ReaderType.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ReaderType.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ReaderType.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgReaderType.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgReaderType.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceIdentifier.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceIdentifier.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceIdentifier.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -453,7 +453,7 @@
     {
         MgStringCollection args;
         args.Add(resource);
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgResourceIdentifier.ParseIdentifier", __LINE__,  __WFILE__, NULL, L"MgBadResourceIdentifer", &args);
     }
 
@@ -522,7 +522,7 @@
             }
             else
             {
-                throw new MgInvalidRepositoryTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
                     L"MgResourceIdentifier.ParsePathname", __LINE__,  __WFILE__, NULL, L"", NULL);
             }
         }
@@ -569,7 +569,7 @@
      && m_repositoryType != MgRepositoryType::Session
      && m_repositoryType != MgRepositoryType::Site)
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgResourceIdentifier.CheckRepositoryType", __LINE__,  __WFILE__, NULL, L"", NULL);
     }
 }
@@ -586,7 +586,7 @@
 {
     if (MgRepositoryType::Session == m_repositoryType && m_repositoryName.empty())
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgResourceIdentifier.CheckRepositoryName", __LINE__,  __WFILE__, NULL, L"", NULL);
     }
     else if (MgRepositoryType::Session != m_repositoryType && !m_repositoryName.empty())
@@ -593,7 +593,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(m_repositoryName);
-        throw new MgInvalidRepositoryNameException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryNameException, 
             L"MgResourceIdentifier.CheckRepositoryName", __LINE__,  __WFILE__, &arguments, L"", NULL);
     }
 
@@ -609,7 +609,7 @@
         MgStringCollection arguments;
         arguments.Add(m_repositoryName);
 
-        throw new MgInvalidRepositoryNameException(L"MgResourceIdentifier.CheckRepositoryName",
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryNameException, L"MgResourceIdentifier.CheckRepositoryName",
             __LINE__,  __WFILE__, &arguments, L"", NULL);
     }
 }
@@ -640,7 +640,7 @@
         MgStringCollection arguments;
         arguments.Add(m_path);
 
-        throw new MgInvalidResourcePathException(L"MgResourceIdentifier.CheckPath",
+        throw new MgException(MgExceptionCodes::MgInvalidResourcePathException, L"MgResourceIdentifier.CheckPath",
             __LINE__,  __WFILE__, &arguments, L"", NULL);
     }
 }
@@ -657,7 +657,7 @@
 {
     if (m_name.empty() && MgResourceType::Folder != m_type)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgResourceIdentifier.CheckName", __LINE__,  __WFILE__, NULL, L"", NULL);
     }
     else if (MgResourceType::Role == m_type
@@ -668,7 +668,7 @@
         MgStringCollection arguments;
         arguments.Add(m_name);
 
-        throw new MgInvalidResourceNameException(L"MgResourceIdentifier.CheckName",
+        throw new MgException(MgExceptionCodes::MgInvalidResourceNameException, L"MgResourceIdentifier.CheckName",
             __LINE__,  __WFILE__, &arguments, L"", NULL);
     }
 
@@ -684,7 +684,7 @@
         MgStringCollection arguments;
         arguments.Add(m_name);
 
-        throw new MgInvalidResourceNameException(L"MgResourceIdentifier.CheckName",
+        throw new MgException(MgExceptionCodes::MgInvalidResourceNameException, L"MgResourceIdentifier.CheckName",
             __LINE__,  __WFILE__, &arguments, L"", NULL);
     }
 }
@@ -710,7 +710,7 @@
     {
         SAFE_RELEASE(e);
 
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgResourceIdentifier.CheckType", __LINE__,  __WFILE__, NULL, L"", NULL);
     }
 
@@ -720,7 +720,7 @@
          || MgResourceType::Group == resourceType
          || MgResourceType::Role  == resourceType)
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgResourceIdentifier.CheckType", __LINE__,  __WFILE__, NULL, L"", NULL);
         }
     }
@@ -732,7 +732,7 @@
          || MgResourceType::Group     == resourceType
          || MgResourceType::Role      == resourceType)
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgResourceIdentifier.CheckType", __LINE__,  __WFILE__, NULL, L"", NULL);
         }
     }
@@ -743,13 +743,13 @@
          && MgResourceType::Role   != resourceType
          && MgResourceType::Folder != resourceType)
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgResourceIdentifier.CheckType", __LINE__,  __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgResourceIdentifier.CheckType", __LINE__,  __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -16,8 +16,6 @@
 //
 
 #include "PlatformBase.h"
-#include "Exception/ServiceNotAvailableException.h"
-#include "Exception/NotImplementedException.h"
 
 //////////////////////////////////////////////////////////////////
 /// <summary>
@@ -92,7 +90,7 @@
     MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
     INT32 properties, CREFSTRING fromDate, CREFSTRING toDate, bool computeChildren)
 {
-    throw new MgNotImplementedException(L"MgResourceService.EnumerateResources",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.EnumerateResources",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -103,7 +101,7 @@
 STRING MgResourceService::EnumerateResourceDocuments(
     MgStringCollection* resources, CREFSTRING type, INT32 properties)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgResourceService.EnumerateResourceDocuments",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
@@ -115,7 +113,7 @@
 void MgResourceService::MoveResource(MgResourceIdentifier* sourceResource,
                    MgResourceIdentifier* destResource, bool overwrite)
 {
-    throw new MgNotImplementedException(L"MgResourceService.MoveResource",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.MoveResource",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -122,7 +120,7 @@
 void MgResourceService::MoveResource(MgResourceIdentifier* sourceResource,
                   MgResourceIdentifier* destResource, bool overwrite, bool cascade)
 {
-    throw new MgNotImplementedException(L"MgResourceService.MoveResource",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.MoveResource",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -163,7 +161,7 @@
 MgStringCollection* MgResourceService::GetResourceContents(MgStringCollection* resources,
                                         MgStringCollection* preProcessTags)
 {
-    throw new MgNotImplementedException(L"MgResourceService.GetResourceContents", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.GetResourceContents", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -219,7 +217,7 @@
 void MgResourceService::SetResourceMetadata(
     MgResourceIdentifier* resource, MgByteReader* content)
 {
-    throw new MgNotImplementedException(L"MgResourceService.SetResourceMetadata", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.SetResourceMetadata", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -238,13 +236,13 @@
 MgByteReader* MgResourceService::GetResourceMetadata(
     MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(L"MgResourceService.GetResourceMetadata", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.GetResourceMetadata", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
 bool MgResourceService::HasPermission(MgResourceIdentifier* resource, CREFSTRING permission)
 {
-    throw new MgNotImplementedException(L"MgResourceService.HasPermission", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.HasPermission", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -256,5 +254,5 @@
 ///
 MgByteReader* MgResourceService::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter)
 {
-    throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedData", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgResourceService.EnumerateUnmanagedData", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/Service.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/Service.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/Service.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -70,7 +70,7 @@
 MgUserInformation* MgService::GetUserInfo()
 {
     MG_TRY()
-        throw new MgNotImplementedException(L"MgService.GetUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgService.GetUserInfo", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgService.GetUserInfo");
     return NULL;
 }
@@ -83,7 +83,7 @@
 void MgService::SetConnectionProperties(MgConnectionProperties* connProp)
 {
     MG_TRY()
-        throw new MgNotImplementedException(L"MgService.SetConnectionProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgService.SetConnectionProperties", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_CATCH_AND_THROW(L"MgService.SetConnectionProperties");
 }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/ServiceRegistry.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ServiceRegistry.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/ServiceRegistry.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
     const ServiceCreatorFunc& func = registry[serviceType];
     if (NULL == func)
     {
-        throw new MgServiceNotSupportedException(L"MgServiceRegistry.CreateService", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgServiceNotSupportedException, L"MgServiceRegistry.CreateService", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MgService* obj = (*func)();
@@ -82,7 +82,7 @@
 {
     if (NULL == creator)
     {
-        throw new MgInvalidArgumentException(L"MgServiceRegistry.RegisterClass", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServiceRegistry.RegisterClass", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     m_serviceCreators[connType][serviceType] = creator;
@@ -170,29 +170,6 @@
     fact->Register(PlatformBase_PrintLayoutService_PrintLayoutElementCollection, MgPrintLayoutElementCollection::CreateObject);
     fact->Register(PlatformBase_PrintLayoutService_PropertyMappingCollection, MgPropertyMappingCollection::CreateObject);
 
-    EXCEPTION_CLASS_CREATOR(MgArrayTypeMismatchException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateResourceDataException)
-    EXCEPTION_CLASS_CREATOR(MgDuplicateResourceException)
-    EXCEPTION_CLASS_CREATOR(MgEmptyFeatureSetException)
-    EXCEPTION_CLASS_CREATOR(MgFdoException)
-    EXCEPTION_CLASS_CREATOR(MgFeatureServiceException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidMapDefinitionException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidRepositoryNameException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidRepositoryTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourceDataNameException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourceDataTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourceNameException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourcePathException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourcePreProcessingTypeException)
-    EXCEPTION_CLASS_CREATOR(MgInvalidResourceTypeException)
-    EXCEPTION_CLASS_CREATOR(MgLayerNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgResourceBusyException)
-    EXCEPTION_CLASS_CREATOR(MgResourceDataNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgResourceNotFoundException)
-    EXCEPTION_CLASS_CREATOR(MgServiceNotAvailableException)
-    EXCEPTION_CLASS_CREATOR(MgServiceNotSupportedException)
-    EXCEPTION_CLASS_CREATOR(MgUserNotFoundException)
-
     return true;
 }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/SpatialContextExtentType.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/SpatialContextExtentType.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/SpatialContextExtentType.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -50,7 +50,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgSpatialContextExtentType.ValidateRange",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSpatialContextExtentType.ValidateRange",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
         }
     }

Modified: trunk/MgDev/Common/PlatformBase/Services/UnlockFeatures.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/UnlockFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/UnlockFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,7 +32,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgUnlockFeatures.MgUnlockFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUnlockFeatures.MgUnlockFeatures",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Common/PlatformBase/Services/UpdateFeatures.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/UpdateFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Common/PlatformBase/Services/UpdateFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -45,7 +45,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgUpdateFeatures.MgUpdateFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUpdateFeatures.MgUpdateFeatures",
             __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
     }
 

Index: trunk/MgDev/Desktop
===================================================================
--- trunk/MgDev/Desktop	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop	2022-10-10 09:40:18 UTC (rev 9971)

Property changes on: trunk/MgDev/Desktop
___________________________________________________________________
Modified: svn:mergeinfo
## -9,6 +9,7 ##
 /sandbox/jng/convenience_apis/Desktop:8271-8363
 /sandbox/jng/createruntimemap/Desktop:7486-7555
 /sandbox/jng/dwftk/Desktop:8321-8324,8328-8329,8331,8352
+/sandbox/jng/flatten_exceptions/Desktop:9743-9755
 /sandbox/jng/geos34x/Desktop:8256-8259
 /sandbox/jng/msvc2019/Desktop:9884-9896
 /sandbox/jng/v30/Desktop:8215-8216,8218-8219
Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopApiGen.xml
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,22 +88,6 @@
     
     <!-- MapGuideDesktop classes -->
 
-    <Header path="../../MgDesktop/Exception/AliasNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/ConnectionFailedException.h" />
-    <Header path="../../MgDesktop/Exception/DuplicateParameterException.h" />
-    <Header path="../../MgDesktop/Exception/DwfException.h" />
-    <Header path="../../MgDesktop/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidLogEntryException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/ParameterNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/StylizeLayerFailedException.h" />
-
     <Header path="../../MgDesktop/Services/DataReader.h" />
     <Header path="../../MgDesktop/Services/DrawingService.h" />
     <Header path="../../MgDesktop/Services/FeatureReader.h" />
@@ -130,6 +114,7 @@
     <Header path="../../MgDesktop/Services/Rendering/RenderingOptions.h" />
 
     <Header path="../../MgDesktop/System/PlatformInit.h" />
+    <Header path="../../MgDesktop/System/ExceptionCodes.h" />
 
     <Header path="../../MgDesktop/MapLayer/Layer.h" />
     <Header path="../../MgDesktop/MapLayer/Map.h" />

Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopConstants.xml
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopConstants.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/DotNet/MapGuideDesktopConstants.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,6 +77,7 @@
     <Class name="MgdUnitType" />
     <Class name="MgdPageUnitsType" />
     <Class name="MgdImageFormats" />
+    <Class name="MgdExceptionCodes" />
 </Classes>
 
 <!--
@@ -87,6 +88,7 @@
     <Header path="../../MgDesktop/Services/ImageFormats.h" />
     <Header path="../../MgDesktop/Services/Rendering/MapPlotInstruction.h" />
     <Header path="../../MgDesktop/Services/Rendering/UnitType.h" />
+    <Header path="../../MgDesktop/System/ExceptionCodes.h" />
 </Headers>
 
 </Parameters>

Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/JavaApiEx/catchall.code
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/JavaApiEx/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/JavaApiEx/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowJavaExceptionWrapper(jenv, e);
 }

Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/Constants.xml
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/Constants.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/Constants.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -123,6 +123,7 @@
   <Class name="MgUnitType" />
   <Class name="MgPackageStatus" />
   <Class name="MgRasterDataModelType" />
+  <Class name="MgExceptionCodes" />
 </Classes>
 
 <!--
@@ -136,6 +137,7 @@
     <Header path="../../../Common/Foundation/Data/FeaturePropertyType.h" />
     <Header path="../../../Common/Foundation/Data/MimeType.h" />
     <Header path="../../../Common/Foundation/Data/PropertyType.h" />
+    <Header path="../../../Common/Foundation/Exception/ExceptionCodes.h" />
 
     <Header path="../../../Common/PlatformBase/MapLayer/LayerGroupType.h" />
     <Header path="../../../Common/PlatformBase/MapLayer/LayerType.h" />

Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/MapGuideApiGen.xml
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/MapGuideApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/MapGuideApi/MapGuideApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -108,55 +108,8 @@
     <Header path="../../../Common/Foundation/Data/StringProperty.h" />
 
     <Header path="../../../Common/Foundation/Exception/Exception.h" />
-    <Header path="../../../Common/Foundation/Exception/SystemException.h" />
-    <Header path="../../../Common/Foundation/Exception/IoException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/StreamIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfRangeException.h" />
+    <Header path="../../../Common/Foundation/Exception/ExceptionCodes.h" />
 
-    <Header path="../../../Common/Foundation/Exception/ApplicationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ArgumentOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/ClassNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationSaveFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/DateTimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/DecryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/DirectoryNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/DivideByZeroException.h" />
-    <Header path="../../../Common/Foundation/Exception/DomainException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateDirectoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateFileException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateObjectException.h" />
-    <Header path="../../../Common/Foundation/Exception/EncryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/IndexOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidCastException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidOperationException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidPropertyTypeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidStreamHeaderException.h" />
-    <Header path="../../../Common/Foundation/Exception/LengthException.h" />
-    <Header path="../../../Common/Foundation/Exception/LogicException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotFiniteNumberException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotImplementedException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullPropertyValueException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullReferenceException.h" />
-    <Header path="../../../Common/Foundation/Exception/ObjectNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfMemoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/OverflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/PlatformNotSupportedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/RuntimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/TemporaryFileNotAvailableException.h" />
-    <Header path="../../../Common/Foundation/Exception/ThirdPartyException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnclassifiedException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnderflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlParserException.h" />
-
     <!-- Geometry classes -->
 
     <Header path="../../../Common/Geometry/GeometricEntity.h" />
@@ -244,17 +197,6 @@
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemTransform.h" />
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemUnitInformation.h" />
 
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemComputationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemConversionFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemLoadFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemTransformFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/GeometryException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h" />
-
     <!-- PlatformBase classes -->
 
     <Header path="../../../Common/PlatformBase/Data/BlobProperty.h" />
@@ -272,29 +214,6 @@
     <Header path="../../../Common/PlatformBase/Data/SingleProperty.h" />
     <Header path="../../../Common/PlatformBase/Data/StringPropertyCollection.h" />
 
-    <Header path="../../../Common/PlatformBase/Exception/ArrayTypeMismatchException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceDataException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/EmptyFeatureSetException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FdoException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FeatureServiceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidMapDefinitionException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePathException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePreProcessingTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/LayerNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceBusyException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceDataNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotAvailableException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotSupportedException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/UserNotFoundException.h" />
-
     <Header path="../../../Common/PlatformBase/Services/FeatureCommand.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureQueryOptions.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureSourceParams.h" />
@@ -346,21 +265,6 @@
     <Header path="../../../Common/PlatformBase/MapLayer/SelectionBase.h" />
 
     <!-- mg-desktop classes -->
-    <Header path="../../MgDesktop/Exception/AliasNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/ConnectionFailedException.h" />
-    <Header path="../../MgDesktop/Exception/DuplicateParameterException.h" />
-    <Header path="../../MgDesktop/Exception/DwfException.h" />
-    <Header path="../../MgDesktop/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidLogEntryException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../MgDesktop/Exception/ParameterNotFoundException.h" />
-    <Header path="../../MgDesktop/Exception/StylizeLayerFailedException.h" />
 
     <Header path="../../MgDesktop/Services/DataReader.h" />
     <Header path="../../MgDesktop/Services/DrawingService.h" />
@@ -388,6 +292,7 @@
     <Header path="../../MgDesktop/Services/Rendering/RenderingOptions.h" />
 
     <Header path="../../MgDesktop/System/PlatformInit.h" />
+    <Header path="../../MgDesktop/System/ExceptionCodes.h" />
 
     <Header path="../../MgDesktop/MapLayer/Layer.h" />
     <Header path="../../MgDesktop/MapLayer/Map.h" />

Modified: trunk/MgDev/Desktop/DesktopUnmanagedApi/catchall.code
===================================================================
--- trunk/MgDev/Desktop/DesktopUnmanagedApi/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/DesktopUnmanagedApi/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowDotNetExceptionWrapper(e);
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Log/LogManager.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Log/LogManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Log/LogManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -330,7 +330,7 @@
 {
     if (filename.empty())
     {
-        throw new MgNullArgumentException(L"MgdLogManager.ValidateLogFileName", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.ValidateLogFileName", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     if (STRING::npos != filename.find(L"\\") ||
         STRING::npos != filename.find(L"/"))
@@ -343,7 +343,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"\\/");
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.ValidateLogFileName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.ValidateLogFileName",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -1992,7 +1992,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(m_path);
-        throw new MgFileIoException(L"MgdLogManager.EnumerateLogs", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdLogManager.EnumerateLogs", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     dirent* direntry = NULL;
@@ -2071,7 +2071,7 @@
 {
     if (oldFileName.empty() || newFileName.empty())
     {
-        throw new MgNullArgumentException(L"MgdLogManager.RenameLog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.RenameLog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_LOGMANAGER_TRY()
@@ -2100,7 +2100,7 @@
 {
     if (fileName.empty())
     {
-        throw new MgNullArgumentException(L"MgdLogManager.DeleteLog", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.DeleteLog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (STRING::npos != fileName.find(L"\\") ||
@@ -2113,7 +2113,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"\\/");
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.DeleteLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.DeleteLog",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -2173,7 +2173,7 @@
             arguments.Add(L"Failed to queue ACE_Message_Block.");
             messageId = L"MgFormatInnerExceptionMessage";
 
-            MgException* mgException = new MgRuntimeException(L"MgdLogManager.QueueLogEntry", __LINE__, __WFILE__, NULL, messageId, &arguments);
+            MgException* mgException = new MgException(MgExceptionCodes::MgRuntimeException, L"MgdLogManager.QueueLogEntry", __LINE__, __WFILE__, NULL, messageId, &arguments);
             throw mgException;
         }
     }
@@ -2314,7 +2314,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgdLogManager.WriteLogMessage",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.WriteLogMessage",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
         }
@@ -2346,7 +2346,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(filename);
-                    throw new MgFileIoException(L"MgdLogManager.WriteLogMessage", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdLogManager.WriteLogMessage", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 LogToOStream(pAce, pLogStream);
@@ -2473,7 +2473,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdLogManager.GetLogHeader",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.GetLogHeader",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }
@@ -2561,7 +2561,7 @@
         if (buffer == NULL)
         {
             ACE_OS::fclose(pReadFile);
-            throw new MgOutOfMemoryException(L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Clear buffer
@@ -2608,7 +2608,7 @@
 
     if (numEntries < 0)
     {
-        throw new  MgArgumentOutOfRangeException(L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     INT32 lastPos;      // Keeps track of the position in the file
@@ -2723,7 +2723,7 @@
 
     if (fromDate == NULL || toDate == NULL)
     {
-        throw new MgNullArgumentException(L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (*fromDate > *toDate)
@@ -2732,7 +2732,7 @@
         arguments.Add(L"2");
         arguments.Add(fromDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.GetLogContents",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFromDate", NULL);
     }
 
@@ -2744,7 +2744,7 @@
         arguments.Add(L"3");
         arguments.Add(toDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.GetLogContents",
             __LINE__, __WFILE__, &arguments, L"MgInvalidDateDifference", NULL);
     }
 
@@ -2772,7 +2772,7 @@
         arguments.Add(L"3");
         arguments.Add(toDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.GetLogContents",
              __LINE__, __WFILE__, &arguments, L"MgFailedToGetFileNameForDates", NULL);
     }
 
@@ -2779,7 +2779,7 @@
     entries = new MgStringCollection();
     if (entries == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     bool fromDateFound = false;
@@ -2944,7 +2944,7 @@
 
     if (filenames == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     STRING rawFilename;
@@ -2983,7 +2983,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdLogManager.DeterminePotentialFileNames",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.DeterminePotentialFileNames",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }
@@ -3104,7 +3104,7 @@
 
     if (lines == NULL || searchDate == NULL)
     {
-        throw new MgNullArgumentException(L"MgdLogManager.SearchClosestDateAfter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.SearchClosestDateAfter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgDateTime> dateTime;
@@ -3184,7 +3184,7 @@
 
     if (lines == NULL || searchDate == NULL)
     {
-        throw new MgNullArgumentException(L"MgdLogManager.SearchClosestDateBefore", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdLogManager.SearchClosestDateBefore", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Ptr<MgDateTime> dateTime;
@@ -3274,7 +3274,7 @@
     // is enclosed by angle brackets, i.e. <CCYY-MM-DDThh:mm:ss>
     if (entry.find_first_of(L'<') != 0  || entry.find_first_of(L'>') != 20)
     {
-        throw new MgdInvalidLogEntryException(
+        throw new MgException(MgExceptionCodes::MgInvalidLogEntryException, 
             L"MgdLogManager.GetDateTimeFromEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -3491,7 +3491,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgdLogManager.ArchiveLog",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.ArchiveLog",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
     }
@@ -3627,7 +3627,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgdLogManager.ValidateLogHeaders",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.ValidateLogHeaders",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
     }
@@ -3956,7 +3956,7 @@
         arguments.Add(L"2");
         arguments.Add(logFileType);
 
-        throw new MgInvalidArgumentException(L"MgdLogManager.DetermineLogFileStatus",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.DetermineLogFileStatus",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -4086,7 +4086,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdLogManager.CheckArchiveFrequency",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLogManager.CheckArchiveFrequency",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Log/LogThread.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Log/LogThread.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Log/LogThread.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -118,7 +118,7 @@
                             //MgServerManager* pServerManager = MgServerManager::GetInstance();
                             //STRING locale = pServerManager->GetDefaultMessageLocale();
                             STRING locale = MgResources::DefaultMessageLocale;
-                            mgException = new MgFdoException(L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
+                            mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(locale).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(locale).c_str(), mgException->GetStackTrace(locale).c_str());
 
@@ -130,7 +130,7 @@
                             //STRING locale = pServerManager->GetDefaultMessageLocale();
                             STRING locale = MgResources::DefaultMessageLocale;
 
-                            mgException = MgSystemException::Create(e, L"MgdLogThread.svc", __LINE__, __WFILE__);
+                            mgException = MgException::Create(e, L"MgdLogThread.svc", __LINE__, __WFILE__);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(locale).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(locale).c_str(), mgException->GetStackTrace(locale).c_str());
                         }
@@ -139,7 +139,7 @@
                             //MgServerManager* pServerManager = MgServerManager::GetInstance();
                             //STRING locale = pServerManager->GetDefaultMessageLocale();
                             STRING locale = MgResources::DefaultMessageLocale;
-                            mgException = new MgUnclassifiedException(L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+                            mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(locale).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(locale).c_str(), mgException->GetStackTrace(locale).c_str());
                         }
@@ -171,7 +171,7 @@
         //STRING locale = pServerManager->GetDefaultMessageLocale();
         STRING locale = MgResources::DefaultMessageLocale;
 
-        mgException = MgSystemException::Create(e, L"MgdLogThread.svc", __LINE__, __WFILE__);
+        mgException = MgException::Create(e, L"MgdLogThread.svc", __LINE__, __WFILE__);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(locale).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(locale).c_str(), mgException->GetStackTrace(locale).c_str());
 
@@ -183,7 +183,7 @@
         //STRING locale = pServerManager->GetDefaultMessageLocale();
         STRING locale = MgResources::DefaultMessageLocale;
 
-        mgException = new MgUnclassifiedException(L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgdLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(locale).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(locale).c_str(), mgException->GetStackTrace(locale).c_str());
 

Modified: trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (NULL == baseMap)
     {
-        throw new MgNullReferenceException(L"MgdLayer.GetMap",
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdLayer.GetMap",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -338,7 +338,7 @@
         MgStringCollection arguments;
         arguments.Add(errorMsg);
         //TODO: MgdInvalidFeatureSourceException
-        throw new MgFeatureServiceException(L"MgdLayer::UpdateFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdLayer::UpdateFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     std::unique_ptr<MdfModel::FeatureSource> featureSource;
@@ -366,7 +366,7 @@
 
         if (string::npos == endIndex)
         {
-            throw new MgXmlParserException(L"MgdLayer.UpdateFeatures",
+            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgdLayer.UpdateFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
@@ -589,7 +589,7 @@
         Ptr<MgDataPropertyDefinition> prop = dynamic_cast<MgDataPropertyDefinition*>(idProps->GetItem(nIds));
         if (0 == (MgDataPropertyDefinition*)prop)
         {
-            throw new MgInvalidCastException(L"MgdLayer.PopulateIdentityProperties",
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgdLayer.PopulateIdentityProperties",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
         MgdLayer::IdProperty idProp;

Modified: trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MapLayer/Layer.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_MAP_LAYER_H
 #define DESKTOP_MAP_LAYER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -114,10 +114,10 @@
 void MgdMap::SetDisplaySize(INT32 width, INT32 height)
 {
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgdMap::SetDisplaySize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdMap::SetDisplaySize", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgdMap::SetDisplaySize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdMap::SetDisplaySize", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MgMapBase::SetDisplayHeight(height);
     MgMapBase::SetDisplayWidth(width);
@@ -180,7 +180,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgdMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgdMap.Create", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // build the runtime map object from the parsed definition
@@ -363,7 +363,7 @@
                 //attach the layer to its group
                 itKg = knownGroups.find(groupName);
                 if(itKg == knownGroups.end())
-                    throw new MgInvalidMapDefinitionException(L"MgdMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgdMap.Create", __LINE__, __WFILE__, NULL, L"", NULL);
 
                 rtLayer->SetGroup(itKg->second);
             }
@@ -530,7 +530,7 @@
 
     if (NULL == m_resId.p)
     {
-        throw new MgNullReferenceException(L"MgdMap.Save",
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMap.Save",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -572,7 +572,7 @@
 
     if (NULL == m_resId.p)
     {
-        throw new MgNullReferenceException(L"MgdMap.Save",
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMap.Save",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -665,7 +665,7 @@
         {
             // If this exception is thrown then the calling code should probably initialize the
             // resource service using SetDelayedLoadResourceService()
-            throw new MgInvalidOperationException(L"MgdMap.UnpackLayersAndGroups", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdMap.UnpackLayersAndGroups", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -894,7 +894,7 @@
 
     if (version != m_serializeVersion)
     {
-        throw new MgStreamIoException(L"MgdMap.Deserialize", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"MgdMap.Deserialize", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
     }
 
     //resource id for MgdMap
@@ -999,7 +999,7 @@
 {
     if (NULL == resourceService)
     {
-        throw new MgNullArgumentException(L"MgdMap.SetDelayedLoadResourceService",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMap.SetDelayedLoadResourceService",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MapLayer/Map.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_MAP_H
 #define DESKTOP_MAP_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/MapLayer/Selection.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MapLayer/Selection.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MapLayer/Selection.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SELECTION_H
 #define DESKTOP_SELECTION_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/MgDesktop.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MgDesktop.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MgDesktop.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef MGDESKTOP_H
 #define MGDESKTOP_H
 
@@ -22,23 +39,8 @@
 #include "System/ClassId.h"
 #include "System/ConfigProperties.h"
 #include "System/PlatformInit.h"
+#include "System/ExceptionCodes.h"
 
-#include "Exception/AliasNotFoundException.h"
-#include "Exception/ConnectionFailedException.h"
-#include "Exception/DuplicateParameterException.h"
-#include "Exception/DwfException.h"
-#include "Exception/DwfSectionNotFoundException.h"
-#include "Exception/DwfSectionResourceNotFoundException.h"
-#include "Exception/InvalidDwfPackageException.h"
-#include "Exception/InvalidDwfSectionException.h"
-#include "Exception/InvalidFeatureSourceException.h"
-#include "Exception/InvalidLogEntryException.h"
-#include "Exception/InvalidPrintLayoutFontSizeUnitsException.h"
-#include "Exception/InvalidPrintLayoutPositionUnitsException.h"
-#include "Exception/InvalidPrintLayoutSizeUnitsException.h"
-#include "Exception/ParameterNotFoundException.h"
-#include "Exception/StylizeLayerFailedException.h"
-
 #include "MapLayer/Layer.h"
 #include "MapLayer/Map.h"
 #include "MapLayer/Selection.h"
@@ -76,7 +78,7 @@
 #include "Services/Resource/UnmanagedDataType.h"
 
 #define NOT_IMPLEMENTED(method) \
-    throw new MgNotImplementedException(method, __LINE__, __WFILE__, NULL, L"", NULL)
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, method, __LINE__, __WFILE__, NULL, L"", NULL)
 
 //Uncomment to debug memory leaks. This is the header for Visual Leak Detector
 //See: http://vld.codeplex.com for download and setup

Modified: trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj	2022-10-10 09:40:18 UTC (rev 9971)
@@ -226,18 +226,6 @@
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="Exception\AliasNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidLogEntryException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Log\LogDetail.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -484,12 +472,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\ConnectionFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Services\Rendering\CustomLogoInfo.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -520,30 +502,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\DuplicateParameterException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionResourceNotFoundException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Services\Rendering\DwfVersion.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -646,42 +604,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfPackageException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfSectionException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidFeatureSourceException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutFontSizeUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutPositionUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutSizeUnitsException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Services\Feature\JoinFeatureReader.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -749,10 +671,10 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\ParameterNotFoundException.cpp">
+    <ClCompile Include="System\ExceptionCodes.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="System\PlatformInit.cpp">
@@ -893,12 +815,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="Exception\StylizeLayerFailedException.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Services\Tile\TileCache.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -973,13 +889,12 @@
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Exception\AliasNotFoundException.h" />
-    <ClInclude Include="Exception\InvalidLogEntryException.h" />
     <ClInclude Include="Log\LogDetail.h" />
     <ClInclude Include="Log\LogEntryData.h" />
     <ClInclude Include="Log\LogManager.h" />
     <ClInclude Include="Log\LogThread.h" />
     <ClInclude Include="Log\LogType.h" />
+    <ClInclude Include="ExceptionCodes.h" />
     <ClInclude Include="Services\CryptoDefs.h" />
     <ClInclude Include="Services\Feature\BooleanDataReaderCreator.h" />
     <ClInclude Include="Services\Feature\ByteDataReaderCreator.h" />
@@ -1015,7 +930,6 @@
     <ClInclude Include="Services\Feature\FeatureNumericFunctions.h" />
     <ClInclude Include="Services\Feature\FeatureSetReader.h" />
     <ClInclude Include="Services\Feature\FeatureStringFunctions.h" />
-    <ClInclude Include="Services\Feature\FeautreNumericFunctions.h" />
     <ClInclude Include="Services\Feature\GeometryDataReaderCreator.h" />
     <ClInclude Include="Services\Feature\Int16DataReaderCreator.h" />
     <ClInclude Include="Services\Feature\Int32DataReaderCreator.h" />
@@ -1033,7 +947,6 @@
     <ClInclude Include="Services\Resource\ResourceContentCache.h" />
     <ClInclude Include="System\ClassId.h" />
     <ClInclude Include="System\ConfigProperties.h" />
-    <ClInclude Include="Exception\ConnectionFailedException.h" />
     <ClInclude Include="Services\Rendering\CustomLogoInfo.h" />
     <ClInclude Include="Services\Rendering\CustomTextInfo.h" />
     <ClInclude Include="Services\DataReader.h" />
@@ -1040,10 +953,7 @@
     <ClInclude Include="Services\Drawing\DrawingDefs.h" />
     <ClInclude Include="Services\DrawingService.h" />
     <ClInclude Include="Services\Drawing\DrawingServiceUtil.h" />
-    <ClInclude Include="Exception\DuplicateParameterException.h" />
     <ClInclude Include="Exception\DwfException.h" />
-    <ClInclude Include="Exception\DwfSectionNotFoundException.h" />
-    <ClInclude Include="Exception\DwfSectionResourceNotFoundException.h" />
     <ClInclude Include="Services\Rendering\DwfVersion.h" />
     <ClInclude Include="Services\Feature\FdoConnectionPool.h" />
     <ClInclude Include="Services\Feature\FdoConnectionUtil.h" />
@@ -1063,12 +973,6 @@
     <ClInclude Include="Services\Feature\GwsFeatureReader.h" />
     <ClInclude Include="Services\Rendering\icons.h" />
     <ClInclude Include="Services\ImageFormats.h" />
-    <ClInclude Include="Exception\InvalidDwfPackageException.h" />
-    <ClInclude Include="Exception\InvalidDwfSectionException.h" />
-    <ClInclude Include="Exception\InvalidFeatureSourceException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutFontSizeUnitsException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutPositionUnitsException.h" />
-    <ClInclude Include="Exception\InvalidPrintLayoutSizeUnitsException.h" />
     <ClInclude Include="Services\Feature\JoinFeatureReader.h" />
     <ClInclude Include="MapLayer\Layer.h" />
     <ClInclude Include="Services\Rendering\Layout.h" />
@@ -1081,6 +985,7 @@
     <ClInclude Include="Services\Rendering\MapPlotInstruction.h" />
     <ClInclude Include="Services\Feature\MgCSTrans.h" />
     <ClInclude Include="MgDesktop.h" />
+    <ClInclude Include="System\ExceptionCodes.h" />
     <ClInclude Include="System\Mutex.h" />
     <ClInclude Include="Services\Resource\OperationInfo.h" />
     <ClInclude Include="Services\Resource\OperationParameter.h" />

Modified: trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj.filters
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj.filters	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MgDesktop.vcxproj.filters	2022-10-10 09:40:18 UTC (rev 9971)
@@ -15,9 +15,6 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Exception\AliasNotFoundException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Resource\ByteSourceDwfInputStreamImpl.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -27,9 +24,6 @@
     <ClCompile Include="System\ConfigProperties.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\ConnectionFailedException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Rendering\CustomLogoInfo.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -45,18 +39,6 @@
     <ClCompile Include="Services\Drawing\DrawingServiceUtil.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\DuplicateParameterException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionNotFoundException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\DwfSectionResourceNotFoundException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Rendering\DwfVersion.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -108,24 +90,6 @@
     <ClCompile Include="Services\ImageFormats.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfPackageException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidDwfSectionException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidFeatureSourceException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutFontSizeUnitsException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutPositionUnitsException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Exception\InvalidPrintLayoutSizeUnitsException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Feature\JoinFeatureReader.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -162,9 +126,6 @@
     <ClCompile Include="Services\Resource\OperationParameter.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\ParameterNotFoundException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="System\PlatformInit.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -234,9 +195,6 @@
     <ClCompile Include="Services\SqlReader.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\StylizeLayerFailedException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Services\Tile\TileCache.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -288,9 +246,6 @@
     <ClCompile Include="Services\Feature\ProxyDataReader.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Exception\InvalidLogEntryException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Log\LogDetail.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -390,11 +345,11 @@
     <ClCompile Include="Services\Resource\ResourceContentCache.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="System\ExceptionCodes.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Exception\AliasNotFoundException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Resource\ByteSourceDwfInputStreamImpl.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -407,9 +362,6 @@
     <ClInclude Include="System\ConfigProperties.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\ConnectionFailedException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Rendering\CustomLogoInfo.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -428,18 +380,9 @@
     <ClInclude Include="Services\Drawing\DrawingServiceUtil.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\DuplicateParameterException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Exception\DwfException.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\DwfSectionNotFoundException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\DwfSectionResourceNotFoundException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Rendering\DwfVersion.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -497,24 +440,6 @@
     <ClInclude Include="Services\ImageFormats.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\InvalidDwfPackageException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidDwfSectionException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidFeatureSourceException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutFontSizeUnitsException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutPositionUnitsException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Exception\InvalidPrintLayoutSizeUnitsException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Feature\JoinFeatureReader.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -701,9 +626,6 @@
     <ClInclude Include="Services\Feature\FeatureStringFunctions.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Services\Feature\FeautreNumericFunctions.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Services\Feature\GeometryDataReaderCreator.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -731,9 +653,6 @@
     <ClInclude Include="Services\Feature\Matrix.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="Exception\InvalidLogEntryException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Log\LogType.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -839,6 +758,12 @@
     <ClInclude Include="Services\Resource\ResourceContentCache.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="ExceptionCodes.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="System\ExceptionCodes.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="Platform.ini" />

Modified: trunk/MgDev/Desktop/MgDesktop/MgDesktopBuild.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/MgDesktopBuild.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/MgDesktopBuild.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,24 +1,26 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "System/ConfigProperties.cpp"
+#include "System/ExceptionCodes.cpp"
 #include "System/PlatformInit.cpp"
 #include "System/TimerUtil.cpp"
 #include "System/ThreadBase.cpp"
 
-#include "Exception/AliasNotFoundException.cpp"
-#include "Exception/ConnectionFailedException.cpp"
-#include "Exception/DuplicateParameterException.cpp"
-#include "Exception/DwfException.cpp"
-#include "Exception/DwfSectionNotFoundException.cpp"
-#include "Exception/DwfSectionResourceNotFoundException.cpp"
-#include "Exception/InvalidDwfPackageException.cpp"
-#include "Exception/InvalidDwfSectionException.cpp"
-#include "Exception/InvalidFeatureSourceException.cpp"
-#include "Exception/InvalidLogEntryException.cpp"
-#include "Exception/InvalidPrintLayoutFontSizeUnitsException.cpp"
-#include "Exception/InvalidPrintLayoutPositionUnitsException.cpp"
-#include "Exception/InvalidPrintLayoutSizeUnitsException.cpp"
-#include "Exception/ParameterNotFoundException.cpp"
-#include "Exception/StylizeLayerFailedException.cpp"
-
 #include "Log/LogDetail.cpp"
 #include "Log/LogEntryData.cpp"
 #include "Log/LogManager.cpp"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ByteSourceRasterStreamImpl.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ByteSourceRasterStreamImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ByteSourceRasterStreamImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -30,7 +30,7 @@
 {
     if (stream == NULL)
     {
-        throw new MgNullReferenceException(L"ByteSourceRasterStreamImpl", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"ByteSourceRasterStreamImpl", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_stream = FDO_SAFE_ADDREF(stream);
 }
@@ -62,7 +62,7 @@
 {
     if (buffer == NULL)
     {
-        throw new MgNullArgumentException(L"ByteSourceRasterStreamImpl.Read", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"ByteSourceRasterStreamImpl.Read", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (length < 0)
@@ -74,7 +74,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"ByteSourceRasterStreamImpl.Read",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"ByteSourceRasterStreamImpl.Read",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/CryptoDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/CryptoDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/CryptoDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_CRYPTO_DEFS_H
 #define DESKTOP_CRYPTO_DEFS_H
 
@@ -23,27 +40,27 @@
                 break;                                                        \
                                                                               \
             case ecInvalidOperation:                                          \
-                cryptographyException = new MgInvalidOperationException(      \
+                cryptographyException = new MgException(MgExceptionCodes::MgInvalidOperationException,       \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecNullArgument:                                              \
-                cryptographyException = new MgNullArgumentException(          \
+                cryptographyException = new MgException(MgExceptionCodes::MgNullArgumentException,           \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecInvalidArgument:                                           \
-                cryptographyException = new MgInvalidArgumentException(       \
+                cryptographyException = new MgException(MgExceptionCodes::MgInvalidArgumentException,        \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecLengthError:                                               \
-                cryptographyException = new MgLengthException(                \
+                cryptographyException = new MgException(MgExceptionCodes::MgLengthException,                 \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecDateTimeError:                                             \
-                cryptographyException = new MgDateTimeException(              \
+                cryptographyException = new MgException(MgExceptionCodes::MgDateTimeException,               \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
@@ -50,23 +67,23 @@
             case ecFileIoError:                                               \
             case ecReadError:                                                 \
             case ecWriteError:                                                \
-                cryptographyException = new MgFileIoException(                \
+                cryptographyException = new MgException(MgExceptionCodes::MgFileIoException,                 \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecEncryptionError:                                           \
-                cryptographyException = new MgEncryptionException(            \
+                cryptographyException = new MgException(MgExceptionCodes::MgEncryptionException,             \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecDecryptionError:                                           \
-                cryptographyException = new MgDecryptionException(            \
+                cryptographyException = new MgException(MgExceptionCodes::MgDecryptionException,             \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
                                                                               \
             case ecUnclassified:                                              \
             default:                                                          \
-                cryptographyException = new MgUnclassifiedException(          \
+                cryptographyException = new MgException(MgExceptionCodes::MgUnclassifiedException,           \
                     methodName, __LINE__, __WFILE__, NULL, L"", NULL);        \
                 break;                                                        \
         }                                                                     \
@@ -79,12 +96,12 @@
     }                                                                         \
     catch (exception& e)                                                      \
     {                                                                         \
-        cryptographyException = MgSystemException::Create(                    \
+        cryptographyException = MgException::Create(                    \
             e, methodName, __LINE__, __WFILE__);                              \
     }                                                                         \
     catch (...)                                                               \
     {                                                                         \
-        cryptographyException = new MgUnclassifiedException(                  \
+        cryptographyException = new MgException(MgExceptionCodes::MgUnclassifiedException,                   \
             methodName, __LINE__, __WFILE__, NULL, L"", NULL);                \
     }                                                                         \
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/DataReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/DataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/DataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "DataReader.h"
 #include "Services/Feature/FeatureDefs.h"
 #include "Services/Feature/FeatureConnection.h"
@@ -70,7 +87,7 @@
             FdoDataType dataType = m_reader->GetDataType(propertyName.c_str());
             if (FdoDataType(-1) == dataType)
             {
-                throw new MgInvalidPropertyTypeException(L"MgdDataReader.GetPropertyType",
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdDataReader.GetPropertyType",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -84,7 +101,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgdDataReader.GetPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdDataReader.GetPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -127,7 +144,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetBoolean",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetBoolean",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -152,7 +169,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetByte",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetByte",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -179,7 +196,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetDateTime",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetDateTime",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -204,7 +221,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetSingle",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetSingle",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -229,7 +246,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetDouble",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetDouble",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -254,7 +271,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetInt16",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetInt16",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -279,7 +296,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetInt32",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetInt32",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -304,7 +321,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetInt64",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetInt64",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -334,7 +351,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetString",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetString",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -409,7 +426,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdDataReader::GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -461,7 +478,7 @@
     {
         // TODO: specify which argument and message, once we have the mechanism
         STRING message = MgdFeatureUtil::GetMessage(L"MgMissingRasterProperty");
-        throw new MgInvalidOperationException(L"MgdDataReader::GetRaster",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdDataReader::GetRaster",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     byteReader = MgdFeatureUtil::GetRaster(m_reader, rasterPropName, xSize, ySize);
@@ -666,7 +683,7 @@
 
 MgByteReader* MgdDataReader::ToXml() 
 { 
-    throw new MgNotImplementedException(L"MgdDataReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdDataReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //INTERNAL_API:
@@ -700,7 +717,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdDataReader::GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdDataReader::GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -720,10 +737,10 @@
 
 void MgdDataReader::Serialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdDataReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdDataReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgdDataReader::Deserialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdDataReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdDataReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
\ No newline at end of file

Modified: trunk/MgDev/Desktop/MgDesktop/Services/DataReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/DataReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/DataReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_DATA_READER_H
 #define DESKTOP_DATA_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_DRAWING_DEFS_H
 #define DESKTOP_DRAWING_DEFS_H
 
@@ -15,7 +32,7 @@
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(STRING(e.message()));                                   \
-        mgException = new MgdDwfException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgDwfException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "DrawingServiceUtil.h"
 #include "DrawingDefs.h"
@@ -289,7 +306,7 @@
 
     if (resourceService == 0)
     {
-        throw new MgServiceNotAvailableException(L"MgdDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"MgdDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     byteReader = resourceService->GetResourceContent(resource, L"Substitution");
@@ -329,7 +346,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(dwfFileName);
-        throw new MgdInvalidDwfPackageException(L"MgdDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgdDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     MG_SERVER_DRAWING_SERVICE_CATCH_AND_THROW(L"MgdDrawingServiceUtil.OpenDrawingResource")
@@ -390,7 +407,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(X2W(e.getMessage()));
-        throw new MgXmlParserException(L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
     catch (const DOMException& e)
@@ -397,12 +414,12 @@
     {
         MgStringCollection arguments;
         arguments.Add(X2W(e.msg));
-        throw new MgXmlParserException(L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
     catch (...)
     {
-        throw new MgUnclassifiedException(L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgdDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Drawing/DrawingServiceUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_DRAWING_SERVICE_UTIL_H
 #define DESKTOP_DRAWING_SERVICE_UTIL_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "DrawingService.h"
 #include "ServiceFactory.h"
 #include "Services/Drawing/DrawingDefs.h"
@@ -41,7 +58,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.GetDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.GetDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Get the name of the dwf file from the resource content and remove the path from the filename
@@ -110,7 +127,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else
     {
@@ -140,7 +157,7 @@
                 DWFCORE_FREE_OBJECT(pStream);
             if (0 != pBuffer)
                 DWFCORE_FREE_MEMORY(pBuffer);
-            throw new MgInvalidCastException(L"MgdDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgdDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Return the manifest via a MgByteReader
@@ -222,7 +239,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.GetSection", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.GetSection", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (sectionName.empty())
     {
@@ -230,7 +247,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdDrawingService.GetSection",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.GetSection",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     else
@@ -244,7 +261,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdDwfSectionNotFoundException(L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Create a DWFPackageWriter for writing the section to a temporary DWF file
@@ -350,7 +367,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (resourceName.empty())
     {
@@ -358,7 +375,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdDrawingService.GetSectionResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.GetSectionResource",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     else
@@ -374,7 +391,7 @@
             arguments.Add(L"2");
             arguments.Add(resourceName);
 
-            throw new MgInvalidArgumentException(L"MgdDrawingService.GetSectionResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.GetSectionResource",
                 __LINE__, __WFILE__, &arguments, L"MgResourceNameSeparatorNotFound", NULL);
         }
         sectionName = resourceName.substr(0, index);
@@ -385,7 +402,7 @@
             arguments.Add(L"2");
             arguments.Add(resourceName);
 
-            throw new MgInvalidArgumentException(L"MgdDrawingService.GetSectionResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.GetSectionResource",
                 __LINE__, __WFILE__, &arguments, L"MgResourceNameDoesNotContainSectionName", NULL);
         }
 
@@ -396,7 +413,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdDwfSectionNotFoundException(L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         // ...check if the resource exists in the section
         DWFResource* pResource = pSection->findResourceByHREF(resourceName.c_str());
@@ -404,7 +421,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(resourceName);
-            throw new MgdDwfSectionResourceNotFoundException(L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionResourceNotFoundException, L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         // ...get the mime type for the resource
         STRING wsMimeType = (STRING)pResource->mime();
@@ -421,7 +438,7 @@
                 DWFCORE_FREE_OBJECT(pStream);
             if (0 != pBuffer)
                 DWFCORE_FREE_MEMORY(pBuffer);
-            throw new MgInvalidCastException(L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgdDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Return the resource via a MgByteReader
@@ -505,7 +522,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (sectionName.empty())
     {
@@ -513,7 +530,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdDrawingService.EnumerateLayers",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.EnumerateLayers",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     else
@@ -527,7 +544,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdDwfSectionNotFoundException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Get the resources for the section
@@ -547,7 +564,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(sectionName);
-                    throw new MgdInvalidDwfSectionException(L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 pResource = piResources->get();
@@ -559,13 +576,13 @@
 
         if (0 == pResource)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         DWFInputStream* pStream = pResource->getInputStream();
         if (0 == pStream)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         size_t nBytes = pStream->available();
         char* pBuffer = DWFCORE_ALLOC_MEMORY( char, nBytes );
@@ -573,7 +590,7 @@
         DWFCORE_FREE_OBJECT(pStream);
         if (0 == pBuffer)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Write the memory buffer to a temporary file
@@ -583,7 +600,7 @@
         FILE* fp = fopen( tempW2dFileName.c_str(), "wb+" );  // NOXLATE
         if (0 == fp)
         {
-            throw new MgTemporaryFileNotAvailableException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgTemporaryFileNotAvailableException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         fwrite(pBuffer, sizeof(char), nBytes, fp);
@@ -695,7 +712,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (sectionName.empty())
     {
@@ -703,7 +720,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdDrawingService.GetLayer",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.GetLayer",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     else
@@ -717,7 +734,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdDwfSectionNotFoundException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         pSection->readDescriptor();
 
@@ -738,7 +755,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(sectionName);
-                    throw new MgdInvalidDwfSectionException(L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgdDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 pResource = piResources->get();
@@ -750,13 +767,13 @@
 
         if (0 == pResource)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         DWFInputStream* pStream = pResource->getInputStream();
         if (0 == pStream)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         size_t nBytes = pStream->available();
         char* pBuffer = DWFCORE_ALLOC_MEMORY( char, nBytes );
@@ -764,7 +781,7 @@
         DWFCORE_FREE_OBJECT(pStream);
         if (0 == pBuffer)
         {
-            throw new MgNullReferenceException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Write the memory buffer to a temporary file
@@ -774,7 +791,7 @@
         FILE* fp = fopen( tempW2dFileName.c_str(), "wb+" );  // NOXLATE
         if (0 == fp)
         {
-            throw new MgTemporaryFileNotAvailableException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgTemporaryFileNotAvailableException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         fwrite(pBuffer, sizeof(char), nBytes, fp);
@@ -846,7 +863,7 @@
             // Cannot find specified layer in the Dwf section
             MgStringCollection arguments;
             arguments.Add(targetLayer.name);
-            throw new MgLayerNotFoundException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgLayerNotFoundException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Use EPlotSection to get section color, paper
@@ -869,7 +886,7 @@
             pPaper) );
         if (0 == pPage)
         {
-            throw new MgOutOfMemoryException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         // Set properties for the section
         pPage->provideProperty(
@@ -886,7 +903,7 @@
             L"") );
         if (0 == p2Dgfx)
         {
-            throw new MgOutOfMemoryException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         p2Dgfx->configureGraphic(pTransform, pExtents, pClip);
 
@@ -896,7 +913,7 @@
         if (pW2DFile == NULL)
         {
             DWFCORE_FREE_OBJECT( p2Dgfx );
-            throw new MgOutOfMemoryException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         DWFFileInputStream* pW2DFilestream = DWFCORE_ALLOC_OBJECT( DWFFileInputStream );
         if (pW2DFilestream == NULL)
@@ -903,7 +920,7 @@
         {
             DWFCORE_FREE_OBJECT( p2Dgfx );
             DWFCORE_FREE_OBJECT( pW2DFile );
-            throw new MgOutOfMemoryException(L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgdDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         //... open the file and bind it to the stream
         pW2DFile->open();
@@ -1009,7 +1026,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.EnumerateSections", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.EnumerateSections", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else
     {
@@ -1155,7 +1172,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (sectionName.empty())
     {
@@ -1163,7 +1180,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdDrawingService.EnumerateSectionResources",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdDrawingService.EnumerateSectionResources",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
     else
@@ -1177,7 +1194,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdDwfSectionNotFoundException(L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Get all the resources in the section
@@ -1187,7 +1204,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgdInvalidDwfSectionException(L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgdDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Iterate through the resources and write to xml document
@@ -1304,7 +1321,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(L"MgdDrawingService.GetCoordinateSpace", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDrawingService.GetCoordinateSpace", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Get the coordinate space from the resource content.

Modified: trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/DrawingService.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_DRAWING_SERVICE_H
 #define DESKTOP_DRAWING_SERVICE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ApplySchema.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ApplySchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ApplySchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -39,7 +39,7 @@
 
     if (NULL == resource || NULL == schema)
     {
-        throw new MgNullArgumentException(L"MgdApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Connect to provider
@@ -57,7 +57,7 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgdFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgdApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIDescribeSchema> fdoDecribeSchemaCmd = (FdoIDescribeSchema*) fdoConn->CreateCommand(FdoCommandType_DescribeSchema);

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "CreateFeatureSource.h"
 #include "Services/Feature/FdoConnectionUtil.h"
@@ -37,7 +54,7 @@
             creator->CreateFeatureSource(false, false);
         }
         else
-            throw new MgInvalidArgumentException(L"MgdCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     else if (NULL != rdbParams)
     {
@@ -51,7 +68,7 @@
             creator->CreateFeatureSource();
         }
         else
-            throw new MgInvalidArgumentException(L"MgdCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resource, L"MgdCreateFeatureSource.CreateFeatureSource")
@@ -86,13 +103,13 @@
     //
     Ptr<MgFeatureSchema> schema = m_params->GetFeatureSchema();
     if(schema == NULL)
-        throw new MgInvalidArgumentException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSchema", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSchema", NULL);
 
     if (bCheckFeatureClass)
     {
         Ptr<MgClassDefinitionCollection> classes = schema->GetClasses();
         if(classes == NULL || classes->GetCount() == 0)
-            throw new MgInvalidArgumentException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
 
         for(INT32 ci = 0; ci < classes->GetCount(); ci++)
         {
@@ -99,7 +116,7 @@
             Ptr<MgClassDefinition> classDef = classes->GetItem(ci);
             Ptr<MgPropertyDefinitionCollection> idProps = classDef->GetIdentityProperties();
             if(idProps == NULL || idProps->GetCount() == 0)
-                throw new MgInvalidArgumentException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
         }
     }
 
@@ -107,7 +124,7 @@
     {
         // A coordinate system must be defined
         if(m_params->GetCoordinateSystemWkt().empty())
-            throw new MgInvalidArgumentException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
     }
 
     // Connect to provider
@@ -119,13 +136,13 @@
     {
         if(NULL == connWrap.p)
         {
-            throw new MgdConnectionFailedException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIConnection> conn = connWrap->GetConnection();
         if (conn == NULL)
         {
-            throw new MgdConnectionFailedException(L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         CreateDataStore(conn);
@@ -452,7 +469,7 @@
         //Amend connection string to incorporate the created data store
         conn = new MgdFeatureConnection(provider, connStr);
         if (!conn->IsConnectionOpen())
-            throw new MgdConnectionFailedException(L"MgdCreateRdbmsFeatureSource::CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdCreateRdbmsFeatureSource::CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
 
         fdoConn = conn->GetConnection();
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/CreateFeatureSource.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_CREATE_FEATURE_SOURCE_H
 #define DESKTOP_CREATE_FEATURE_SOURCE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/DescribeSchema.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/DescribeSchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/DescribeSchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -200,7 +200,7 @@
                     }
                     else
                     {
-                        throw new MgdConnectionFailedException(L"MgdDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
 
@@ -210,7 +210,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resource, L"MgdDescribeSchema.DescribeFdoSchema")
@@ -546,7 +546,7 @@
                         }
                         else
                         {
-                            throw new MgdConnectionFailedException(L"MgdDescribeSchema.DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdDescribeSchema.DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
 
                     }  // end if (NULL != secFeatureSource)
@@ -655,7 +655,7 @@
 
     if (NULL == schema)
     {
-        throw new MgNullArgumentException(L"MgdDescribeSchema.SchemaToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDescribeSchema.SchemaToXml", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     CHECKNULL((MgFeatureSchemaCollection*)schema, L"MgdDescribeSchema.SchemaToXml");
@@ -679,7 +679,7 @@
 
     if (NULL == schema)
     {
-        throw new MgNullArgumentException(L"MgdDescribeSchema.SchemaToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDescribeSchema.SchemaToXml", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     CHECKNULL((MgFeatureSchemaCollection*)schema, L"MgdDescribeSchema.SchemaToXml");
@@ -902,7 +902,7 @@
         }
         else
         {
-            throw new MgdConnectionFailedException(L"MgdDescribeSchema.GetSchemas",
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdDescribeSchema.GetSchemas",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1005,7 +1005,7 @@
         }
         else
         {
-            throw new MgdConnectionFailedException(L"MgdDescribeSchema.GetClasses",
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdDescribeSchema.GetClasses",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1035,7 +1035,7 @@
 
     if (className.empty())
     {
-        throw new MgClassNotFoundException(
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
             L"MgdDescribeSchema.GetClassDefinition",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1062,7 +1062,7 @@
 
         if (NULL == classDefinition.p)
         {
-            throw new MgClassNotFoundException(
+            throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
                 L"MgdDescribeSchema.GetClassDefinition",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1094,7 +1094,7 @@
 
     if (NULL == classNames || classNames->GetCount() == 0)
     {
-        throw new MgClassNotFoundException(
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
             L"MgdDescribeSchema.GetIdentityProperties",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1217,7 +1217,7 @@
 
     if (NULL == classCol || NULL == idProps)
     {
-        throw new MgNullArgumentException(L"MgdDescribeSchema.GetIdentityProperties",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdDescribeSchema.GetIdentityProperties",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1479,7 +1479,7 @@
             args.Add(detail);
 
             mgException = NULL;
-            mgException = new MgFeatureServiceException(L"MgdDescribeSchema.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"MgFeatureSourceFormatInnerExceptionMessage", &args);
+            mgException = new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdDescribeSchema.GetIdentityProperties", __LINE__, __WFILE__, NULL, L"MgFeatureSourceFormatInnerExceptionMessage", &args);
         }
     }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/EnumerateDataStores.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/EnumerateDataStores.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/EnumerateDataStores.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdEnumerateDataStores::EnumerateDataStores()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdEnumerateDataStores::EnumerateDataStores()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgdEnumerateDataStores.EnumerateDataStores")

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -42,7 +42,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdExtendedSelectCommand.MgdExtendedSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdExtendedSelectCommand.MgdExtendedSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // Create FdoIExtendedSelect command
     FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
@@ -68,7 +68,7 @@
     // This operation is not supported by FdoIExtendedSelect
     // m_command->SetDistinct(value);
 
-    // throw new MgInvalidOperationException(L"MgdExtendedSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdExtendedSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 bool MgdExtendedSelectCommand::GetDistinct()
@@ -77,7 +77,7 @@
     // This operation is not supported by FdoIExtendedSelect
     // return m_command->GetDistinct();
 
-    // throw new MgInvalidOperationException(L"MgdExtendedSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdExtendedSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return false;
 }
@@ -130,7 +130,7 @@
     // This operation is not supported by FdoIExtendedSelect
     // return m_command->GetGrouping();
 
-    // throw new MgInvalidOperationException(L"MgdExtendedSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdExtendedSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 
@@ -140,7 +140,7 @@
     // This operation is not supported by FdoIExtendedSelect
     // m_command->SetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgdExtendedSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdExtendedSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 FdoFilter* MgdExtendedSelectCommand::GetGroupingFilter()
@@ -149,7 +149,7 @@
     // This operation is not supported by FdoIExtendedSelect
     // return m_command->GetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgdExtendedSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdExtendedSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/ExtendedSelectCommand.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,6 +1,3 @@
-#ifndef DESKTOP_EXTENDED_SELECT_COMMAND_H
-#define DESKTOP_EXTENDED_SELECT_COMMAND_H
-
 //
 //  Copyright (C) 2004-2011 by Autodesk, Inc.
 //
@@ -18,6 +15,9 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#ifndef DESKTOP_EXTENDED_SELECT_COMMAND_H
+#define DESKTOP_EXTENDED_SELECT_COMMAND_H
+
 class MgdFdoFeatureReader;
 class MgdFdoReaderCollection;
 class MgdFdoFilterCollection;

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/FeatureManipulationCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/FeatureManipulationCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/FeatureManipulationCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -72,7 +72,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureManipulationCommand.CreateCommand", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureManipulationCommand.CreateCommand", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     return command.Detach();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetConnectionPropertyValues.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetConnectionPropertyValues.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetConnectionPropertyValues.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -44,7 +44,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -54,7 +54,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -90,7 +90,7 @@
     {
         if(NULL == msfc.p)
         {
-            throw new MgdConnectionFailedException(L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // The reference to the FDO connection from the MgdFeatureConnection object must be cleaned up before the parent object
@@ -113,7 +113,7 @@
             arguments.Add(L"2");
             arguments.Add(propertyName);
 
-            throw new MgInvalidArgumentException(L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGetConnectionPropertyValues.GetConnectionPropertyValues",
                 __LINE__, __WFILE__, &arguments, L"MgPropertyNotEnumerable", NULL);
         }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetLongTransactions.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetLongTransactions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetLongTransactions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -39,7 +39,7 @@
 
     if (NULL == resId)
     {
-        throw new MgNullArgumentException(L"MgdGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Connect to provider
@@ -58,7 +58,7 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgdFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgdGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIGetLongTransactions> fdoCommand = (FdoIGetLongTransactions*)fdoConn->CreateCommand(FdoCommandType_GetLongTransactions);
@@ -96,7 +96,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdGetLongTransactions::GetLongTransactions()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdGetLongTransactions::GetLongTransactions()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resId, L"MgdGetLongTransactions.GetLongTransactions")

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetProviderCapabilities.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetProviderCapabilities.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetProviderCapabilities.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -46,7 +46,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdGetProviderCapabilities.MgdGetProviderCapabilities",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGetProviderCapabilities.MgdGetProviderCapabilities",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSchemaMapping.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSchemaMapping.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSchemaMapping.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdGetSchemaMapping::GetSchemaMapping()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdGetSchemaMapping::GetSchemaMapping()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgdGetSchemaMapping.GetSchemaMapping")

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSpatialContexts.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSpatialContexts.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/GetSpatialContexts.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -62,7 +62,7 @@
             {
                 // TODO: specify which argument and message, once we have the mechanism
                 STRING message = MgdFeatureUtil::GetMessage(L"MgCommandNotSupported");
-                throw new MgInvalidOperationException(L"MgdGetSpatialContexts.GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdGetSpatialContexts.GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             FdoPtr<FdoIGetSpatialContexts> fdoCommand = (FdoIGetSpatialContexts*)fdoConn->CreateCommand(FdoCommandType_GetSpatialContexts);
@@ -89,7 +89,7 @@
         }
         else
         {
-            throw new MgdConnectionFailedException(L"MgdGetSpatialContexts.GetSpatialContexts()", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdGetSpatialContexts.GetSpatialContexts()", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/InsertCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/InsertCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/InsertCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdInsertCommand::Execute", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdInsertCommand::Execute", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoPtr<FdoIConnection> fdoConn = m_srvrFeatConn->GetConnection();
@@ -122,7 +122,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerGwsGetFeatures.BatchInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerGwsGetFeatures.BatchInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     char buff[32];
@@ -170,7 +170,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgdInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         bool available = false;
@@ -194,7 +194,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgdInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Performance improvement: Only return the key values

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectAggregateCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectAggregateCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectAggregateCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -41,7 +41,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdSelectAggregateCommand.MgdSelectAggregateCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectAggregateCommand.MgdSelectAggregateCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // Create FdoISelectAggregates command
     FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -42,7 +42,7 @@
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdSelectCommand.MgdSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectCommand.MgdSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // Create FdoISelect command
     FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
@@ -68,7 +68,7 @@
     // This operation is not supported by FdoISelect
     // m_command->SetDistinct(value);
 
-    // throw new MgInvalidOperationException(L"MgdSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 bool MgdSelectCommand::GetDistinct()
@@ -77,7 +77,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetDistinct();
 
-    // throw new MgInvalidOperationException(L"MgdSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return false;
 }
@@ -118,7 +118,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetGrouping();
 
-    // throw new MgInvalidOperationException(L"MgdSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 
@@ -128,7 +128,7 @@
     // This operation is not supported by FdoISelect
     // m_command->SetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgdSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 FdoFilter* MgdSelectCommand::GetGroupingFilter()
@@ -137,7 +137,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgdSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectFeatures.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SelectFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -133,7 +133,7 @@
     {
         if (bFeatureJoinProperties)
         {
-            throw new MgInvalidOperationException(L"MgdSelectFeatures.SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSelectFeatures.SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         m_command = MgdFeatureServiceCommand::CreateCommand(resource, FdoCommandType_ExtendedSelect);
@@ -189,7 +189,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgdSelectFeatures.SelectFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.SelectFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Custom function specified using SelectAggregate,
@@ -240,7 +240,7 @@
                     arguments.Add(L"1");
                     arguments.Add(L"MgdFeatureServiceCommand");
 
-                    throw new MgInvalidArgumentException(L"MgdSelectFeatures::SelectFeatures()",
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdSelectFeatures::SelectFeatures()",
                         __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
 
                 }
@@ -633,7 +633,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdSelectFeatures.ApplyOrderingOptions", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.ApplyOrderingOptions", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoPtr<FdoIdentifierCollection> fic = m_command->GetOrdering();
@@ -730,7 +730,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdSelectFeatures.AddCustomComputedProperty", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.AddCustomComputedProperty", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // Downcast to FdoFunction
@@ -788,7 +788,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(L"MgdSelectFeatures.ValidateConstraintsOnCustomFunctions",
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.ValidateConstraintsOnCustomFunctions",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
             MgdFeatureUtil::ValidateCustomConstraints(m_customFunction);
@@ -820,7 +820,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdSelectFeatures::ValidateParam()",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdSelectFeatures::ValidateParam()",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 }
@@ -887,7 +887,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdSelectFeatures.ApplyFdoGroupingProperties", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.ApplyFdoGroupingProperties", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoPtr<FdoIdentifierCollection> fic = ((MgdFeatureServiceCommand*)m_command)->GetGrouping();
@@ -943,7 +943,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdSelectFeatures.ContainsCustomFunction",
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdSelectFeatures.ContainsCustomFunction",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -1276,7 +1276,7 @@
             }
             else
             {
-                throw new MgdConnectionFailedException(L"MgdSelectFeatures.JoinFeatures",
+                throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectFeatures.JoinFeatures",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -1423,7 +1423,7 @@
                     }
                     else
                     {
-                        throw new MgdConnectionFailedException(L"MgdSelectFeatures.JoinFeatures",
+                        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectFeatures.JoinFeatures",
                             __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
@@ -1666,7 +1666,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgdConnectionFailedException(L"MgdSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIConnection> fdoConn = conn->GetConnection();
@@ -1860,7 +1860,7 @@
     if (NULL == (FdoClassDefinition*)classDef)
     {
         //TODO: Refine message if available
-        throw new MgClassNotFoundException(L"MgdSelectFeatures.IsFunctionOnPrimaryProperty", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgdSelectFeatures.IsFunctionOnPrimaryProperty", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     FdoPtr<FdoPropertyDefinitionCollection> properties = classDef->GetProperties();
@@ -1892,7 +1892,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgdConnectionFailedException(L"MgdSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIConnection> fdoConn = conn->GetConnection();
@@ -1934,7 +1934,7 @@
         if (NULL == (FdoClassDefinition*)classDef)
         {
             //TODO: Refine message if available
-            throw new MgClassNotFoundException(L"MgdSelectFeatures.FilterContainsSecondaryProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgdSelectFeatures.FilterContainsSecondaryProperties", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoPropertyDefinitionCollection> propDefs = classDef->GetProperties();
@@ -2015,7 +2015,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgdConnectionFailedException(L"MgdSelectFeatures.SelectFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSelectFeatures.SelectFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         CHECKNULL(m_command, L"MgdSelectFeatures.SelectFdoJoin");
@@ -2255,7 +2255,7 @@
     if (NULL == (FdoClassDefinition*)classDef)
     {
         //TODO: Refine message if available
-        throw new MgClassNotFoundException(L"MgdSelectFeatures.ApplyClassProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgdSelectFeatures.ApplyClassProperties", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     FdoPtr<FdoIdentifierCollection> propNames = m_command->GetPropertyNames();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SqlCommand.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SqlCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/SqlCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -139,7 +139,7 @@
     // SQL statement can not be empty
     if (resource == NULL)
     {
-        throw new MgNullArgumentException(L"MgdSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (sqlStatement.empty())
@@ -148,7 +148,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdSqlCommand.Validate",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdSqlCommand.Validate",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -178,11 +178,11 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgdFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgdSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
-        throw new MgdConnectionFailedException(L"MgdSqlCommand::Validate", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdSqlCommand::Validate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/UpdateFeatures.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/UpdateFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/Commands/UpdateFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -48,7 +48,7 @@
     if ((NULL != m_SrvrFeatConn.p) && ( !m_SrvrFeatConn->IsConnectionOpen() ))
     {
 
-        throw new MgdConnectionFailedException(L"MgdUpdateFeaturesCommand::MgdUpdateFeaturesCommand()",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgdUpdateFeaturesCommand::MgdUpdateFeaturesCommand()",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -66,7 +66,7 @@
 
     if (resource == NULL || commands == NULL)
     {
-        throw new MgNullArgumentException(L"MgdUpdateFeaturesCommand.UpdateFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdUpdateFeaturesCommand.UpdateFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     INT32 cnt = commands->GetCount();
@@ -76,7 +76,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgdUpdateFeaturesCommand.UpdateFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUpdateFeaturesCommand.UpdateFeatures",
             __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
     }
 
@@ -158,7 +158,7 @@
 
     if (resource == NULL || commands == NULL)
     {
-        throw new MgNullArgumentException(L"MgdUpdateFeaturesCommand.UpdateFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdUpdateFeaturesCommand.UpdateFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     INT32 cnt = commands->GetCount();
@@ -168,7 +168,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgdUpdateFeaturesCommand.UpdateFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUpdateFeaturesCommand.UpdateFeatures",
             __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
     }
 
@@ -229,7 +229,7 @@
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdUpdateFeaturesCommand::ExecuteInsert");
     CHECKARGUMENTNULL(propertyValues, L"MgdUpdateFeaturesCommand::ExecuteInsert");
     if (className.empty())
-        throw new MgNullArgumentException(L"MgdUpdateFeaturesCommand::ExecuteInsert", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdUpdateFeaturesCommand::ExecuteInsert", __LINE__, __WFILE__, NULL, L"", NULL);
     
     Ptr<MgdFeatureConnection> connWrap;
     FdoPtr<FdoIConnection> conn;
@@ -241,7 +241,7 @@
         Ptr<MgResourceIdentifier> origFeatureSource = mgTrans->GetFeatureSource();
         //Check that the transaction originates from the same feature source
         if (origFeatureSource->ToString() != resource->ToString())
-            throw new MgInvalidArgumentException(L"MgdUpdateFeaturesCommand::ExecuteInsert", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUpdateFeaturesCommand::ExecuteInsert", __LINE__, __WFILE__, NULL, L"", NULL);
 
         connWrap = mgTrans->GetConnection(); //Connection is already open
         fdoTrans = mgTrans->GetFdoTransaction();
@@ -286,7 +286,7 @@
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdUpdateFeaturesCommand::ExecuteUpdate");
     CHECKARGUMENTNULL(propertyValues, L"MgdUpdateFeaturesCommand::ExecuteUpdate");
     if (className.empty())
-        throw new MgNullArgumentException(L"MgdUpdateFeaturesCommand::ExecuteUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdUpdateFeaturesCommand::ExecuteUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgdFeatureConnection> connWrap;
     FdoPtr<FdoIConnection> conn;
@@ -298,7 +298,7 @@
         Ptr<MgResourceIdentifier> origFeatureSource = mgTrans->GetFeatureSource();
         //Check that the transaction originates from the same feature source
         if (origFeatureSource->ToString() != resource->ToString())
-            throw new MgInvalidArgumentException(L"MgdUpdateFeaturesCommand::ExecuteUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUpdateFeaturesCommand::ExecuteUpdate", __LINE__, __WFILE__, NULL, L"", NULL);
 
         connWrap = mgTrans->GetConnection(); //Connection is already open
         fdoTrans = mgTrans->GetFdoTransaction();
@@ -342,7 +342,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdUpdateFeaturesCommand::ExecuteDelete");
     if (className.empty())
-        throw new MgNullArgumentException(L"MgdUpdateFeaturesCommand::ExecuteDelete", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdUpdateFeaturesCommand::ExecuteDelete", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgdFeatureConnection> connWrap;
     FdoPtr<FdoIConnection> conn;
@@ -355,7 +355,7 @@
         Ptr<MgResourceIdentifier> origFeatureSource = mgTrans->GetFeatureSource();
         //Check that the transaction originates from the same feature source
         if (origFeatureSource->ToString() != resource->ToString())
-            throw new MgInvalidArgumentException(L"MgdUpdateFeaturesCommand::ExecuteDelete", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUpdateFeaturesCommand::ExecuteDelete", __LINE__, __WFILE__, NULL, L"", NULL);
 
         connWrap = mgTrans->GetConnection(); //Connection is already open
         fdoTrans = mgTrans->GetFdoTransaction();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionPool.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionPool.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionPool.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "System/Mutex.h"
 #include "FdoConnectionPool.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FdoConnectionUtil.h"
 #include "Fdo.h"
@@ -143,7 +160,7 @@
                 strCol = new MgStringCollection();
                 strCol->Add(message);
             }
-            throw new MgdInvalidFeatureSourceException(L"MgdFdoConnectionUtil::CreateConnection",
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, L"MgdFdoConnectionUtil::CreateConnection",
                 __LINE__, __WFILE__, (MgStringCollection*)strCol, L"", NULL);
         }
 
@@ -246,7 +263,7 @@
             STRING errorMsg = parser.GetErrorMessage();
             MgStringCollection arguments;
             arguments.Add(errorMsg);
-            throw new MgdInvalidFeatureSourceException(
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                 L"MgdFdoConnectionUtil::GetFeatureSource",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -265,7 +282,7 @@
         MgStringCollection arguments;
         arguments.Add(message);
 
-        throw new MgdInvalidFeatureSourceException(
+        throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
             L"MgdFdoConnectionUtil::GetFeatureSource",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoConnectionUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FDO_CONNECTION_UTIL_H
 #define DESKTOP_FDO_CONNECTION_UTIL_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoForcedOneToOneFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoForcedOneToOneFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FdoForcedOneToOneFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "FdoForcedOneToOneFeatureReader.h"
 
 // constructs a MgdFdoForcedOneToOneFeatureReader

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureClassCacheItem.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureClassCacheItem.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_CLASS_CACHE_ITEM_H
 #define DESKTOP_FEATURE_CLASS_CACHE_ITEM_H
 /// \cond INTERNAL

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "Fdo.h"
 #include "FdoConnectionUtil.h"
 #include "FeatureConnection.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureConnection.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_CONNECTION_H
 #define DESKTOP_FEATURE_CONNECTION_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_DEFS_H
 #define DESKTOP_FEATURE_DEFS_H
 
@@ -7,7 +24,7 @@
     CHECKARGUMENTNULL(resource, method);                                                            \
     resource->Validate();                                                                           \
     if (resource->GetResourceType() != MgResourceType::FeatureSource)                               \
-        throw new MgInvalidResourceTypeException(method, __LINE__, __WFILE__, NULL, L"", NULL)
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, method, __LINE__, __WFILE__, NULL, L"", NULL)
 
 #define MG_FEATURE_SERVICE_TRY()                                              \
     MG_TRY()                                                                  \
@@ -39,7 +56,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 
@@ -71,7 +89,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 
@@ -145,7 +164,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDistribution.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDistribution.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureDistribution.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgdFeatureDistribution.CreateDistributionFunction", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureGeometricFunctions.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureGeometricFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureGeometricFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -73,7 +73,7 @@
     // because we can only come to here if property type is numeric
     if (!this->CheckSupportedPropertyType())
     {
-        throw new MgInvalidPropertyTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
             L"MgdFeatureGeometricFunctions.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -86,7 +86,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureGeometricFunctions.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureGeometricFunctions.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -234,7 +234,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, 
                     L"MgdFeatureGeometricFunctions.ExecuteOperation",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -272,7 +272,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                     L"MgdFeatureGeometricFunctions.GetValue",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -300,7 +300,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgdFeatureGeometricFunctions.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureNumericFunctions.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureNumericFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureNumericFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -189,7 +189,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -248,7 +248,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
@@ -266,7 +266,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureNumericFunctions::GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureNumericFunctions::GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // find the range of the data values
@@ -501,7 +501,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdFeatureNumericFunctions.CheckSupportedPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -529,7 +529,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureNumericFunctions::GetStandardDeviationCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureNumericFunctions::GetStandardDeviationCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // collect information about the data values
@@ -629,7 +629,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureNumericFunctions::GetQuantileCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureNumericFunctions::GetQuantileCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     int count = (int)values.size();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureSchemaCacheItem.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSchemaCacheItem.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_SCHEMA_CACHE_ITEM_H
 #define DESKTOP_FEATURE_SCHEMA_CACHE_ITEM_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureServiceCache.h"
 
@@ -97,7 +114,7 @@
 {
     if (NULL == resource)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdFeatureServiceCache::GetEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -106,7 +123,7 @@
 
     if (!resource->IsResourceTypeOf(MgResourceType::FeatureSource))
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgdFeatureServiceCache::GetEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -384,7 +401,7 @@
                 STRING errorMsg = parser.GetErrorMessage();
                 MgStringCollection arguments;
                 arguments.Add(errorMsg);
-                throw new MgdInvalidFeatureSourceException(
+                throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                     L"MgCacheManager::GetFeatureSourceCacheItem",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -404,7 +421,7 @@
             MgStringCollection arguments;
             arguments.Add(message);
 
-            throw new MgdInvalidFeatureSourceException(
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                 L"MgCacheManager.GetFeatureSourceCacheItem",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCache.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_SERVICE_CACHE_H
 #define DESKTOP_FEATURE_SERVICE_CACHE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureServiceCacheEntry.h"
 
@@ -91,7 +108,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(className);
 
-        throw new MgInvalidArgumentException(L"MgdFeatureServiceCacheEntry.ParseQualifiedClassName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureServiceCacheEntry.ParseQualifiedClassName",
             __LINE__, __WFILE__, &whatArguments, L"MgSchemaNameMismatch", &whyArguments);
     }
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureServiceCacheEntry.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_SERVICE_CACHE_ENTRY_H
 #define DESKTOP_FEATURE_SERVICE_CACHE_ENTRY_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureSetReader.h"
 
@@ -4,7 +21,7 @@
 #define CHECK_FEATURESET_COUNT(pointer, methodname)        \
 if (0 == pointer->GetCount())                           \
 {                                                       \
-    throw new MgEmptyFeatureSetException(methodname,    \
+    throw new MgException(MgExceptionCodes::MgEmptyFeatureSetException, methodname,    \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -11,7 +28,7 @@
 #define CHECK_PROPERTY_TYPE(property, type, methodname) \
 if (property != type)                                   \
 {                                                       \
-    throw new MgInvalidPropertyTypeException(methodname, \
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, methodname, \
                                        __LINE__, __WFILE__, NULL, L"", NULL); \
 }
 
@@ -613,7 +630,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdFeatureSetReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureSetReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -636,7 +653,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgdFeatureSetReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureSetReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -845,7 +862,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgdFeatureSetReader::GetGeometry(CREFSTRING propertyName, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgdFeatureSetReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureSetReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -858,7 +875,7 @@
 /// <returns>Returns a ByteReader object</returns>
 BYTE_ARRAY_OUT MgdFeatureSetReader::GetGeometry(INT32 index, INT32& length)
 {
-    throw new MgNotImplementedException(L"MgdFeatureSetReader.GetGeometry",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureSetReader.GetGeometry",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -894,7 +911,7 @@
 
 MgFeatureSet* MgdFeatureSetReader::GetFeatures(INT32 count)
 {
-    throw new MgNotImplementedException(L"MgdFeatureSetReader.GetFeatures",
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureSetReader.GetFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSetReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_SET_READER_H
 #define DESKTOP_FEATURE_SET_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "FeatureSourceCacheItem.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureSourceCacheItem.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_SOURCE_CACHE_ITEM_H
 #define DESKTOP_FEATURE_SOURCE_CACHE_ITEM_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureStringFunctions.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureStringFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureStringFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -72,7 +72,7 @@
     // because we can only come to here if property type is numeric
     if (!this->CheckSupportedPropertyType()) 
     {
-        throw new MgInvalidPropertyTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
             L"MgdFeatureStringFunctions.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // We must have an property alias
@@ -84,7 +84,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureStringFunctions.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureStringFunctions.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -151,7 +151,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                     L"MgdFeatureStringFunctions.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
@@ -186,7 +186,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, 
                     L"MgdFeatureStringFunctions.ExecuteOperation", __LINE__, __WFILE__, &arguments, L"", NULL);
             }
         }
@@ -208,7 +208,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgdFeatureStringFunctions.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "FeatureUtil.h"
 #include "FeatureDefs.h"
 #include "Services/ByteSourceRasterStreamImpl.h"
@@ -187,7 +204,7 @@
 
         MgStringCollection arguments;
         arguments.Add(customFunction->GetName());
-        throw new MgFeatureServiceException(L"MgdFeatureUtil.GetArguments", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureUtil.GetArguments", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoString *arg0 = NULL, *arg1 = NULL, *arg2 = NULL, *arg3 = NULL;
@@ -273,7 +290,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgdFeatureUtil.GetPropertyDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureUtil.GetPropertyDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // Get the name of property
@@ -329,7 +346,7 @@
 
                     MgStringCollection arguments;
                     arguments.Add(message);
-                    throw new MgFeatureServiceException(L"MgdFeatureUtil.ValidateCustomConstraints",
+                    throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureUtil.ValidateCustomConstraints",
                         __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
                 break;
@@ -347,7 +364,7 @@
 
                     MgStringCollection arguments;
                     arguments.Add(message);
-                    throw new MgFeatureServiceException(L"MgdFeatureUtil.ValidateCustomConstraints",
+                    throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgdFeatureUtil.ValidateCustomConstraints",
                         __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
                 break;
@@ -360,7 +377,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgdFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgdFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
     double min = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -375,7 +392,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgdFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgdFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
     INT64 min = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -390,7 +407,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgdFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgdFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
     double max = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -405,7 +422,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgdFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgdFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
     INT64 max = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -513,7 +530,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdFeatureUtil.GetRaster",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.GetRaster",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -594,7 +611,7 @@
 
     if (source->GetCount() != target->GetCount())
     {
-        throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateParameterCollection",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateParameterCollection",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1072,13 +1089,13 @@
         }
         case MgPropertyType::Feature:
         {
-            throw new MgInvalidPropertyTypeException(L"MgdFeatureUtil.MgPropertyToFdoProperty",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdFeatureUtil.MgPropertyToFdoProperty",
                 __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         }
         case MgPropertyType::Raster:
         {
-            throw new MgInvalidPropertyTypeException(L"MgdFeatureUtil.MgPropertyToFdoProperty",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdFeatureUtil.MgPropertyToFdoProperty",
                 __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         }
@@ -2018,7 +2035,7 @@
         FdoPtr<FdoFeatureSchema> fdoSchema = GetFdoFeatureSchema(mgSchema);
         if (fdoSchemaCol->Contains(fdoSchema))
         {
-            throw new MgDuplicateObjectException(L"MgdFeatureUtil.GetFdoFeatureSchemaCollection", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDuplicateObjectException, L"MgdFeatureUtil.GetFdoFeatureSchemaCollection", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         else
         {
@@ -2617,7 +2634,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdFeatureUtil.GetFdoDataType",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.GetFdoDataType",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyType", NULL);
         }
     }
@@ -2660,7 +2677,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdFeatureUtil.GetFdoParameterDirection",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.GetFdoParameterDirection",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -2703,7 +2720,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdFeatureUtil.GetMgParameterDirection",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.GetMgParameterDirection",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -2865,7 +2882,7 @@
     {
         FdoFeatureClass* fdoFeatureClass = dynamic_cast<FdoFeatureClass*>(fdoClassDef);
         if (NULL == fdoFeatureClass)
-            throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
         FdoPtr<FdoGeometricPropertyDefinition> defaultGeom = (FdoGeometricPropertyDefinition*)fdoPropDefCol->GetItem(geomName.c_str());
         fdoFeatureClass->SetGeometryProperty(defaultGeom);
@@ -2990,7 +3007,7 @@
         {
             FdoDataPropertyDefinition* fdoDataPropDef = dynamic_cast<FdoDataPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoDataPropDef)
-                throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateDataPropertyDefinition((MgDataPropertyDefinition*)mgPropDef, fdoDataPropDef);
             break;
@@ -3000,7 +3017,7 @@
         {
             FdoObjectPropertyDefinition* fdoObjectPropDef = dynamic_cast<FdoObjectPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoObjectPropDef)
-                throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateObjectPropertyDefinition((MgObjectPropertyDefinition*)mgPropDef, fdoObjectPropDef, fdoClassCol);
             break;
@@ -3011,7 +3028,7 @@
         {
             FdoGeometricPropertyDefinition* fdoGeometricPropDef = dynamic_cast<FdoGeometricPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoGeometricPropDef)
-                throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateGeometricPropertyDefinition((MgGeometricPropertyDefinition*)mgPropDef, fdoGeometricPropDef);
             break;
@@ -3028,7 +3045,7 @@
         {
             FdoRasterPropertyDefinition* fdoRasterPropDef = dynamic_cast<FdoRasterPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoRasterPropDef)
-                throw new MgInvalidArgumentException(L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateRasterPropertyDefinition((MgRasterPropertyDefinition*)mgPropDef, fdoRasterPropDef);
             break;

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/FeatureUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_UTIL
 #define DESKTOP_FEATURE_UTIL
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/GwsFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/GwsFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/GwsFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -201,7 +201,7 @@
                 if (m_attributeNameDelimiters->GetCount() != (INT32)m_primaryExtendedFeatureDescription->GetCount())
                 {
                     // Should never get here
-                    throw new MgInvalidArgumentException(L"MgdGwsFeatureReader.ReadNext",
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGwsFeatureReader.ReadNext",
                         __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                 }
 
@@ -320,7 +320,7 @@
                         if (m_attributeNameDelimiters->GetCount() != (INT32)m_primaryExtendedFeatureDescription->GetCount())
                         {
                             // Should never get here
-                            throw new MgInvalidArgumentException(L"MgdGwsFeatureReader.ReadNext",
+                            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGwsFeatureReader.ReadNext",
                                 __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                         }
 
@@ -517,7 +517,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetBoolean",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetBoolean",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -559,7 +559,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetByte",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetByte",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -603,7 +603,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetDateTime",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetDateTime",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -645,7 +645,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetSingle",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetSingle",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -687,7 +687,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetDouble",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetDouble",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -729,7 +729,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetInt16",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetInt16",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -771,7 +771,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetInt32",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetInt32",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -815,7 +815,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetInt64",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetInt64",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -861,7 +861,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetString",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetString",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -914,7 +914,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetBLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetBLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -967,7 +967,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetCLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetCLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -991,7 +991,7 @@
 MgFeatureReader* MgdGwsFeatureReader::GetFeatureObject(CREFSTRING propertyName)
 {
     // TODO: Figure out how to support object properties.
-    throw new MgNotImplementedException(L"MgdGwsFeatureReader.GetFeatureObject", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdGwsFeatureReader.GetFeatureObject", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -1033,7 +1033,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1076,7 +1076,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdGwsFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1112,7 +1112,7 @@
     {
         // TODO: specify which argument and message, once we have the mechanism
         STRING message = MgdFeatureUtil::GetMessage(L"MgMissingRasterProperty");
-        throw new MgInvalidOperationException(L"MgdFeatureReader::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdFeatureReader::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // There can be more than one Raster property
@@ -1258,7 +1258,7 @@
 /// <returns>MgByteReader holding XML.</returns>
 MgByteReader* MgdGwsFeatureReader::ToXml()
 {
-    throw new MgInvalidOperationException(L"MgdGwsFeatureReader.ToXml",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdGwsFeatureReader.ToXml",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1405,7 +1405,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdGwsFeatureReader::GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader::GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1441,7 +1441,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdGwsFeatureReader::GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdGwsFeatureReader::GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1482,7 +1482,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgdGwsFeatureReader.DeterminePropertyFeatureSource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGwsFeatureReader.DeterminePropertyFeatureSource",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -1821,7 +1821,7 @@
                 if (m_attributeNameDelimiters->GetCount() != nSecondaryFeatures)
                 {
                     // Should never get here
-                    throw new MgInvalidArgumentException(L"MgdGwsFeatureReader.GetMgClassDefinition", __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdGwsFeatureReader.GetMgClassDefinition", __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                 }
             }
 
@@ -1894,8 +1894,10 @@
 
                     FDO_SAFE_RELEASE(e);
 
-                    throw new MgFdoException(L"MgdGwsFeatureReader.GetMgClassDefinition",
-                        __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode);
+                    auto ex = new MgException(MgExceptionCodes::MgFdoException, L"MgdGwsFeatureReader.GetMgClassDefinition",
+                        __LINE__, __WFILE__, NULL, messageId, &arguments);
+                    ex->SetNativeErrorCode(nativeErrorCode);
+                    throw ex;
                 }
             }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/JoinFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/JoinFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/JoinFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,7 +77,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetBoolean",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetBoolean",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -112,7 +112,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetByte",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetByte",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -147,7 +147,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetDateTime",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetDateTime",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -182,7 +182,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetDouble",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetDouble",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -217,7 +217,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetInt16",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetInt16",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -252,7 +252,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetInt32",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetInt32",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -287,7 +287,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetInt64",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetInt64",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -322,7 +322,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetSingle",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetSingle",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -357,7 +357,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetString",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetString",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -392,7 +392,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -452,7 +452,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -485,7 +485,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdJoinFeatureReader::GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader::GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -550,7 +550,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -585,7 +585,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdJoinFeatureReader.GetFeatureObject",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdJoinFeatureReader.GetFeatureObject",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1109,7 +1109,7 @@
             // TODO: Fdo has some inconsistency with Decimal, therefore MapGuide
             // TODO: does not support it. Making this type as invalid argument
             // TODO: until we determine what to do with it???
-            //throw new MgInvalidArgumentException(L"MgServerGetFeatures.GetMgPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
+            //throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetFeatures.GetMgPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
             // propDef = new MgPropertyDefinition(name, ptDecimal);
             // break;
         //}
@@ -1176,7 +1176,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgdJoinFeatureReader.GetFdoDataType",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdJoinFeatureReader.GetFdoDataType",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyType", NULL);
         }
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgCSTrans.h"
 #include "CoordinateSystem/CoordinateSystem.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/MgCSTrans.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_CS_TRANS_H
 #define DESKTOP_CS_TRANS_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 
 MgdProjectedFeatureReader::MgdProjectedFeatureReader(MgFeatureReader* reader, MgCoordinateSystemTransform* trans)

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProjectedFeatureReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_PROJECTED_FEATURE_READER_H
 #define DESKTOP_PROJECTED_FEATURE_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProxyDataReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProxyDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/ProxyDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -811,7 +811,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdProxyDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdProxyDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -850,7 +850,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgdProxyDataReader.GetProperty",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdProxyDataReader.GetProperty",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "RasterHelper.h"
 
@@ -209,7 +226,7 @@
     else if (NULL != (MgdGwsFeatureReader*)m_gwsReader)
         ret = m_gwsReader->GetRaster(propName, xSize, ySize);
     else
-        throw new MgInvalidOperationException(L"MgdRasterHelper::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdRasterHelper::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgdRasterHelper::GetRaster")
     return ret.Detach();
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/RasterHelper.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RASTER_HELPER_H
 #define DESKTOP_RASTER_HELPER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RdbmsFeatureSourceParams.h"
 
 MgdRdbmsFeatureSourceParams::MgdRdbmsFeatureSourceParams()

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/RdbmsFeatureSourceParams.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RDBMS_FEATURE_SOURCE_PARAMS_H
 #define DESKTOP_RDBMS_FEATURE_SOURCE_PARAMS_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "MgDesktop.h"
 #include "SpatialContextCacheItem.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/SpatialContextCacheItem.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SPATIAL_CONTEXT_CACHE_ITEM_H
 #define DESKTOP_SPATIAL_CONTEXT_CACHE_ITEM_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "TransformCache.h"
 
 ACE_Recursive_Thread_Mutex MgdTransformCache::sm_mutex;

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Feature/TransformCache.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TRANSFORM_CACHE
 #define DESKTOP_TRANSFORM_CACHE
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "FeatureReader.h"
 #include "Services/Feature/FeatureDefs.h"
 #include "Services/Feature/FeatureConnection.h"
@@ -55,7 +72,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetBoolean",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetBoolean",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -80,7 +97,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetByte",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetByte",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -107,7 +124,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetDateTime",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetDateTime",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -132,7 +149,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetSingle",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetSingle",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -157,7 +174,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetDouble",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetDouble",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -182,7 +199,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetInt16",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetInt16",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -207,7 +224,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetInt32",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetInt32",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -232,7 +249,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetInt64",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetInt64",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -262,7 +279,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetString",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetString",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -298,7 +315,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetBLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetBLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -334,7 +351,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetCLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetCLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -368,7 +385,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -400,7 +417,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -460,7 +477,7 @@
     {
         // TODO: specify which argument and message, once we have the mechanism
         STRING message = MgdFeatureUtil::GetMessage(L"MgMissingRasterProperty");
-        throw new MgInvalidOperationException(L"MgdFeatureReader::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgdFeatureReader::GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // There can be more than one Raster property
@@ -643,7 +660,7 @@
 
 MgByteReader* MgdFeatureReader::ToXml() 
 { 
-    throw new MgNotImplementedException(L"MgdFeatureReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //INTERNAL_API:
@@ -679,7 +696,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdFeatureReader::GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -698,12 +715,12 @@
 
 void MgdFeatureReader::Serialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdFeatureReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgdFeatureReader::Deserialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdFeatureReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //MgFeatureReader
@@ -853,7 +870,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdFeatureReader::GetFeatureObject",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdFeatureReader::GetFeatureObject",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -883,7 +900,7 @@
 
 MgFeatureSet* MgdFeatureReader::GetFeatures(INT32 count) 
 { 
-    throw new MgNotImplementedException(L"MgdFeatureReader::GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdFeatureReader::GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 FdoIFeatureReader* MgdFeatureReader::GetInternalReader()

Modified: trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/FeatureReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_READER_H
 #define DESKTOP_FEATURE_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "FSDSAX2Parser.h"
 #include "FeatureService.h"
 #include "ResourceService.h"
@@ -1091,7 +1108,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgdFeatureService::InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgdFeatureService::InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -1155,7 +1172,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgdFeatureService::InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgdFeatureService::InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -1491,7 +1508,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::ExecuteSqlQuery");
     if (sqlStatement.empty())
-        throw new MgInvalidArgumentException(L"MgdFeatureService::ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureService::ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_LOG_OPERATION_MESSAGE_INIT(MG_API_VERSION(1, 0, 0), 2);
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -1583,7 +1600,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::ExecuteSqlQuery");
     if (sqlStatement.empty())
-        throw new MgInvalidArgumentException(L"MgdFeatureService::ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureService::ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
 
     CHECKARGUMENTNULL(params, L"MgdFeatureService::ExecuteSqlQuery");
     CHECKARGUMENTNULL(trans, L"MgdFeatureService::ExecuteSqlQuery");
@@ -1607,7 +1624,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::ExecuteSqlNonQuery");
     if (sqlNonSelectStatement.empty())
-        throw new MgInvalidArgumentException(L"MgdFeatureService::ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureService::ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_LOG_OPERATION_MESSAGE_INIT(MG_API_VERSION(1, 0, 0), 4);
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -1657,7 +1674,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::ExecuteSqlNonQuery");
     if (sqlNonSelectStatement.empty())
-        throw new MgInvalidArgumentException(L"MgdFeatureService::ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdFeatureService::ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_LOG_OPERATION_MESSAGE_INIT(MG_API_VERSION(1, 0, 0), 2);
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -1786,7 +1803,7 @@
 
     CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::SetLongTransaction");
     if (longTransactionName.empty())
-        throw new MgNullArgumentException(L"MgdFeatureService::SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdFeatureService::SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_LOG_OPERATION_MESSAGE_INIT(MG_API_VERSION(1, 0, 0), 2);
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -2235,7 +2252,7 @@
     Ptr<MgClassDefinitionCollection> classDefs = describe.GetIdentityProperties(resource, schemaName, classNames);
     if (classDefs->GetCount() != 1)
     {
-        throw new MgClassNotFoundException(L"MgdFeatureService::GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgdFeatureService::GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgClassDefinition> classDef = classDefs->GetItem(0);
     propDefs = classDef->GetIdentityProperties();

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ImageFormats.h"
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ImageFormats.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_IMAGE_FORMATS_H
 #define DESKTOP_IMAGE_FORMATS_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/MappingService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/MappingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/MappingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MappingService.h"
 #include "EPlotRenderer.h"
 #include "FeatureTypeStyleVisitor.h"
@@ -27,7 +44,7 @@
     }                                                                       \
     catch (exception& e)                                                    \
     {                                                                       \
-        mgException = MgSystemException::Create(e, methodName, __LINE__, __WFILE__); \
+        mgException = MgException::Create(e, methodName, __LINE__, __WFILE__); \
     }                                                                       \
     catch (FdoException* e)                                                 \
     {                                                                       \
@@ -41,11 +58,12 @@
             arguments.Add(buf);                                             \
         }                                                                   \
         FDO_SAFE_RELEASE(e);                                                \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                   \
     }                                                                       \
     catch (...)                                                             \
     {                                                                       \
-        mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
     }                                                                       \
 
 #define MG_SERVER_MAPPING_SERVICE_THROW()                                     \
@@ -176,7 +194,7 @@
 
     if (0 == resource)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdMappingService::GenerateLegendImage", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -326,7 +344,7 @@
 
     if (NULL == map  || NULL == dwfVersion || NULL == plotSpec )
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -398,7 +416,7 @@
 
     if (NULL == map  || NULL == center || NULL == dwfVersion || NULL == plotSpec )
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -470,7 +488,7 @@
 
     if (NULL == map  || NULL == extents || NULL == plotSpec || NULL == dwfVersion )
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -481,7 +499,7 @@
     Ptr<MgCoordinate> ur = new MgCoordinateXY(oldur->GetX(), oldur->GetY());
     if (ll == NULL || ur == NULL)
     {
-        throw new MgNullArgumentException(L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgEnvelope> env = new MgEnvelope(ll, ur);
 
@@ -492,7 +510,7 @@
     Ptr<MgdMapPlotCollection> mapPlots = new MgdMapPlotCollection();
     if (mapPlot == NULL || mapPlots == NULL)
     {
-        throw new MgNullArgumentException(L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMappingService::GeneratePlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     mapPlots->Add(mapPlot);
 
@@ -566,7 +584,7 @@
 
     if (0 == mapPlots || 0 == dwfVersion)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -591,19 +609,19 @@
         Ptr<MgdMapPlot> mapPlot = mapPlots->GetItem(nMapPlotIndex);
         if (NULL == mapPlot)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgdMap> map = mapPlot->GetMap();
         if (NULL == map)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgdPlotSpecification> plotSpec = mapPlot->GetPlotSpecification();
         if (NULL == plotSpec)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgdLayout> layout = mapPlot->GetLayout();
@@ -626,7 +644,7 @@
         Ptr<MgEnvelope> env = map->GetDataExtent();
         if (env == NULL)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgCoordinate> ll = env->GetLowerLeftCoordinate();
@@ -633,7 +651,7 @@
         Ptr<MgCoordinate> ur = env->GetUpperRightCoordinate();
         if (ll == NULL || ur == NULL)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         RS_Bounds b(ll->GetX(), ll->GetY(), ur->GetX(), ur->GetY());
 
@@ -644,7 +662,7 @@
             Ptr<MgEnvelope> env2 = map->GetMapExtent();
             if (env2 == NULL)
             {
-                throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             Ptr<MgCoordinate> ll2 = env2->GetLowerLeftCoordinate();
@@ -651,7 +669,7 @@
             Ptr<MgCoordinate> ur2 = env2->GetUpperRightCoordinate();
             if (ll2 == NULL || ur2 == NULL)
             {
-                throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             b.minx = ll2->GetX();
@@ -664,7 +682,7 @@
         Ptr<MgdPrintLayout> printLayout = new MgdPrintLayout();
         if (printLayout == NULL)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (NULL != layout)
@@ -703,10 +721,7 @@
             {
                 dstCs = m_pCSFactory->Create(srs);
             }
-            catch (MgInvalidCoordinateSystemException* e)
-            {
-                e->Release();
-            }
+            MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
         }
 
         double metersPerUnit = (dstCs.p) ? dstCs->ConvertCoordinateSystemUnitsToMeters(1.0) : 1.0;
@@ -717,7 +732,7 @@
         Ptr<MgEnvelope> extents = map->GetMapExtent();
         if (center == NULL || extents == NULL)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         switch (mapPlot->GetMapPlotInstruction())
@@ -730,7 +745,7 @@
                     Ptr<MgEnvelope> extents = map->GetDataExtent();
                     if (extents == NULL)
                     {
-                        throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                     printLayout->ComputeMapOffsetAndSize(dMapScale, extents, metersPerUnit, dr.mapOffsetX(), dr.mapOffsetY(), dr.mapWidth(), dr.mapHeight());
                     double mapWidth = dr.mapWidth();
@@ -765,7 +780,7 @@
                 Ptr<MgCoordinate> plotur = extents->GetUpperRightCoordinate();
                 if (plotll == NULL || plotur == NULL)
                 {
-                    throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
                 double minX = plotll->GetX();
                 double minY = plotll->GetY();
@@ -792,12 +807,12 @@
                 center = new MgCoordinateXY(centerX, centerY);
                 if (center == NULL)
                 {
-                    throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
                 Ptr<MgPoint> centerpt = new MgPoint(center);
                 if (centerpt == NULL)
                 {
-                    throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
                 map->SetViewCenter(centerpt);
                 break;
@@ -808,7 +823,7 @@
                 arguments.Add(L"1");
                 arguments.Add(L"MgdMapPlotCollection");
 
-                throw new MgInvalidArgumentException(L"MgdMappingService::GenerateMultiPlot",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdMappingService::GenerateMultiPlot",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidMapPlotCollectionMapPlotInstruction", NULL);
             }
             break;
@@ -876,7 +891,7 @@
         Ptr<MgLayerCollection> layers = map->GetLayers();
         if (layers == NULL)
         {
-            throw new MgNullReferenceException(L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdMappingService::GenerateMultiPlot", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Define a polygon to represent the map extents and fill it with the map background color

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ProfilingService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ProfilingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ProfilingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ProfilingService.h"
 #include "ProfileResult.h"
 #include "ProfileRenderMapResult.h"
@@ -24,7 +41,7 @@
     MG_TRY()
 
     if (NULL == map)
-        throw new MgNullArgumentException(L"MgdProfilingService::ProfileRenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdProfilingService::ProfileRenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"", NULL);
 
     std::unique_ptr<ProfileRenderMapResult> pPRMResult; // a pointer points to Profile Render Map Result
     pPRMResult.reset(new ProfileRenderMapResult());
@@ -66,7 +83,7 @@
     MG_TRY()
 
     if (NULL == map)
-        throw new MgNullArgumentException(L"MgdProfilingService::ProfileRenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdProfilingService::ProfileRenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
 
     std::unique_ptr<ProfileRenderMapResult> pPRMResult; // a pointer points to Profile Render Map Result
     pPRMResult.reset(new ProfileRenderMapResult());

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "FeatureInfoRenderer.h"
 #include "KeyEncode.h"
 #include "RSMgFeatureReader.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/FeatureInfoRenderer.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_FEATURE_INFO_RENDERER_H
 #define DESKTOP_FEATURE_INFO_RENDERER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "LegendPlotUtil.h"
 #include "MappingUtil.h"
 
@@ -52,7 +69,7 @@
 {
     if (NULL == map || NULL == legendSpec)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdLegendPlotUtil.AddLegendElement", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1028,7 +1045,7 @@
             arguments.Add(L"1");
             arguments.Add(pageUnits);
 
-            throw new MgInvalidArgumentException(L"MgdLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPrintLayoutPageSizeUnits", NULL);
         }
     }
@@ -1065,7 +1082,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1104,7 +1121,7 @@
         else
         {
             // invalid positionUnits specified - should never get here
-            throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1128,7 +1145,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1145,7 +1162,7 @@
         else
         {
             // invalid units specified - should never get here
-            throw new MgdInvalidPrintLayoutSizeUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutSizeUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1188,7 +1205,7 @@
             arguments.Add(L"1");
             arguments.Add(pageUnits);
 
-            throw new MgInvalidArgumentException(L"MgdLegendPlotUtil.AddCustomTextElement",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdLegendPlotUtil.AddCustomTextElement",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPrintLayoutPageSizeUnits", NULL);
         }
     }
@@ -1230,7 +1247,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (positionUnits == L"percent")  // NOXLATE
@@ -1268,7 +1285,7 @@
         else
         {
             // invalid positionUnits specified - should never get here
-            throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         double textSize = 0.0;
@@ -1292,7 +1309,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgdInvalidPrintLayoutFontSizeUnitsException(L"MgdLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgdLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (sizeUnits == L"inches")  // NOXLATE
@@ -1310,7 +1327,7 @@
         else
         {
             // invalid units specified
-            throw new MgdInvalidPrintLayoutFontSizeUnitsException(L"MgdLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgdLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         fontName = textInfo.GetFontName();
         fontHeight = textSize;

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/LegendPlotUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_LEGEND_PLOT_UTIL_H
 #define DESKTOP_LEGEND_PLOT_UTIL_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MapPlot.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MapPlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MapPlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,7 +32,7 @@
 {
     if (NULL == map || NULL == plotSpec)
     {
-        throw new MgNullArgumentException(L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Initialize();
@@ -51,7 +51,7 @@
 {
     if (NULL == map || NULL == center || NULL == plotSpec)
     {
-        throw new MgNullArgumentException(L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Initialize();
@@ -73,7 +73,7 @@
 {
     if (map == NULL || extent == NULL || plotSpec == NULL)
     {
-        throw new MgNullArgumentException(L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdMapPlot.MgdMapPlot", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     Initialize();
@@ -242,7 +242,7 @@
 // Serialize data to TCP/IP stream
 void MgdMapPlot::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgdMapPlot.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdMapPlot.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 
@@ -250,7 +250,7 @@
 // Deserialize data from TCP/IP stream
 void MgdMapPlot::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgdMapPlot.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdMapPlot.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_MAPPING_DEFS_H
 #define DESKTOP_MAPPING_DEFS_H
 
@@ -23,7 +40,7 @@
     }                                                                       \
     catch (exception& e)                                                    \
     {                                                                       \
-        mgException = MgSystemException::Create(e, methodName, __LINE__, __WFILE__); \
+        mgException = MgException::Create(e, methodName, __LINE__, __WFILE__); \
     }                                                                       \
     catch (FdoException* e)                                                 \
     {                                                                       \
@@ -37,11 +54,12 @@
             arguments.Add(buf);                                             \
         }                                                                   \
         FDO_SAFE_RELEASE(e);                                                \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                   \
     }                                                                       \
     catch (...)                                                             \
     {                                                                       \
-        mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
     }                                                                       \
 
 #define MG_SERVER_MAPPING_SERVICE_THROW()                                     \

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MappingUtil.h"
 #include "MappingDefs.h"
 
@@ -49,7 +66,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgdMappingUtil::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgdMappingUtil::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the map definition from the parser - it's
@@ -873,8 +890,8 @@
             MgStringCollection argumentsWhy;
             argumentsWhy.Add(mgException->GetExceptionMessage(locale));
 
-            Ptr<MgdStylizeLayerFailedException> exception;
-            exception = new MgdStylizeLayerFailedException(L"MgdMappingUtil.StylizeLayers", __LINE__, __WFILE__, &arguments, L"MgFormatInnerExceptionMessage", &argumentsWhy);
+            Ptr<MgException> exception;
+            exception = new MgException(MgExceptionCodes::MgStylizeLayerFailedException, L"MgdMappingUtil.StylizeLayers", __LINE__, __WFILE__, &arguments, L"MgFormatInnerExceptionMessage", &argumentsWhy);
 
             STRING message = exception->GetExceptionMessage(locale);
             STRING stackTrace = exception->GetStackTrace(locale);
@@ -1271,7 +1288,8 @@
         arguments.Add(buf);
     }
 
-    mgException = new MgFdoException(L"MgStylizationUtil.ExceptionTrap", line, file, NULL, messageId, &arguments, nativeErrorCode);
+    mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgStylizationUtil.ExceptionTrap", line, file, NULL, messageId, &arguments);
+    mgException->SetNativeErrorCode(nativeErrorCode);
 
     MG_CATCH(L"MgStylizationUtil.ExceptionTrap")
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/MappingUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_MAPPING_UTIL_H
 #define DESKTOP_MAPPING_UTIL_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PlotSpecification.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PlotSpecification.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PlotSpecification.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "PlotSpecification.h"
 
 MG_IMPL_DYNCREATE(MgdPlotSpecification)

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PrintLayout.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PrintLayout.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/PrintLayout.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -74,7 +74,7 @@
 
     if (0 == resourceService || 0 == layoutDefinition)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdPrintLayout.Create", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -266,7 +266,7 @@
                         && positionUnits != L"meters" && positionUnits != L"inches" && positionUnits != L"percent")
                     {
                         // invalid print layout position units
-                        throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(logoNode, "ResourceId", resId, false);
@@ -281,7 +281,7 @@
                         && sizeUnits != L"inches" && sizeUnits != L"meters")
                     {
                         // invalid print layout size units
-                        throw new MgdInvalidPrintLayoutSizeUnitsException(L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutSizeUnitsException, L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(logoNode, "Rotation", rotation, false);
@@ -328,7 +328,7 @@
                         && positionUnits != L"percent" && positionUnits != L"meters" && positionUnits != L"inches")
                     {
                         // invalid print layout position units
-                        throw new MgdInvalidPrintLayoutPositionUnitsException(L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 DOMNode* fontNode = pXmlUtil->GetElementNode(textNode, "Font", false);
@@ -341,7 +341,7 @@
                         && fontSizeUnits != L"points" && fontSizeUnits != L"meters" && fontSizeUnits != L"inches")
                     {
                         // invalid print layout font size units
-                        throw new MgdInvalidPrintLayoutFontSizeUnitsException(L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgdPrintLayout.GetLayoutPropertiesFromXml", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 pXmlUtil->GetElementValue(textNode, "Value", value, false);

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RSMgFeatureReader.h"
 #include "RSMgRaster.h"
 #include "RSMgInputStream.h"
@@ -266,7 +283,7 @@
         STRING message;
         message = ex->GetExceptionMessage();
 
-        bool shouldThrow = (NULL == dynamic_cast<MgFdoException*>(ex));
+        bool shouldThrow = (ex->GetExceptionCode() == MgExceptionCodes::MgFdoException);
         ex->Release();
         if (shouldThrow)
         {

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgFeatureReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RS_FEATURE_READER_H
 #define DESKTOP_RS_FEATURE_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgInputStream.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgInputStream.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgInputStream.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RS_INPUT_STREAM_H
 #define DESKTOP_RS_INPUT_STREAM_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RSMgRaster.h"
 #include "RSMgInputStream.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgRaster.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RS_RASTER_H
 #define DESKTOP_RS_RASTER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RSMgSymbolManager.h"
 #include "RSMgInputStream.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RSMgSymbolManager.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RS_SYMBOL_MANAGER_H
 #define DESKTOP_RS_SYMBOL_MANAGER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RenderingOptions.h"
 
 MG_IMPL_DYNCREATE(MgdRenderingOptions)

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Rendering/RenderingOptions.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RENDERING_OPTIONS_H
 #define DESKTOP_RENDERING_OPTIONS_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "RenderingService.h"
 #include "System/ConfigProperties.h"
 #include "AGGRenderer.h"
@@ -133,7 +150,7 @@
     MG_LOG_TRACE_ENTRY(L"MgdRenderingService::RenderTile()");
 
     if (NULL == map || baseMapLayerGroupName.empty())
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // find the finite display scale closest to the requested map scale
     double scale = map->GetViewScale();
@@ -141,7 +158,7 @@
 
     // if we don't find a nearest scale then something is wrong with the map
     if (scaleIndex < 0)
-        throw new MgInvalidMapDefinitionException(L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // get the layer group associated with the name
     Ptr<MgLayerGroupCollection> layerGroups = map->GetLayerGroups();
@@ -152,7 +169,7 @@
         arguments.Add(L"2");
         arguments.Add(baseMapLayerGroupName);
 
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderTile",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderTile",
             __LINE__, __WFILE__, &arguments, L"MgdMapLayerGroupNameNotFound", NULL);
     }
 
@@ -229,7 +246,7 @@
     MG_TRY()
 
     if (NULL == map || NULL == baseGroup)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderTile", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // get map extent that corresponds to tile extent
     RS_Bounds extent(mcsMinX, mcsMinY, mcsMaxX, mcsMaxY);
@@ -670,7 +687,7 @@
     MG_TRY()
 
     if (NULL == map)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // validate map view parameters
     int width            = map->GetDisplayWidth();
@@ -680,23 +697,23 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > MAX_PIXELS)
-        throw new MgOutOfRangeException(L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgdRenderingService.RenderDynamicOverlayInternal", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // compute map extent that corresponds to pixel extent
     Ptr<MgPoint> pt          = map->GetViewCenter();
@@ -927,7 +944,7 @@
     MG_TRY()
 
     if (NULL == map)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderMapPublished", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderMapPublished", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgPoint> pt = map->GetViewCenter();
     Ptr<MgCoordinate> center = pt->GetCoordinate();
@@ -979,7 +996,7 @@
     MG_TRY()
 
     if (NULL == map || extents == NULL || backgroundColor == NULL)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // validate map view parameters
     int dpi              = map->GetDisplayDpi();
@@ -986,16 +1003,16 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // compute a view center and scale from the given extents
     // and pass on to the RenderMap that uses center and scale
@@ -1047,7 +1064,7 @@
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (drawWidth * drawHeight > MAX_PIXELS)
-        throw new MgOutOfRangeException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // use the supplied background color
     RS_Color bgcolor(backgroundColor->GetRed(),
@@ -1137,7 +1154,7 @@
     MG_TRY()
 
     if (NULL == map || NULL == center || NULL == backgroundColor)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // validate map view parameters
     int dpi              = map->GetDisplayDpi();
@@ -1144,23 +1161,23 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgdMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > MAX_PIXELS)
-        throw new MgOutOfRangeException(L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgdRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     double unitsPerPixel = METERS_PER_INCH / (double)dpi / metersPerUnit;
     double mapWidth2 = 0.5 * (double)width * unitsPerPixel * scale;
@@ -1276,10 +1293,7 @@
         {
             dstCs = m_pCSFactory->Create(srs);
         }
-        catch (MgInvalidCoordinateSystemException* e)
-        {
-            e->Release();
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
     }
 
     RS_String units = dstCs.p? dstCs->GetUnits() : L"";
@@ -1403,18 +1417,18 @@
     MG_LOG_TRACE_ENTRY(L"MgdRenderingService::RenderMapLegend()");
 
     if (NULL == map || NULL == backgroundColor)
-        throw new MgNullArgumentException(L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // validate map view parameters
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgdMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgdMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > MAX_PIXELS)
-        throw new MgOutOfRangeException(L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgdRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     RS_Color bgcolor(backgroundColor->GetRed(),
                      backgroundColor->GetGreen(),
@@ -1966,7 +1980,7 @@
             bs->SetMimeType(MgMimeType::Tiff);
     }
     else
-        throw new MgNullReferenceException(L"MgdRenderingService.CreateImage", __LINE__, __WFILE__, NULL, L"MgNoDataFromRenderer", NULL);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgdRenderingService.CreateImage", __LINE__, __WFILE__, NULL, L"MgNoDataFromRenderer", NULL);
     
     if(NULL != pPRMResult)
     {
@@ -2004,7 +2018,7 @@
     ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) RenderForSelection(): ** START **\n")));
 #endif
     if (NULL == map || (NULL == geometry && featureFilter.empty()))
-        throw new MgNullArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (maxFeatures < 0)
     {
@@ -2015,7 +2029,7 @@
         arguments.Add(L"5");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -2033,19 +2047,19 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // compute map extent that corresponds to pixel extent
     Ptr<MgPoint> pt          = map->GetViewCenter();
@@ -2338,18 +2352,20 @@
                     maxFeatures -= numFeaturesProcessed;
                 }
             }
-            catch (MgFdoException* e)
+            catch (MgException* e)
             {
-                //TODO: what should we really be doing in this case?
-                //This can happen if the underlying FDO provider does not
-                //support a particular spatial operation. One way around this
-                //is to select all features which appear on the screen and then
-                //do our own geometry math.
-                #ifdef _DEBUG
-                STRING error = e->GetExceptionMessage();
-                ACE_DEBUG((LM_INFO, ACE_TEXT("(%t) RenderForSelection() - Error: %S\n"), error.c_str()));
-                #endif
-
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFdoException)
+                {
+                    //TODO: what should we really be doing in this case?
+                    //This can happen if the underlying FDO provider does not
+                    //support a particular spatial operation. One way around this
+                    //is to select all features which appear on the screen and then
+                    //do our own geometry math.
+#ifdef _DEBUG
+                    STRING error = e->GetExceptionMessage();
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("(%t) RenderForSelection() - Error: %S\n"), error.c_str()));
+#endif
+                }
                 // Let's throw the exception here, so that it can be recorded in the error log.
                 throw e;
             }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/RenderingService.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RENDERING_SERVICE_H
 #define DESKTOP_RENDERING_SERVICE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "ByteSourceDwfInputStreamImpl.h"
 
@@ -17,7 +34,7 @@
 {
     if (NULL == m_inputStream)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdByteSourceDwfInputStreamImpl.MgdByteSourceDwfInputStreamImpl",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ByteSourceDwfInputStreamImpl.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_BYTE_SOURCE_DWF_INPUT_STREAM_IMPL_H
 #define DESKTOP_BYTE_SOURCE_DWF_INPUT_STREAM_IMPL_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "OperationInfo.h"
 
@@ -49,7 +66,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgOperationInfo.MgOperationInfo",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -132,7 +149,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgdParameterNotFoundException(
+        throw new MgException(MgExceptionCodes::MgParameterNotFoundException, 
             L"MgOperationInfo.GetParameter", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -158,7 +175,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgdDuplicateParameterException(
+        throw new MgException(MgExceptionCodes::MgDuplicateParameterException,
             L"MgOperationInfo.SetParameter", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationInfo.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_OPERATION_INFO_H
 #define DESKTOP_OPERATION_INFO_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "OperationParameter.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/OperationParameter.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_OPERATION_PARAMETER_H
 #define DESKTOP_OPERATION_PARAMETER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "ResourceContentCache.h"
 
@@ -71,7 +88,7 @@
     CHECKARGUMENTNULL(resource, L"MgdResourceContentCache::PutContentEntry");
     if (content.empty())
     {
-        throw new MgInvalidArgumentException(L"MgdResourceContentCache::PutContentEntry", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceContentCache::PutContentEntry", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     STRING resId = resource->ToString();
     //ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) MgdResourceContentCache::PutContentEntry - %W\n"), resId.c_str()));

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceContentCache.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_CONTENT_CACHE_H
 #define DESKTOP_RESOURCE_CONTENT_CACHE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourceDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_DEFS_H
 #define DESKTOP_RESOURCE_DEFS_H
 
@@ -54,13 +71,13 @@
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(STRING(e.message()));                                   \
-        mgException = new MgdDwfException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgDwfException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
     }                                                                         \
     catch (const XMLException& e)                                             \
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(X2W(e.getMessage()));                                   \
-        mgException = new MgXmlParserException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgXmlParserException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "ResourcePackageHandler.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageHandler.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_PACKAGE_HANDLER_H
 #define DESKTOP_RESOURCE_PACKAGE_HANDLER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "ResourcePackageLoader.h"
 
@@ -37,7 +54,7 @@
 
     if (resource == NULL)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgdResourcePackageLoader.CreateResourceIdentifier",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -46,7 +63,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgdResourcePackageLoader.CreateResourceIdentifier",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageLoader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_PACKAGE_LOADER_H
 #define DESKTOP_RESOURCE_PACKAGE_LOADER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "ResourcePackageManifestHandler.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestHandler.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_PACKAGE_MANIFEST_HANDLER_H
 #define DESKTOP_RESOURCE_PACKAGE_MANIFEST_HANDLER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceDefs.h"
 #include "ResourcePackageManifestParser.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ResourcePackageManifestParser.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_PACKAGE_MANIFEST_PARSER_H
 #define DESKTOP_RESOURCE_PACKAGE_MANIFEST_PARSER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataManager.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -484,7 +484,7 @@
                     STRING mName = MgUtil::MultiByteToWideChar(mappingName);
                     MgStringCollection args;
                     args.Add(mName);
-                    throw new MgdAliasNotFoundException(L"MgdUnmanagedDataManager::SubstituteDataPathAliases", __LINE__, __WFILE__, &args, L"MgdAliasNotFoundException", NULL);
+                    throw new MgException(MgdExceptionCodes::MgAliasNotFoundException, L"MgdUnmanagedDataManager::SubstituteDataPathAliases", __LINE__, __WFILE__, &args, L"MgdAliasNotFoundException", NULL);
                 }
             }
             break;
@@ -534,7 +534,7 @@
             arguments.Add(L"1");
             arguments.Add(path);
 
-            throw new MgInvalidArgumentException(L"MgdUnmanagedDataManager.EnumerateUnmanagedData",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUnmanagedDataManager.EnumerateUnmanagedData",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -581,7 +581,7 @@
                 arguments.Add(L"1");
                 arguments.Add(path);
 
-                throw new MgInvalidArgumentException(L"MgdUnmanagedDataManager.EnumerateUnmanagedData",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdUnmanagedDataManager.EnumerateUnmanagedData",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
         }

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "UnmanagedDataType.h"
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/UnmanagedDataType.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_UNMANAGED_DATA_TYPE_H
 #define DESKTOP_UNMANAGED_DATA_TYPE_H
 /// \ingroup Desktop_Misc_Module

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "ResourceDefs.h"
 #include "ZipFileHandler.h"
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileHandler.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_ZIP_FILE_HANDLER_H
 #define DESKTOP_ZIP_FILE_HANDLER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "ResourceDefs.h"
 #include "ZipFileReader.h"
 #include "ByteSourceDwfInputStreamImpl.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Resource/ZipFileReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_ZIP_FILE_READER_H
 #define DESKTOP_ZIP_FILE_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ResourceService.h"
 #include "Foundation.h"
 #include "Services/Feature/FeatureServiceCache.h"
@@ -108,7 +125,7 @@
     }
     else 
     {
-        throw new MgInvalidArgumentException(L"MgdResourceService::ResolveContentPath", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceService::ResolveContentPath", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
 
@@ -199,7 +216,7 @@
     }
     else 
     {
-        throw new MgInvalidArgumentException(L"MgdResourceService::ResolveDataPath", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceService::ResolveDataPath", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MgdLogDetail logDetail(MgServiceType::ResourceService, MgdLogDetail::InternalTrace, L"MgdResourceService::ResolveDataPath", mgStackParams);
@@ -353,7 +370,7 @@
                 {
                     MgStringCollection args;
                     args.Add(docElName);
-                    throw new MgInvalidResourceTypeException(L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
                 }
             }
             else
@@ -362,7 +379,7 @@
                 {
                     MgStringCollection args;
                     args.Add(docElName);
-                    throw new MgInvalidResourceTypeException(L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
                 }
             }
         }
@@ -393,7 +410,7 @@
             args.Add(colNumStr);
             args.Add(pubIdStr);
             args.Add(sysIdStr);
-            throw new MgXmlParserException(L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgdResourceService::SetResource", __LINE__, __WFILE__, &args, L"", NULL);
         }
 
         //Can't rewind a byte sink. So make another one
@@ -534,13 +551,13 @@
     CHECKARGUMENTNULL(destResource, L"MgdResourceService::CopyResource");
 
     if (sourceResource->ToString() == destResource->ToString())
-        throw new MgInvalidArgumentException(L"MgdResourceService::CopyResource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceService::CopyResource", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (!ResourceExists(sourceResource))
     {
         MgStringCollection arguments;
         arguments.Add(sourceResource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::CopyResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::CopyResource", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     if (ResourceExists(destResource) && !overwrite)
@@ -547,7 +564,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(destResource->ToString());
-        throw new MgDuplicateResourceException(L"MgdResourceService::CopyResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgDuplicateResourceException, L"MgdResourceService::CopyResource", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     STRING srcContentPath = ResolveContentPath(sourceResource);
@@ -679,13 +696,13 @@
     STRING dstResId = destResource->ToString();
 
     if (srcResId == dstResId)
-        throw new MgInvalidArgumentException(L"MgdResourceService::MoveResource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceService::MoveResource", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (!ResourceExists(sourceResource))
     {
         MgStringCollection arguments;
         arguments.Add(sourceResource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::MoveResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::MoveResource", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     STRING srcContentPath = ResolveContentPath(sourceResource);
@@ -794,7 +811,7 @@
     CHECKARGUMENTNULL(data, L"MgdResourceService::SetResourceData");
 
     if (dataName.empty())
-        throw new MgNullArgumentException(L"MgdResourceService::SetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdResourceService::SetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     STRING path = ResolveDataPath(resource);
     if (!MgFileUtil::IsDirectory(path))
@@ -841,7 +858,7 @@
     CHECKARGUMENTNULL(resource, L"MgdResourceService::DeleteResourceData");
 
     if (dataName.empty())
-        throw new MgNullArgumentException(L"MgdResourceService::DeleteResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdResourceService::DeleteResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     ReleasePotentialLocks(resource);
     STRING path = ResolveDataPath(resource);
@@ -848,7 +865,7 @@
     path += dataName;
 
     if (!MgFileUtil::IsFile(path))
-        throw new MgResourceDataNotFoundException(L"MgdResourceService::DeleteResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, L"MgdResourceService::DeleteResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MgFileUtil::DeleteFile(path);
 
@@ -895,20 +912,20 @@
     {
         MgStringCollection arguments;
         arguments.Add(resource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     if (oldDataName.empty())
-        throw new MgNullArgumentException(L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (newDataName.empty())
-        throw new MgNullArgumentException(L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     STRING path = ResolveDataPath(resource);
 
     STRING src = path + oldDataName;
     if (!MgFileUtil::IsFile(src))
-        throw new MgResourceDataNotFoundException(L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, L"MgdResourceService::RenameResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MgFileUtil::RenameFile(path, oldDataName, newDataName, overwrite);
 
@@ -1260,7 +1277,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
-            throw new MgResourceNotFoundException(L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         if (maxDepth > 0)
@@ -1278,13 +1295,13 @@
         //Conversely this is way easier. Just check for zero depth as it is the only allowed
         //value, and then write the document entry.
         if (depth != 0)
-            throw new MgInvalidArgumentException(L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, NULL, L"", NULL);
 
         if (!MgFileUtil::IsFile(path))
         {
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
-            throw new MgResourceNotFoundException(L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::EnumerateResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         WriteResourceDocumentEntry(xml, resource);
@@ -1337,7 +1354,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(resource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::EnumerateResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::EnumerateResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     STRING path = ResolveDataPath(resource);
@@ -1519,7 +1536,7 @@
         MgResourceType::Role == resType ||
         MgResourceType::User == resType)
     {
-        throw new MgInvalidResourceTypeException(L"MgdResourceService::GetResourceContent", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgdResourceService::GetResourceContent", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     //Think of the hard disks. Check we have a cached copy and return that, otherwise
@@ -1533,7 +1550,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
-            throw new MgResourceNotFoundException(L"MgdResourceService::GetResourceContent", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::GetResourceContent", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         Ptr<MgByteSource> source = new MgByteSource(path);
@@ -1589,17 +1606,17 @@
     {
         MgStringCollection arguments;
         arguments.Add(resource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     if (dataName.empty())
-        throw new MgNullArgumentException(L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     STRING path = ResolveDataPath(resource);
     path += dataName;
 
     if (!MgFileUtil::IsFile(path))
-        throw new MgResourceDataNotFoundException(L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgByteSource> source;
 
@@ -1661,7 +1678,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(resource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     STRING path = ResolveDataPath(resource);
@@ -1668,7 +1685,7 @@
     path += MgResourceDataName::UserCredentials;
 
     if (!MgFileUtil::IsFile(path))
-        throw new MgResourceDataNotFoundException(L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, L"MgdResourceService::GetResourceData", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgByteSource> source = new MgByteSource(path);
     blob = source->GetReader();
@@ -1687,7 +1704,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(resource->ToString());
-        throw new MgResourceNotFoundException(L"MgdResourceService::GetResourceModifiedDate", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, L"MgdResourceService::GetResourceModifiedDate", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     MgDateTime mdt = MgFileUtil::GetFileModificationTime(path);

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ResourceService.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_RESOURCE_SERVICE_H
 #define DESKTOP_RESOURCE_SERVICE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "ScrollableFeatureReader.h"
 #include "Services/Feature/FeatureDefs.h"
 #include "Services/Feature/FeatureConnection.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ScrollableFeatureReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SCROLLABLE_FEATURE_READER_H
 #define DESKTOP_SCROLLABLE_FEATURE_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "ServiceFactory.h"
 #include "ResourceService.h"
 #include "FeatureService.h"
@@ -5,7 +23,6 @@
 #include "ProfilingService.h"
 #include "RenderingService.h"
 #include "DrawingService.h"
-#include "Exception/ServiceNotSupportedException.h"
 
 STRING MgdServiceFactory::sm_libContentPath = L"";
 STRING MgdServiceFactory::sm_libDataPath = L"";
@@ -61,7 +78,7 @@
     {
         MgStringCollection args;
         args.Add(sm_schemaPath);
-        throw new MgDirectoryNotFoundException(L"MgdServiceFactory::Initialize", __LINE__, __WFILE__, &args, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgDirectoryNotFoundException, L"MgdServiceFactory::Initialize", __LINE__, __WFILE__, &args, L"", NULL);
     }
 }
 
@@ -88,5 +105,5 @@
     case MgServiceType::TileService:
         return new MgdTileService();
     }
-    throw new MgServiceNotSupportedException(L"MgdServiceFactory::CreateService", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgServiceNotSupportedException, L"MgdServiceFactory::CreateService", __LINE__, __WFILE__, NULL, L"", NULL);
 }
\ No newline at end of file

Modified: trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/ServiceFactory.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SERVICE_FACTORY_H
 #define DESKTOP_SERVICE_FACTORY_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "SqlReader.h"
 #include "Services/Feature/FeatureConnection.h"
 #include "Services/Feature/FdoConnectionUtil.h"
@@ -56,7 +74,7 @@
     FdoDataType dataType = m_reader->GetColumnType(propertyName.c_str());
     if (FdoDataType(-1) == dataType)
     {
-        throw new MgInvalidPropertyTypeException(L"MgdDataReader.GetPropertyType",
+        throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdDataReader.GetPropertyType",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -100,7 +118,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetBoolean",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetBoolean",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -125,7 +143,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetByte",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetByte",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -152,7 +170,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetDateTime",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetDateTime",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -177,7 +195,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetSingle",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetSingle",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -202,7 +220,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetDouble",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetDouble",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -227,7 +245,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetInt16",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetInt16",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -252,7 +270,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetInt32",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetInt32",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -277,7 +295,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetInt64",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetInt64",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -307,7 +325,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetString",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetString",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -516,13 +534,13 @@
 
 MgRaster* MgdSqlDataReader::GetRaster(INT32 index) 
 { 
-    throw new MgInvalidPropertyTypeException(L"MgdSqlDataReader::GetRaster",
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdSqlDataReader::GetRaster",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgRaster* MgdSqlDataReader::GetRaster(CREFSTRING propertyName) 
 { 
-    throw new MgInvalidPropertyTypeException(L"MgdSqlDataReader::GetRaster",
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgdSqlDataReader::GetRaster",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -553,7 +571,7 @@
 
 MgByteReader* MgdSqlDataReader::ToXml() 
 { 
-    throw new MgNotImplementedException(L"MgdSqlDataReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdSqlDataReader::ToXml", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //INTERNAL_API:
@@ -606,7 +624,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetLOB",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetLOB",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -626,7 +644,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgdSqlDataReader::GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgdSqlDataReader::GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -645,10 +663,10 @@
 
 void MgdSqlDataReader::Serialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdSqlDataReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdSqlDataReader::Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgdSqlDataReader::Deserialize(MgStream* stream) 
 { 
-    throw new MgNotImplementedException(L"MgdSqlDataReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgdSqlDataReader::Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
\ No newline at end of file

Modified: trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/SqlReader.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SQL_READER_H
 #define DESKTOP_SQL_READER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "SEMgSymbolManager.h"
 #include "SAX2Parser.h"
 #include "PlatformBase.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Stylization/SEMgSymbolManager.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_SE_SYMBOL_MANAGER_H
 #define DESKTOP_SE_SYMBOL_MANAGER_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "MgDesktop.h"
 #include "TileDefs.h"
 #include "TileCache.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileCache.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TILE_CACHE_H
 #define DESKTOP_TILE_CACHE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "TileDefs.h"
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Tile/TileDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TILE_DEFS_H
 #define DESKTOP_TILE_DEFS_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/TileService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/TileService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/TileService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "MgDesktop.h"
 #include "TileService.h"
 
@@ -132,7 +150,7 @@
 
     if (NULL == mapDefinition || baseMapLayerGroupName.empty())
     {
-        throw new MgNullArgumentException(L"MgdTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdTileService.GetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -145,7 +163,7 @@
         arguments.Add(L"5");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgdTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdTileService.GetTile",
             __LINE__, __WFILE__, &arguments, L"MgInvalidScaleIndex", NULL);
     }
 
@@ -189,7 +207,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgdTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToLockTileFile", NULL);
             }
 
@@ -210,7 +228,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgdTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
             }
             else
@@ -311,7 +329,7 @@
 
     if (NULL == map || baseMapLayerGroupName.empty())
     {
-        throw new MgNullArgumentException(L"MgdTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdTileService.GetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -322,7 +340,7 @@
     // if we don't find a nearest scale then something is wrong with the map
     if (scaleIndex < 0)
     {
-        throw new MgInvalidMapDefinitionException(L"MgdTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgdTileService.GetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -354,7 +372,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgdTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToLockTileFile", NULL);
             }
 
@@ -375,7 +393,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgdTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
             }
             else
@@ -465,7 +483,7 @@
 
     if (NULL == img || NULL == map || baseMapLayerGroupName.empty())
     {
-        throw new MgNullArgumentException(L"MgdTileService.SetTile",
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdTileService.SetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -478,7 +496,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgdTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgdTileService.GetTile",
             __LINE__, __WFILE__, &arguments, L"MgInvalidScaleIndex", NULL);
     }
 
@@ -504,7 +522,7 @@
             MgStringCollection arguments;
             arguments.Add(lockPathname);
 
-            throw new MgFileIoException(L"MgdTileService.SetTile",
+            throw new MgException(MgExceptionCodes::MgFileIoException, L"MgdTileService.SetTile",
                 __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
         }
         else
@@ -567,7 +585,7 @@
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
     if (NULL == map)
-        throw new MgNullArgumentException(L"MgdTileService.ClearCache", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, L"MgdTileService.ClearCache", __LINE__, __WFILE__, NULL, L"", NULL);
 
     ClearMapCache(resourceId->ToString());
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/TileService.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/TileService.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/TileService.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TILE_SERVICE_H
 #define DESKTOP_TILE_SERVICE_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Transaction.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Transaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Transaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "Transaction.h"
 #include "Fdo.h"
 #include "Services/Feature/FeatureDefs.h"

Modified: trunk/MgDev/Desktop/MgDesktop/Services/Transaction.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/Transaction.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/Services/Transaction.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TRANSACTION_H
 #define DESKTOP_TRANSACTION_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/System/ClassId.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/ClassId.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/ClassId.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_CLASSID_H
 #define DESKTOP_CLASSID_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "ConfigProperties.h"
 
 //From UserInformation.h in MapGuideCommon

Modified: trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/ConfigProperties.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_CONFIG_PROPERTIES_H
 #define DESKTOP_CONFIG_PROPERTIES_H
 

Copied: trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.cpp (from rev 9755, sandbox/jng/flatten_exceptions/Desktop/MgDesktop/System/ExceptionCodes.cpp)
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.cpp	                        (rev 0)
+++ trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -0,0 +1,20 @@
+//
+//  Copyright (C) 2004-2020 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "ExceptionCodes.h"
+
+const STRING MgdExceptionCodes::MgAliasNotFoundException = L"MgAliasNotFoundException";

Copied: trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.h (from rev 9755, sandbox/jng/flatten_exceptions/Desktop/MgDesktop/System/ExceptionCodes.h)
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.h	                        (rev 0)
+++ trunk/MgDev/Desktop/MgDesktop/System/ExceptionCodes.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -0,0 +1,27 @@
+//
+//  Copyright (C) 2004-2020 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef DESKTOP_EXCEPTION_CODES_H
+#define DESKTOP_EXCEPTION_CODES_H
+
+class MG_DESKTOP_API MgdExceptionCodes
+{
+PUBLISHED_API:
+    static const STRING MgAliasNotFoundException;    ///\if INTERNAL value("MgAliasNotFoundException") \endif
+};
+
+#endif

Modified: trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #include "MgDesktop.h"
 #include "Log/LogManager.h"
 #include "Fdo.h"
@@ -147,7 +164,7 @@
     if (NULL == hlib)
     {
         ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) MgdPlatform::Initialize() - Failed to load FDO library.\n")));
-        throw new MgFdoException(L"MgdPlatform::Initialize",
+        throw new MgException(MgExceptionCodes::MgFdoException, L"MgdPlatform::Initialize",
              __LINE__, __WFILE__, NULL, L"MgFailedToLoadFdoLibrary", NULL);
     }
 
@@ -236,19 +253,5 @@
     fact->Register(MapGuide_Desktop_MapLayer_Layer, MgdLayer::CreateObject);
     fact->Register(MapGuide_Desktop_MapLayer_Selection, MgdSelection::CreateObject);
 
-    EXCEPTION_CLASS_CREATOR(ConnectionFailedException)
-    EXCEPTION_CLASS_CREATOR(DuplicateParameterException)
-    EXCEPTION_CLASS_CREATOR(DwfException)
-    EXCEPTION_CLASS_CREATOR(DwfSectionNotFoundException)
-    EXCEPTION_CLASS_CREATOR(DwfSectionResourceNotFoundException)
-    EXCEPTION_CLASS_CREATOR(InvalidDwfPackageException)
-    EXCEPTION_CLASS_CREATOR(InvalidDwfSectionException)
-    EXCEPTION_CLASS_CREATOR(InvalidFeatureSourceException)
-    EXCEPTION_CLASS_CREATOR(ParameterNotFoundException)
-    EXCEPTION_CLASS_CREATOR(StylizeLayerFailedException)
-    EXCEPTION_CLASS_CREATOR(InvalidPrintLayoutFontSizeUnitsException)
-    EXCEPTION_CLASS_CREATOR(InvalidPrintLayoutPositionUnitsException)
-    EXCEPTION_CLASS_CREATOR(InvalidPrintLayoutSizeUnitsException)
-
     return true;
 }
\ No newline at end of file

Modified: trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/PlatformInit.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_PLATFORM_INIT_H
 #define DESKTOP_PLATFORM_INIT_H
 

Modified: trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,21 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+
 #include "MgDesktop.h"
 #include "TimerUtil.h"
 
@@ -60,6 +78,6 @@
 void MgdTimerUtil::GetFrequency(LARGE_INTEGER* pFrequency)
 {
     if(!QueryPerformanceFrequency(pFrequency))
-        throw new MgUnclassifiedException(L"MgdTimerUtil.GetFrequency", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgdTimerUtil.GetFrequency", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 #endif

Modified: trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.h
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/MgDesktop/System/TimerUtil.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1,3 +1,20 @@
+//
+//  Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
 #ifndef DESKTOP_TIMER_UTIL_H
 #define DESKTOP_TIMER_UTIL_H
 

Modified: trunk/MgDev/Desktop/UnitTest/CatchHelperMacros.h
===================================================================
--- trunk/MgDev/Desktop/UnitTest/CatchHelperMacros.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/CatchHelperMacros.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -17,10 +17,19 @@
 
 #include "catch.hpp"
 #define REQUIRE_THROWS_MG(action, extype) \
-    try { \
+    try \
+    { \
         action; \
         FAIL("Expected exception to be thrown"); \
     } \
-    catch (extype ex) { \
-        SAFE_RELEASE(ex); \
+    catch (MgException* ex) \
+    { \
+        if (ex->GetExceptionCode() == MgExceptionCodes::extype) \
+        { \
+            SAFE_RELEASE(ex); \
+        } \
+        else \
+        { \
+            ex->Raise(); \
+        } \
     }

Modified: trunk/MgDev/Desktop/UnitTest/TestFeatureService.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -45,7 +45,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader = pService->GetFeatureProviders();
@@ -85,7 +85,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         const STRING provider = L"OSGeo.SDF";
@@ -129,13 +129,13 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING provider = L"";
         STRING property = L"";
         STRING connectionString = L"";
-        REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException);
 
         provider = L"OSGeo.SDF";
         property = L"ReadOnly";
@@ -175,7 +175,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING provider = L"OSGeo.SDF";
@@ -186,7 +186,7 @@
 
         provider = L"";
 
-        REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -221,14 +221,14 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         bool bResult = pService->TestConnection(resource);
@@ -267,14 +267,14 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         Ptr<MgStringCollection> schemas = pService->GetSchemas(resource);
@@ -313,15 +313,15 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
-        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
@@ -361,33 +361,33 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
         STRING className = L"";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
         schemaName = L"";
         className = L"";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
         className = L"";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"Foo";
         className = L"Bar";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
         className = L"Bar";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgFdoException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
@@ -429,7 +429,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
@@ -492,16 +492,16 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
-        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
         schemaName = L"";
-        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, nullptr), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"";
@@ -541,7 +541,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
@@ -621,7 +621,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Empty.FeatureSource");
@@ -880,19 +880,19 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";
@@ -933,7 +933,7 @@
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Create our test data store
@@ -1058,19 +1058,19 @@
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.MapDefinition");
-        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.FeatureSource");
-        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectFeaturesExtended(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.FeatureSource");
         className = L"VotingDistricts";
@@ -1092,12 +1092,22 @@
         keys->Add(keyVal2);
 
         bool bScroll4 = true;
-        try {
+        try 
+        {
             bScroll4 = reader->ReadAt(keys);
-        } catch (MgFdoException* ex) {
-            //If it gets here, it is a defect in the provider as the spec says return false on non-existent record
-            ex->Release();
-            bScroll4 = false;
+        } 
+        catch (MgException* ex) 
+        {
+            if (ex->GetExceptionCode() == MgExceptionCodes::MgFdoException)
+            {
+                //If it gets here, it is a defect in the provider as the spec says return false on non-existent record
+                ex->Release();
+                bScroll4 = false;
+            }
+            else
+            {
+                ex->Raise();
+            }
         }
         bool bScroll5 = reader->ReadAtIndex(0); //indexes are 1-based
         bool bScroll6 = reader->ReadAtIndex(1);
@@ -1151,7 +1161,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgDataReader> reader;
@@ -1158,13 +1168,13 @@
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureAggregateOptions> options = new MgFeatureAggregateOptions();
-        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.MapDefinition");
-        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
-        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(reader = pService->SelectAggregate(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";
@@ -1203,7 +1213,7 @@
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> fsId = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels_Writable.FeatureSource");
@@ -1300,12 +1310,12 @@
         Ptr<MgResourceService> pResSvc = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pResSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_InsertFeaturesBatch", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_InsertFeaturesBatch", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_InsertFeaturesBatch", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_InsertFeaturesBatch", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Set up the feature source
@@ -1513,7 +1523,7 @@
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_UpdateFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_UpdateFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> fsId = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels_Writable.FeatureSource");
@@ -1587,7 +1597,7 @@
         Ptr<MgdFeatureService> pService = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_DeleteFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_DeleteFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> fsId = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels_Writable.FeatureSource");
@@ -1634,18 +1644,18 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         const STRING sqlQuery = L"";
-        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.MapDefinition");
-        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.FeatureSource");
-        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1683,18 +1693,18 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         const STRING sqlNonQuery = L"";
-        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidRepositoryTypeException);
         
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.MapDefinition");
-        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Test.FeatureSource");
-        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1731,15 +1741,15 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         bool activeOnly = false;
-        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
 
@@ -1813,15 +1823,15 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         bool activeOnly = false;
-        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException);
 
         //TODO test with correct input
     }
@@ -1858,28 +1868,28 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING longTransactionName = L"Live";
 
         // verify exception when passing in a nullptr resource
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(nullptr, longTransactionName), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(nullptr, longTransactionName), MgNullArgumentException);
 
         // verify exception when passing in an invalid resource type
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException);
 
         // verify exception when session is not set
         //resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
-        //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+        //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
 
         // set the user information for the current thread to be administrator - this
         // alone doesn't create a session
-        //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+        //REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
 
         // now set a session
         //REQUIRE(pService->SetLongTransaction(resource, longTransactionName));
@@ -1922,11 +1932,11 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING readerId = L"0";
-        REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1962,7 +1972,7 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING readerId = L"0";
@@ -2003,11 +2013,11 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING sqlReader = L"0";
-        REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -2043,7 +2053,7 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING sqlReader = L"0";
@@ -2085,13 +2095,13 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING featureReader = L"0";
         INT32 xSize = 0;
         INT32 ySize = 0;
-        REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -2128,11 +2138,11 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING dataReader = L"0";
-        REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -2168,7 +2178,7 @@
         Ptr<MgFeatureService> pService = MgdServiceFactory::CreateFeatureService();
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         STRING dataReader = L"0";
@@ -2210,7 +2220,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2268,7 +2278,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2342,7 +2352,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ExtendedFeatureClass",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ExtendedFeatureClass",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2522,13 +2532,13 @@
         Ptr<MgdServiceFactory> fact = new MgdServiceFactory();
         if (fact == 0)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> featureSource = new MgResourceIdentifier(L"Library://UnitTests/Data/TestInsert.FeatureSource");
@@ -2604,7 +2614,7 @@
         nameVal->SetValue(L"Bar");
 
         //Execute again, expect MgFdoException due to constraint violation
-        REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException*);
+        REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException);
         
         //Expect one inserted result
         Ptr<MgFeatureQueryOptions> query = new MgFeatureQueryOptions();
@@ -2662,7 +2672,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFdoFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFdoFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2746,7 +2756,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CreateFeatureSource",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CreateFeatureSource",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2753,7 +2763,7 @@
         Ptr<MgResourceService> pResourceService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pResourceService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CreateFeatureSource",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CreateFeatureSource",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -2850,7 +2860,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(factory->CreateService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
@@ -2913,12 +2923,12 @@
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(factory->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SecuredCredentials", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SecuredCredentials", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdResourceService> resSvc = dynamic_cast<MgdResourceService*>(factory->CreateService(MgServiceType::ResourceService));
         if (resSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SecuredCredentials", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SecuredCredentials", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         
         Ptr<MgResourceIdentifier> fsId = new MgResourceIdentifier(L"Library://UnitTests/Data/SecuredCredentials.FeatureSource");
@@ -2928,10 +2938,7 @@
             bool bResult = featSvc->TestConnection(fsId);
             REQUIRE(false == bResult);
         }
-        catch (MgFdoException* ex)
-        {
-            SAFE_RELEASE(ex);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
 
         //Now apply credentials
         resSvc->SetResourceCredentials(fsId, username, password);
@@ -2947,10 +2954,7 @@
             bool bResult = featSvc->TestConnection(fsId);
             REQUIRE(false == bResult);
         }
-        catch (MgFdoException* ex)
-        {
-            SAFE_RELEASE(ex);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
 
         //Try again without MG_USER_CREDENTIALS
         resSvc->DeleteResourceData(fsId, MgResourceDataName::UserCredentials);
@@ -2960,10 +2964,7 @@
             bool bResult = featSvc->TestConnection(fsId);
             REQUIRE(false == bResult);
         }
-        catch (MgFdoException* ex)
-        {
-            SAFE_RELEASE(ex);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgFdoException)
     }
     catch(MgException* e)
     {
@@ -3305,13 +3306,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSdfJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSdfJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSdfJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSdfJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -3405,13 +3406,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSqliteJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSqliteJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSqliteJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSqliteJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -3501,13 +3502,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSqliteAggregateJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSqliteAggregateJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkSqliteAggregateJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkSqliteAggregateJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -3610,13 +3611,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkMergeSortJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkMergeSortJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> featSvc = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkMergeSortJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkMergeSortJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -3738,13 +3739,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkBatchSortedBlockJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkBatchSortedBlockJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> featSvc = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkBatchSortedBlockJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkBatchSortedBlockJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -3866,13 +3867,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkNestedLoopsSortedBlockJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkNestedLoopsSortedBlockJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> featSvc = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkNestedLoopsSortedBlockJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkNestedLoopsSortedBlockJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -4225,13 +4226,13 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkNestedLoopsJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkNestedLoopsJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> featSvc = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService::TestCase_BenchmarkNestedLoopsJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService::TestCase_BenchmarkNestedLoopsJoin",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -4358,13 +4359,13 @@
         Ptr<MgdServiceFactory> fact = new MgdServiceFactory();
         if (fact == 0)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 

Modified: trunk/MgDev/Desktop/UnitTest/TestLogManager.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestLogManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestLogManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -227,12 +227,12 @@
         Ptr<MgStringProperty> newTestNameProp = new MgStringProperty(L"LogNameProperty", NewTestName);
         REQUIRE(logs->Contains(newTestNameProp));
 
-        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"", NewTestName), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L""), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(TestName, TestName), MgDuplicateFileException*);
-        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"", NewTestName), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L""), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(TestName, TestName), MgDuplicateFileException);
+        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException);
 #ifdef _WIN32
-        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException);
 #endif
     }
     catch (MgException* e)
@@ -440,12 +440,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException);
 
         // Search a log file with an invalid log entry as the first entry
         CreateFile(path + JunkName, L"asdfasdfasdf");
@@ -452,7 +452,7 @@
         pMgdLogManager->SetAccessLogFileName(JunkName);
         fromDate = new MgDateTime(2005, 3, 8, 0, 0, 0, 0);
         toDate = new MgDateTime(2005, 3, 9, 0, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgdInvalidLogEntryException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(fromDate, toDate), MgInvalidLogEntryException);
 
         pMgdLogManager->SetAccessLogFileName(originalName);
     }
@@ -479,7 +479,7 @@
 TEST_CASE("GetAccessLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -659,12 +659,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgdLogManager->SetAdminLogFileName(originalName);
     }
@@ -691,7 +691,7 @@
 TEST_CASE("GetAdminLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -871,12 +871,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgdLogManager->SetAuthenticationLogFileName(originalName);
     }
@@ -903,7 +903,7 @@
 TEST_CASE("GetAuthenticationLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1083,12 +1083,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgdLogManager->SetErrorLogFileName(originalName);
     }
@@ -1115,7 +1115,7 @@
 TEST_CASE("GetErrorLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1295,12 +1295,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgdLogManager->SetSessionLogFileName(originalName);
     }
@@ -1327,7 +1327,7 @@
 TEST_CASE("GetSessionLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1507,12 +1507,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgdLogManager->SetTraceLogFileName(originalName);
     }
@@ -1539,7 +1539,7 @@
 TEST_CASE("GetTraceLogInvalid", "[LogManager]")
 {
     MgdLogManager* pMgdLogManager = MgdLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgdLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------

Modified: trunk/MgDev/Desktop/UnitTest/TestLogManagerThread.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestLogManagerThread.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestLogManagerThread.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,7 +32,7 @@
     MgdLogManager* pMan = MgdLogManager::GetInstance();
     if (nullptr == pMan)
     {
-        throw new MgNullReferenceException(L"TestLogManagerThread.svc", __LINE__, __WFILE__, nullptr, L"", nullptr);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestLogManagerThread.svc", __LINE__, __WFILE__, nullptr, L"", nullptr);
     }
 
     INT32 nResult = 0;

Modified: trunk/MgDev/Desktop/UnitTest/TestPerformance.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestPerformance.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestPerformance.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -61,13 +61,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == 0)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Set the user information for the current thread to be administrator
@@ -116,7 +116,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == 0)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestEnd",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestEnd",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -123,7 +123,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestEnd",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestEnd",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -172,13 +172,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == 0)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
@@ -242,7 +242,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == 0)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestCase_BenchmarkJoinFeatures",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestCase_BenchmarkJoinFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -249,7 +249,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestCase_BenchmarkJoinFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestCase_BenchmarkJoinFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 

Modified: trunk/MgDev/Desktop/UnitTest/TestResourceService.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestResourceService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestResourceService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -79,10 +79,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -105,10 +105,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -131,10 +131,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -157,10 +157,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         
-        REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -183,11 +183,11 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to get repository header using a nullptr argument
-        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -210,11 +210,11 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try using nullptr argument
-        REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException);
 
         //Not try the real thing
         Ptr<MgByteSource> byteSource = new MgByteSource(packageName);
@@ -245,10 +245,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -272,7 +272,7 @@
 
         if (nullptr == service)
         {
-            throw new MgServiceNotAvailableException(
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
                 L"TestResourceService.TestCase_ResourceExists",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
@@ -279,7 +279,7 @@
 
         // Try to check a nullptr resource.
         bool existed = false;
-        REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException);
 
         // Try to check a resource that exists
         existed = service->ResourceExists(&libraryRepositoryIdentifier);
@@ -310,11 +310,11 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to enumerate resources using a nullptr argument
-        REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException);
 
         // Enumerate the Library resource.
         Ptr<MgByteReader> byteReader = pService->EnumerateResources(&libraryRepositoryIdentifier, -1, L"", true);
@@ -342,7 +342,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteSource> contentSource;
@@ -349,8 +349,8 @@
         contentSource = nullptr;
 
         //Try to use nullptr arguments
-        REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException);
 
         //Add a new resource
         contentSource = new MgByteSource(resourceContentFileName);
@@ -383,7 +383,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         std::string notXml = "Not XML content";
@@ -421,20 +421,20 @@
         //TODO: We can get xerces to vet the content as being XML, but can't figure out how to get xerces
         //to validate the content model. Until we figure that out, the relevant assertions are commented
         //out. Still at this stage it's better than letting any arbitrary content get through these calls.
-        REQUIRE_THROWS_MG(pService->SetResource(resId, r1, nullptr), MgXmlParserException*);
-        REQUIRE_THROWS_MG(pService->SetResource(resId, r2, nullptr), MgXmlParserException*);
-        //REQUIRE_THROWS_MG(pService->SetResource(resId, r3, nullptr), MgXmlParserException*);
-        REQUIRE_THROWS_MG(pService->SetResource(ldfId, r3, nullptr), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetResource(resId, r1, nullptr), MgXmlParserException);
+        REQUIRE_THROWS_MG(pService->SetResource(resId, r2, nullptr), MgXmlParserException);
+        //REQUIRE_THROWS_MG(pService->SetResource(resId, r3, nullptr), MgXmlParserException);
+        REQUIRE_THROWS_MG(pService->SetResource(ldfId, r3, nullptr), MgInvalidResourceTypeException);
         r3->Rewind();
-        REQUIRE_THROWS_MG(pService->SetResource(mdfId, r3, nullptr), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetResource(mdfId, r3, nullptr), MgInvalidResourceTypeException);
         r3->Rewind();
-        REQUIRE_THROWS_MG(pService->SetResource(pltId, r3, nullptr), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetResource(pltId, r3, nullptr), MgInvalidResourceTypeException);
         r3->Rewind();
-        REQUIRE_THROWS_MG(pService->SetResource(symId, r3, nullptr), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetResource(symId, r3, nullptr), MgInvalidResourceTypeException);
         r3->Rewind();
-        REQUIRE_THROWS_MG(pService->SetResource(slbId, r3, nullptr), MgInvalidResourceTypeException*);
-        REQUIRE_THROWS_MG(pService->SetResource(resId, r4, nullptr), MgInvalidResourceTypeException*);
-        //REQUIRE_THROWS_MG(pService->SetResource(resId, r5, nullptr), MgXmlParserException*);
+        REQUIRE_THROWS_MG(pService->SetResource(slbId, r3, nullptr), MgInvalidResourceTypeException);
+        REQUIRE_THROWS_MG(pService->SetResource(resId, r4, nullptr), MgInvalidResourceTypeException);
+        //REQUIRE_THROWS_MG(pService->SetResource(resId, r5, nullptr), MgXmlParserException);
         pService->SetResource(ssId, r6, nullptr);
         pService->SetResource(csId, r7, nullptr);
     }
@@ -460,16 +460,16 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to use nullptr arguments
-        REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException);
 
         //Try to move a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException);
 
         //Move the resource that was added earlier with cascade = true, and check referencing resource.
         pService->MoveResource(&resourceIdentifier, &resourceIdentifier2, false, true);
@@ -488,7 +488,7 @@
         REQUIRE(!pService->ResourceExists(&resourceIdentifier2));
 
         //Try to move the resource into itself (ie. itself)
-        REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -512,22 +512,22 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to use nullptr arguments
-        REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException);
 
         //Try to use source & destination as the same thing
-        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException);
 
         //Copy the moved resource to another location
         pService->CopyResource(&resourceIdentifier, &resourceIdentifier2, false);
 
         //Try to copy a resource to one that should now exist
-        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException*);
+        REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException);
     }
     catch(MgException* e)
     {
@@ -549,7 +549,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -556,10 +556,10 @@
         byteReader = nullptr;
 
         //Try to get the content using nullptr arguments
-        REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException);
 
         //Try to get the content of a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         byteReader = pService->GetResourceContent(&resourceIdentifier, L"");
@@ -587,17 +587,17 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to get the contents using nullptr arguments
-        REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException);
 
         //Try to get the content of a resource that doesn't exist
         Ptr<MgStringCollection> resourceNotExistCol = new MgStringCollection();
         resourceNotExistCol->Add(resourceNotExist.ToString());
         resourceNotExistCol->Add(resourceIdentifier.ToString());
-        REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         Ptr<MgStringCollection> resourceIds = new MgStringCollection();
@@ -631,10 +631,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -657,10 +657,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -683,10 +683,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -709,10 +709,10 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
-        REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNotImplementedException*);
+        REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNotImplementedException);
     }
     catch(MgException* e)
     {
@@ -736,7 +736,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -743,10 +743,10 @@
         byteReader = nullptr;
 
         //Try enumerating using a nullptr argument
-        REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException);
 
         //Try enumerating using a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException);
 
         //Enumerate the resource data of the resource added earlier
         byteReader = pService->EnumerateResourceData(&resourceIdentifier);
@@ -774,7 +774,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteSource> dataSource;
@@ -781,12 +781,12 @@
         dataSource = nullptr;
 
         //Try using a nullptr identifier
-        REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException);
 
         //Try to name the resource data with a 0 character string
         dataSource = new MgByteSource(dataFileName);
         Ptr<MgByteReader> dataReader = dataSource->GetReader();
-        REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgNullArgumentException);
 
         //Set the resource data
         dataSource = new MgByteSource(dataFileName);
@@ -814,20 +814,20 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         
         //Try using a null argument for the idenfier
-        REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException);
 
         //Try using a resource identifier that doesn't exist
-        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException);
 
         //Try to use a resource data name that doesn't exist
-        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException);
 
         //Try to name the resource data with a 0 character string
-        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgNullArgumentException);
 
         //Try to do a valid rename
         pService->RenameResourceData(&resourceIdentifier, resourceDataName, resourceDataName2, false);
@@ -854,7 +854,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -861,16 +861,16 @@
         byteReader = nullptr;
 
         //Try to get resource data using a nullptr identifier
-        REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException);
 
         //Try to get resource data using an empty data name string
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgNullArgumentException);
 
         //Try to get the resource data of a resource that does not exist
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException);
 
         //Try to get the resource data of a data name that doesn't exist
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException);
 
         //Get resource data using valid arguments
         byteReader = pService->GetResourceData(&resourceIdentifier, resourceDataName, L"");
@@ -896,17 +896,17 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try using a nullptr resource identifier
-        REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException);
 
         //Try using an empty string for the resource data name
-        REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgNullArgumentException);
 
         //Try deleting data that does not exist
-        REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException*);
+        REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException);
 
         //Delete the resource data that was set earlier
         pService->DeleteResourceData(&resourceIdentifier, resourceDataName);
@@ -933,17 +933,17 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pFeatureService = dynamic_cast<MgFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (pFeatureService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to use a nullptr argument
-        REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException);
 
         //Try to delete a resource that doesn't exist. We allow doing this for performance reason.
         pService->DeleteResource(&resourceNotExist);
@@ -1025,7 +1025,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Try to enumerate mappings
@@ -1054,7 +1054,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_BenchmarkGetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_BenchmarkGetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> resources = new MgStringCollection();
@@ -1140,7 +1140,7 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_PackageNoOpUpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_PackageNoOpUpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         MgResourceIdentifier resId(L"Library://UnitTests/Package/LineSymbol.SymbolDefinition");
         if (pService->ResourceExists(&resId))
@@ -1171,7 +1171,7 @@
         Ptr<MgdResourceService> pService = dynamic_cast<MgdResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == 0)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_PackageNoOpUpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_PackageNoOpUpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         pService->AddAliasMapping(L"MG_TEST", L"C:/Temp");

Modified: trunk/MgDev/Desktop/UnitTest/TestServiceFactory.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestServiceFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestServiceFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -70,12 +70,12 @@
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(fact->CreateService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
         Ptr<MgdFeatureService> featSvc = dynamic_cast<MgdFeatureService*>(fact->CreateService(MgServiceType::FeatureService));
         if (featSvc == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestStart", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgCoordinateSystemFactory> csFactory = new MgCoordinateSystemFactory();
@@ -1228,18 +1228,21 @@
                 Ptr<MgResourceIdentifier> wdfres1 = new MgResourceIdentifier(L"Library://UnitTests/Watermarks/PoweredByMapGuide.WatermarkDefinition");
                 pService->DeleteResource(wdfres1);
             }
-            catch (MgFileIoException* e)
-            {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
-            }
             catch (MgException* e)
             {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+                }
+                else
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                }
             }
             catch (...)
             {
@@ -1381,18 +1384,21 @@
                 Ptr<MgResourceIdentifier> ldfres21 = new MgResourceIdentifier(L"Library://UnitTests/Layers/RailWatermark.LayerDefinition");
                 pService->DeleteResource(ldfres21);
             }
-            catch (MgFileIoException* e)
-            {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
-            }
             catch (MgException* e)
             {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+                }
+                else
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                }
             }
             catch (...)
             {

Modified: trunk/MgDev/Desktop/UnitTest/TestTileService.cpp
===================================================================
--- trunk/MgDev/Desktop/UnitTest/TestTileService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Desktop/UnitTest/TestTileService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -313,16 +313,19 @@
         // set the tile in the cache
         svcTile->SetTile(img, map, scaleIndex, L"BaseLayers", tileCol, tileRow);
     }
-    catch (MgFileIoException* e)
-    {
-        // we sometimes get this due to a sharing error
-        SAFE_RELEASE(e);
-    }
     catch (MgException* e)
     {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+        {
+            // we sometimes get this due to a sharing error
+            SAFE_RELEASE(e);
+        }
+        else
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
     catch (...)
     {
@@ -667,7 +670,7 @@
         Ptr<MgdTileService> m_svcTile = dynamic_cast<MgdTileService*>(fact->CreateService(MgServiceType::TileService));
 
         // call the API with a nullptr argument
-        REQUIRE_THROWS_MG(m_svcTile->ClearCache(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(m_svcTile->ClearCache(nullptr), MgNullArgumentException);
 
         // call the API with a map having a different name
         Ptr<MgdMap> map = CreateMap(L"blah");

Modified: trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -166,7 +166,7 @@
     else
     {
         Ptr<MgException> mgException;
-        mgException = new  MgServerNotOnlineException(L"MgClientHandler.handle_input", __LINE__, __WFILE__, NULL, L"", NULL);
+        mgException = new MgException(MgExceptionCodes::MgServerNotOnlineException, L"MgClientHandler.handle_input", __LINE__, __WFILE__, NULL, L"", NULL);
 
         Ptr<MgStream> stream;
 

Modified: trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -121,7 +121,7 @@
 
     if (!resource->IsResourceTypeOf(MgResourceType::FeatureSource))
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgFeatureServiceCache.GetEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -109,7 +109,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(className);
 
-        throw new MgInvalidArgumentException(L"MgFeatureServiceCacheEntry.ParseQualifiedClassName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgFeatureServiceCacheEntry.ParseQualifiedClassName",
             __LINE__, __WFILE__, &whatArguments, L"MgSchemaNameMismatch", &whyArguments);
     }
 }

Modified: trunk/MgDev/Server/src/Common/Cache/ResourceServiceCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Cache/ResourceServiceCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Cache/ResourceServiceCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -117,7 +117,7 @@
 {
     if (NULL == resource)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgResourceServiceCache.GetEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -126,7 +126,7 @@
 
     if (!resource->IsResourceTypeOf(MgResourceType::LayerDefinition))
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgResourceServiceCache.GetEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Cache/ServerCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Cache/ServerCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Cache/ServerCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -53,7 +53,7 @@
 {
     if (size <= 0 || timeLimit <=0)
     {
-        throw new MgArgumentOutOfRangeException(L"MgServerCache.Initialize",
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgServerCache.Initialize",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -156,7 +156,7 @@
 
     if (NULL == resourceService)
     {
-        throw new MgServiceNotAvailableException(
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
             L"MgCacheManager.CheckPermission",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -257,7 +257,7 @@
                 STRING errorMsg = parser.GetErrorMessage();
                 MgStringCollection arguments;
                 arguments.Add(errorMsg);
-                throw new MgInvalidFeatureSourceException(
+                throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                     L"MgCacheManager::GetFeatureSourceCacheItem",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -277,7 +277,7 @@
             MgStringCollection arguments;
             arguments.Add(message);
 
-            throw new MgInvalidFeatureSourceException(
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                 L"MgCacheManager.GetFeatureSourceCacheItem",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -424,7 +424,7 @@
             MgStringCollection arguments;
             arguments.Add(message);
 
-            throw new MgInvalidFeatureSourceException(
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, 
                 L"MgCacheManager.GetResourceLayerDefinitionCacheItem",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }

Modified: trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -326,7 +326,7 @@
         MgStringCollection arguments;
         arguments.Add(provider);
 
-        throw new MgAllProviderConnectionsUsedException(L"MgFdoConnectionManager.Open",
+        throw new MgException(MgExceptionCodes::MgAllProviderConnectionsUsedException, L"MgFdoConnectionManager.Open",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -348,14 +348,13 @@
         //any _WITH_FEATURE_SOURCE macro with
         //
         //MgException really needs better inner exception absorption mechanisms here
-        MgFdoException* ex = dynamic_cast<MgFdoException*>(mgException.p);
-        if (NULL != ex)
+        if (mgException->GetExceptionCode() == MgExceptionCodes::MgFdoException)
         {
             MgServerManager* serverManager = MgServerManager::GetInstance();
             STRING locale = (NULL == serverManager) ?
                 MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
 
-            STRING message = ex->GetDetails(locale);
+            STRING message = mgException->GetDetails(locale);
             MgStringCollection args;
             args.Add(resourceIdentifier->ToString());
             args.Add(message);
@@ -363,7 +362,7 @@
             args.Add(L"");
 
             //Replace the exception to be thrown with our one
-            mgException = new MgFdoException(L"MgFdoConnectionManager.Open", __LINE__, __WFILE__, NULL, L"MgFeatureSourceFormatInnerExceptionMessage", &args);
+            mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgFdoConnectionManager.Open", __LINE__, __WFILE__, NULL, L"MgFeatureSourceFormatInnerExceptionMessage", &args);
         }
     }
     MG_FDOCONNECTION_MANAGER_THROW()
@@ -402,7 +401,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFdoConnectionManager.Open",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -484,7 +483,7 @@
         MgStringCollection arguments;
         arguments.Add(providerNoVersion);
 
-        throw new MgAllProviderConnectionsUsedException(L"MgFdoConnectionManager.Open",
+        throw new MgException(MgExceptionCodes::MgAllProviderConnectionsUsedException, L"MgFdoConnectionManager.Open",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -822,7 +821,7 @@
                 strCol->Add(message);
             }
 
-            throw new MgInvalidFeatureSourceException(L"MgFdoConnectionManager.SetConnectionProperties",
+            throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, L"MgFdoConnectionManager.SetConnectionProperties",
                 __LINE__, __WFILE__, (MgStringCollection*)strCol, L"", NULL);
         }
 
@@ -967,7 +966,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFdoConnectionManager.SetConfiguration",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -1005,7 +1004,7 @@
             strCol = new MgStringCollection();
             strCol->Add(message);
         }
-        throw new MgInvalidFeatureSourceException(L"MgFdoConnectionManager.SetConfiguration",
+        throw new MgException(MgExceptionCodes::MgInvalidFeatureSourceException, L"MgFdoConnectionManager.SetConfiguration",
             __LINE__, __WFILE__, (MgStringCollection*)strCol, L"", NULL);
     }
 
@@ -1085,12 +1084,12 @@
 
         FDO_SAFE_RELEASE(e);
 
-        throw new MgFdoException(L"MgFdoConnectionManager.Open",
+        throw new MgException(MgExceptionCodes::MgFdoException, L"MgFdoConnectionManager.Open",
             __LINE__, __WFILE__, NULL, messageId, &arguments);
     }
     catch (...)
     {
-        throw new MgConnectionFailedException(L"MgFdoConnectionManager.Open",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgFdoConnectionManager.Open",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1143,7 +1142,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFdoConnectionManager.RemoveCachedFdoConnection",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -1248,7 +1247,7 @@
         MgStringCollection arguments;
         arguments.Add(resource);
 
-        throw new MgResourceBusyException(
+        throw new MgException(MgExceptionCodes::MgResourceBusyException, 
             L"MgFdoConnectionManager.RemoveCachedFdoConnection",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1335,7 +1334,7 @@
         MgStringCollection arguments;
         arguments.Add(provider);
 
-        throw new MgAllProviderConnectionsUsedException(L"MgFdoConnectionManager.CacheFdoConnection",
+        throw new MgException(MgExceptionCodes::MgAllProviderConnectionsUsedException, L"MgFdoConnectionManager.CacheFdoConnection",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -2284,7 +2283,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgFdoConnectionManager.SetCachedFdoConnectionAsInvalid",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -144,7 +144,7 @@
 
     if (m_serverManager->IsSiteServer() != m_localServerInfo->IsSiteServer())
     {
-        throw new MgLogicException(
+        throw new MgException(MgExceptionCodes::MgLogicException, 
             L"MgLoadBalanceManager.Initialize",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -316,7 +316,7 @@
 
     if (NULL == serverInfo)
     {
-        throw new MgInvalidCastException(
+        throw new MgException(MgExceptionCodes::MgInvalidCastException, 
             L"MgLoadBalanceManager.GetServerInfo",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -626,7 +626,7 @@
 
     if (feedbackList == NULL || 1 != feedbackList->GetCount())
     {
-        throw new MgLogicException(
+        throw new MgException(MgExceptionCodes::MgLogicException, 
             L"MgLoadBalanceManager.RegisterServices",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -837,7 +837,7 @@
             0 != MgIpUtil::CompareAddresses(m_serverManager->GetSiteServerAddress(), serverInfo->GetAddress()))
         {
             // There are more than one Site servers within a site?
-            throw new MgLogicException(
+            throw new MgException(MgExceptionCodes::MgLogicException, 
                 L"MgLoadBalanceManager.EnableServicesOnServers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -884,7 +884,7 @@
             MgStringCollection arguments;
             arguments.Add(serverInfo->GetAddress());
 
-            throw new MgServerNotFoundException(
+            throw new MgException(MgExceptionCodes::MgServerNotFoundException, 
                 L"MgLoadBalanceManager.EnableServicesOnServers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1009,7 +1009,7 @@
     }
     else if (numServers == 0)
     {
-        throw new MgServiceNotAvailableException(
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
             L"MgLoadBalanceManager.RequestServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1041,7 +1041,7 @@
 
     if (!m_serverManager->IsSiteServer())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgLoadBalanceManager.EnumerateServers",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1089,7 +1089,7 @@
 
     if (!m_serverManager->IsSiteServer())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgLoadBalanceManager.AddServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1099,7 +1099,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgDuplicateServerException(
+        throw new MgException(MgExceptionCodes::MgDuplicateServerException, 
             L"MgLoadBalanceManager.AddServer",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1106,7 +1106,7 @@
 
     if (0 == MgIpUtil::CompareAddresses(m_serverManager->GetSiteServerAddress(), address))
     {
-        throw new MgLogicException(
+        throw new MgException(MgExceptionCodes::MgLogicException, 
             L"MgLoadBalanceManager.AddServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1116,7 +1116,7 @@
         MgStringCollection arguments;
         arguments.Add(address);
 
-        throw new MgDuplicateServerException(
+        throw new MgException(MgExceptionCodes::MgDuplicateServerException, 
             L"MgLoadBalanceManager.AddServer",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1196,7 +1196,7 @@
 
     if (!m_serverManager->IsSiteServer())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgLoadBalanceManager.UpdateServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1206,7 +1206,7 @@
         MgStringCollection arguments;
         arguments.Add(oldName);
 
-        throw new MgServerNotFoundException(
+        throw new MgException(MgExceptionCodes::MgServerNotFoundException, 
             L"MgLoadBalanceManager.UpdateServer",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1213,7 +1213,7 @@
 
     if (newName.empty() && newDescription.empty() && newAddress.empty())
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgLoadBalanceManager.UpdateServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1233,7 +1233,7 @@
             MgStringCollection arguments;
             arguments.Add(newName);
 
-            throw new MgDuplicateServerException(
+            throw new MgException(MgExceptionCodes::MgDuplicateServerException, 
                 L"MgLoadBalanceManager.UpdateServer",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1258,7 +1258,7 @@
     {
         if (0 == MgIpUtil::CompareAddresses(m_serverManager->GetSiteServerAddress(), newAddress))
         {
-            throw new MgLogicException(
+            throw new MgException(MgExceptionCodes::MgLogicException, 
                 L"MgLoadBalanceManager.UpdateServer",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1269,7 +1269,7 @@
             MgStringCollection arguments;
             arguments.Add(newAddress);
 
-            throw new MgDuplicateServerException(
+            throw new MgException(MgExceptionCodes::MgDuplicateServerException, 
                 L"MgLoadBalanceManager.UpdateServer",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1366,7 +1366,7 @@
 
     if (!m_serverManager->IsSiteServer())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgLoadBalanceManager.RemoveServer",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1376,7 +1376,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgServerNotFoundException(
+        throw new MgException(MgExceptionCodes::MgServerNotFoundException, 
             L"MgLoadBalanceManager.RemoveServer",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1442,7 +1442,7 @@
     CHECKARGUMENTNULL(serverInfoList, L"MgLoadBalanceManager.RegisterServicesOnServers");
     if (serverInfoList->GetCount() <= 0)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgLoadBalanceManager.RegisterServicesOnServers",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1460,7 +1460,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
                 L"MgLoadBalanceManager.RegisterServicesOnServers",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidCollectionSize", NULL);
         }
@@ -1511,7 +1511,7 @@
     CHECKARGUMENTNULL(serverInfoList, L"MgLoadBalanceManager.UnregisterServicesOnServers");
     if (serverInfoList->GetCount() <= 0)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgLoadBalanceManager.UnregisterServicesOnServers",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1529,7 +1529,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
                 L"MgLoadBalanceManager.UnregisterServicesOnServers",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidCollectionSize", NULL);
         }
@@ -1614,7 +1614,7 @@
 
                     if (feedbackList == NULL || 1 != feedbackList->GetCount())
                     {
-                        throw new MgLogicException(
+                        throw new MgException(MgExceptionCodes::MgLogicException, 
                             L"MgLoadBalanceManager.RegisterServices",
                             __LINE__, __WFILE__, NULL, L"", NULL);
                     }
@@ -1650,7 +1650,7 @@
 
                 if (feedbackList == NULL || 1 != feedbackList->GetCount()) // dummy feedback
                 {
-                    throw new MgLogicException(
+                    throw new MgException(MgExceptionCodes::MgLogicException, 
                         L"MgLoadBalanceManager.RegisterServices",
                         __LINE__, __WFILE__, NULL, L"", NULL);
                 }
@@ -1670,7 +1670,7 @@
 
         if (feedbackList == NULL || feedbackList->GetCount() <= 0)
         {
-            throw new MgLogicException(
+            throw new MgException(MgExceptionCodes::MgLogicException, 
                 L"MgLoadBalanceManager.RegisterServices",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }

Modified: trunk/MgDev/Server/src/Common/Manager/LogManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LogManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/LogManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -339,7 +339,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"\\/");
 
-        throw new MgInvalidArgumentException(L"MgLogManager.ValidateLogFileName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.ValidateLogFileName",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -2221,7 +2221,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(m_path);
-        throw new MgFileIoException(L"MgLogManager.EnumerateLogs", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFileIoException, L"MgLogManager.EnumerateLogs", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     dirent* direntry = NULL;
@@ -2337,7 +2337,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"\\/");
 
-        throw new MgInvalidArgumentException(L"MgLogManager.DeleteLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.DeleteLog",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -2397,7 +2397,7 @@
             arguments.Add(L"Failed to queue ACE_Message_Block.");
             messageId = L"MgFormatInnerExceptionMessage";
 
-            MgException* mgException = new MgRuntimeException(L"MgLogManager.QueueLogEntry", __LINE__, __WFILE__, NULL, messageId, &arguments);
+            MgException* mgException = new MgException(MgExceptionCodes::MgRuntimeException, L"MgLogManager.QueueLogEntry", __LINE__, __WFILE__, NULL, messageId, &arguments);
             throw mgException;
         }
     }
@@ -2538,7 +2538,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgLogManager.WriteLogMessage",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.WriteLogMessage",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
         }
@@ -2570,7 +2570,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(filename);
-                    throw new MgFileIoException(L"MgLogManager.WriteLogMessage", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgLogManager.WriteLogMessage", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 LogToOStream(pAce, pLogStream);
@@ -2697,7 +2697,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgLogManager.GetLogHeader",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.GetLogHeader",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }
@@ -2786,7 +2786,7 @@
         if (buffer == NULL)
         {
             ACE_OS::fclose(pReadFile);
-            throw new MgOutOfMemoryException(L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Clear buffer
@@ -2834,7 +2834,7 @@
 
     if (numEntries < 0)
     {
-        throw new  MgArgumentOutOfRangeException(L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     INT32 lastPos;      // Keeps track of the position in the file
@@ -2957,7 +2957,7 @@
         arguments.Add(L"2");
         arguments.Add(fromDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.GetLogContents",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFromDate", NULL);
     }
 
@@ -2969,7 +2969,7 @@
         arguments.Add(L"3");
         arguments.Add(toDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.GetLogContents",
             __LINE__, __WFILE__, &arguments, L"MgInvalidDateDifference", NULL);
     }
 
@@ -2997,7 +2997,7 @@
         arguments.Add(L"3");
         arguments.Add(toDate->ToString());
 
-        throw new MgInvalidArgumentException(L"MgLogManager.GetLogContents",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.GetLogContents",
              __LINE__, __WFILE__, &arguments, L"MgFailedToGetFileNameForDates", NULL);
     }
 
@@ -3004,7 +3004,7 @@
     entries = new MgStringCollection();
     if (entries == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     bool fromDateFound = false;
@@ -3170,7 +3170,7 @@
 
     if (filenames == NULL)
     {
-        throw new MgOutOfMemoryException(L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgLogManager.GetLogContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     STRING rawFilename;
@@ -3209,7 +3209,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgLogManager.DeterminePotentialFileNames",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.DeterminePotentialFileNames",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }
@@ -3496,7 +3496,7 @@
     // is enclosed by angle brackets, i.e. <CCYY-MM-DDThh:mm:ss>
     if (entry.find_first_of(L'<') != 0  || entry.find_first_of(L'>') != 20)
     {
-        throw new MgInvalidLogEntryException(
+        throw new MgException(MgExceptionCodes::MgInvalidLogEntryException, 
             L"MgLogManager.GetDateTimeFromEntry",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -3713,7 +3713,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgLogManager.ArchiveLog",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.ArchiveLog",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
     }
@@ -3849,7 +3849,7 @@
                 arguments.Add(L"1");
                 arguments.Add(buffer);
 
-                throw new MgInvalidArgumentException(L"MgLogManager.ValidateLogHeaders",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.ValidateLogHeaders",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
             }
     }
@@ -4178,7 +4178,7 @@
         arguments.Add(L"2");
         arguments.Add(logFileType);
 
-        throw new MgInvalidArgumentException(L"MgLogManager.DetermineLogFileStatus",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.DetermineLogFileStatus",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -4308,7 +4308,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgLogManager.CheckArchiveFrequency",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLogManager.CheckArchiveFrequency",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Common/Manager/LogManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LogManager.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/LogManager.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -274,11 +274,18 @@
                 { \
                     connInfoUserName = MgSessionManager::GetUserName(pUserInfo->GetMgSessionId()); \
                 } \
-                catch(MgSessionExpiredException* e) \
+                catch(MgException* se) \
                 { \
-                    /* The session ID has expired so we cannot look up the username. */ \
-                    SAFE_RELEASE(e); \
-                    connInfoUserName = L""; \
+                    if (se->GetExceptionCode() == MgExceptionCodes::MgSessionExpiredException) \
+                    { \
+                        /* The session ID has expired so we cannot look up the username. */ \
+                        SAFE_RELEASE(se); \
+                        connInfoUserName = L""; \
+                    } \
+                    else \
+                    { \
+                        se->Raise(); \
+                    } \
                 } \
             } \
         } \

Modified: trunk/MgDev/Server/src/Common/Manager/LogThread.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LogThread.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/LogThread.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -116,7 +116,7 @@
 
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = new MgFdoException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
+                            mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgLogThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
@@ -126,7 +126,7 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = MgSystemException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
+                            mgException = MgException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
@@ -134,7 +134,7 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = new MgUnclassifiedException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+                            mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
@@ -162,7 +162,7 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        mgException = MgSystemException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
+        mgException = MgException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
@@ -172,7 +172,7 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        mgException = new MgUnclassifiedException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 

Modified: trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -101,7 +101,7 @@
         MgStringCollection arguments;
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
-        throw new MgInvalidArgumentException(L"MgLongTransactionManager.GetLongTransactionName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLongTransactionManager.GetLongTransactionName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -141,7 +141,7 @@
         MgStringCollection arguments;
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
-        throw new MgInvalidArgumentException(L"MgLongTransactionManager.AddLongTransactionName",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLongTransactionManager.AddLongTransactionName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Common/Manager/PackageLogReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/PackageLogReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/PackageLogReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -124,7 +124,7 @@
     {
         if (!value.empty()) // invalid entry
         {
-            throw new MgFileIoException(
+            throw new MgException(MgExceptionCodes::MgFileIoException, 
                 L"MgPackageLogReader.SetEntry",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -159,7 +159,7 @@
         MgStringCollection arguments;
         arguments.Add(m_packagePathname);
 
-        throw new MgFileNotFoundException(
+        throw new MgException(MgExceptionCodes::MgFileNotFoundException, 
             L"MgPackageLogReader.ReadStatus",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -174,7 +174,7 @@
         MgStringCollection arguments;
         arguments.Add(m_logPathname);
 
-        throw new MgFileNotFoundException(
+        throw new MgException(MgExceptionCodes::MgFileNotFoundException, 
             L"MgPackageLogReader.ReadStatus",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -187,7 +187,7 @@
         MgStringCollection arguments;
         arguments.Add(m_logPathname);
 
-        throw new MgLogOpenFailedException(
+        throw new MgException(MgExceptionCodes::MgLogOpenFailedException, 
             L"MgPackageLogReader.GetLogInformation",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -255,7 +255,7 @@
             }
             else
             {
-                throw new MgFileIoException(
+                throw new MgException(MgExceptionCodes::MgFileIoException, 
                     L"MgPackageLogReader.ReadStatus",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -273,7 +273,7 @@
      || actualPackageDate == NULL
      || *packageDate != *actualPackageDate)
     {
-        throw new MgInvalidLogEntryException(
+        throw new MgException(MgExceptionCodes::MgInvalidLogEntryException, 
             L"MgPackageLogReader.ReadStatus",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Manager/PackageLogWriter.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/PackageLogWriter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/PackageLogWriter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
         MgStringCollection arguments;
         arguments.Add(m_logPathname);
 
-        throw new MgLogOpenFailedException(
+        throw new MgException(MgExceptionCodes::MgLogOpenFailedException, 
             L"MgPackageLogWriter.UpdateLog",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Manager/PackageManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/PackageManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/PackageManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -114,7 +114,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgPackageManager.GetPackageName",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -134,7 +134,7 @@
         arguments.Add(L"1");
         arguments.Add(packagePathname);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgPackageManager.GetPackageName",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -187,7 +187,7 @@
         MgStringCollection arguments;
         arguments.Add(packagePath);
 
-        throw new MgDirectoryNotFoundException(
+        throw new MgException(MgExceptionCodes::MgDirectoryNotFoundException, 
             L"MgPackageManager.EnumeratePackages",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -200,7 +200,7 @@
         MgStringCollection arguments;
         arguments.Add(packagePath);
 
-        throw new MgFileIoException(
+        throw new MgException(MgExceptionCodes::MgFileIoException, 
             L"MgPackageManager.EnumeratePackages",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -254,7 +254,7 @@
 
     if (NULL == resourceService)
     {
-        throw new MgServiceNotAvailableException(
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
             L"MgPackageManager.LoadPackage",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -292,7 +292,7 @@
 
     if (NULL == resourceService)
     {
-        throw new MgServiceNotAvailableException(
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
             L"MgPackageManager.MakePackage",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Common/Manager/SecurityCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/SecurityCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/SecurityCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -142,7 +142,7 @@
     }
     else if (strict)
     {
-        throw new MgAuthenticationFailedException(L"MgSecurityCache.GetUserInfo",
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, L"MgSecurityCache.GetUserInfo",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Common/Manager/SecurityManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/SecurityManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/SecurityManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -147,7 +147,7 @@
         userInformation->GetUserName() != MG_SYSTEM_USERNAME ||
         userInformation->GetPassword() != MG_SYSTEM_PASSWORD)
     {
-        throw new MgAuthenticationFailedException(
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, 
             L"MgSecurityManager.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -175,7 +175,7 @@
 
     if (NULL == userInformation)
     {
-        throw new MgAuthenticationFailedException(
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, 
             L"MgSecurityManager.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -186,7 +186,7 @@
     {
         if (user.empty())
         {
-            throw new MgAuthenticationFailedException(
+            throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, 
                 L"MgSecurityManager.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -195,7 +195,7 @@
 
         if (userInformation->GetPassword() != userInfo->GetPassword())
         {
-            throw new MgAuthenticationFailedException(
+            throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, 
                 L"MgSecurityManager.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -209,7 +209,7 @@
     {
         MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-        throw new MgUnauthorizedAccessException(
+        throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
             L"MgSecurityManager.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -191,7 +191,7 @@
             MgStringCollection arguments;
             arguments.Add(localServerAddress);
 
-            throw new MgInvalidIpAddressException(
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, 
                 L"MgServerManager.Initialize", __LINE__, __WFILE__, &arguments,
                 L"MgMachineIpMustBeLocalHost", NULL);
         }
@@ -202,7 +202,7 @@
             arguments.Add(siteServerAddress);
             arguments.Add(localServerAddress);
 
-            throw new MgLogicException(
+            throw new MgException(MgExceptionCodes::MgLogicException, 
                 L"MgServerManager.Initialize", __LINE__, __WFILE__, NULL,
                 L"MgInvalidIpConfigurationForSiteServer", &arguments);
         }
@@ -214,7 +214,7 @@
             MgStringCollection arguments;
             arguments.Add(siteServerAddress);
 
-            throw new MgInvalidIpAddressException(
+            throw new MgException(MgExceptionCodes::MgInvalidIpAddressException, 
                 L"MgServerManager.Initialize", __LINE__, __WFILE__, &arguments,
                 L"MgSiteServerIpMustNotBeLocalHost", NULL);
         }
@@ -225,7 +225,7 @@
             arguments.Add(siteServerAddress);
             arguments.Add(localServerAddress);
 
-            throw new MgLogicException(
+            throw new MgException(MgExceptionCodes::MgLogicException, 
                 L"MgServerManager.Initialize", __LINE__, __WFILE__, NULL,
                 L"MgInvalidIpConfigurationForSupportServer", &arguments);
         }
@@ -681,7 +681,7 @@
             arguments.Add(L"1");
             arguments.Add(identifier);
 
-            throw new MgInvalidArgumentException(L"MgServerManager.GetDocument",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerManager.GetDocument",
                 __LINE__, __WFILE__, &arguments, L"MgDocumentIdentifierFilenameFailed", NULL);
         }
     }
@@ -695,7 +695,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"");
 
-        throw new MgInvalidArgumentException(L"MgServerManager.GetDocument",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerManager.GetDocument",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -745,7 +745,7 @@
             arguments.Add(L"1");
             arguments.Add(identifier);
 
-            throw new MgInvalidArgumentException(L"MgServerManager.SetDocument",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerManager.SetDocument",
                 __LINE__, __WFILE__, &arguments, L"MgDocumentIdentifierFilenameFailed", NULL);
         }
     }
@@ -759,7 +759,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(L"");
 
-        throw new MgInvalidArgumentException(L"MgServerManager.SetDocument",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerManager.SetDocument",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 
@@ -1271,7 +1271,7 @@
 
     #else
 
-        throw new MgPlatformNotSupportedException(L"MgServerManager.ComputeWIN32CpuLoad", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgPlatformNotSupportedException, L"MgServerManager.ComputeWIN32CpuLoad", __LINE__, __WFILE__, NULL, L"", NULL);
 
     #endif  // _WIN32
 
@@ -1291,7 +1291,7 @@
 
     #ifdef _WIN32
 
-        throw new MgPlatformNotSupportedException(L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgPlatformNotSupportedException, L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, NULL, L"", NULL);
 
     #else
 
@@ -1313,7 +1313,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(MgUtil::LinuxFilesystemStat);
-            throw new MgFileNotFoundException(L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         fgets(line, 80, stat);
         sscanf(line, "%*3s %i %i %i %i", &ouser, &onice, &osys, &oidle);
@@ -1328,7 +1328,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(MgUtil::LinuxFilesystemStat);
-            throw new MgFileNotFoundException(L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFileNotFoundException, L"MgServerManager.ComputeLinuxCpuLoad", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         fgets(line, 80, stat);
         sscanf(line, "%*3s %i %i %i %i", &user, &nice, &sys, &idle);
@@ -1650,7 +1650,7 @@
             arguments.Add(L"Failed to queue ACE_Message_Block.");
             messageId = L"MgFormatInnerExceptionMessage";
 
-            MgException* mgException = new MgRuntimeException(L"MgServerManager.StartWorkerThread", __LINE__, __WFILE__, NULL, messageId, &arguments);
+            MgException* mgException = new MgException(MgExceptionCodes::MgRuntimeException, L"MgServerManager.StartWorkerThread", __LINE__, __WFILE__, NULL, messageId, &arguments);
             throw mgException;
         }
     }

Modified: trunk/MgDev/Server/src/Common/Manager/ServiceManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -324,7 +324,7 @@
             arguments.Add(L"1");
             arguments.Add(L"MgPropertyCollection");
 
-            throw new MgInvalidArgumentException(L"MgServiceManager.EnableServices",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServiceManager.EnableServices",
                 __LINE__, __WFILE__, &arguments, L"MgUnsupportedService", NULL);
         }
     }
@@ -339,7 +339,7 @@
             arguments.Add(L"1");
             arguments.Add(L"MgPropertyCollection");
 
-            throw new MgInvalidArgumentException(L"MgServiceManager.EnableServices",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServiceManager.EnableServices",
                 __LINE__, __WFILE__, &arguments, L"MgUnsupportedService", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
     }
     else
     {
-        throw new MgDuplicateSessionException(L"MgSessionCache.AddSession",
+        throw new MgException(MgExceptionCodes::MgDuplicateSessionException, L"MgSessionCache.AddSession",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -114,7 +114,7 @@
     {
         MgStringCollection args;
         args.Add(session);
-        throw new MgSessionExpiredException(L"MgSessionCache.RemoveSession",
+        throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSessionCache.RemoveSession",
             __LINE__, __WFILE__, NULL, L"MgSessionExpired", &args);
     }
     else
@@ -175,7 +175,7 @@
     {
         MgStringCollection args;
         args.Add(session);
-        throw new MgSessionExpiredException(L"MgSessionCache.GetSessionInfo",
+        throw new MgException(MgExceptionCodes::MgSessionExpiredException, L"MgSessionCache.GetSessionInfo",
             __LINE__, __WFILE__, NULL, L"MgSessionExpired", &args);
     }
 

Modified: trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -509,7 +509,7 @@
             arguments.Add(L"1");
             arguments.Add(path);
 
-            throw new MgInvalidArgumentException(L"MgUnmanagedDataManager.EnumerateUnmanagedData",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUnmanagedDataManager.EnumerateUnmanagedData",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -556,7 +556,7 @@
                 arguments.Add(L"1");
                 arguments.Add(path);
 
-                throw new MgInvalidArgumentException(L"MgUnmanagedDataManager.EnumerateUnmanagedData",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgUnmanagedDataManager.EnumerateUnmanagedData",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
         }

Modified: trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -122,7 +122,7 @@
 
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = new MgFdoException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
+                            mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
@@ -132,7 +132,7 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = MgSystemException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
+                            mgException = MgException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
@@ -140,7 +140,7 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            mgException = new MgUnclassifiedException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+                            mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
                             ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
                             MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
@@ -168,7 +168,7 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        mgException = MgSystemException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
+        mgException = MgException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
@@ -178,7 +178,7 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        mgException = new MgUnclassifiedException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
         ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
         MG_LOG_EXCEPTION_ENTRY(mgException->GetExceptionMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 

Modified: trunk/MgDev/Server/src/Core/EventTimer.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/EventTimer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/EventTimer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -45,7 +45,7 @@
 {
     if (NULL == m_eventHandler.get())
     {
-        throw new MgNullReferenceException(
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, 
             L"MgEventTimer.GetEventHandler", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -80,7 +80,7 @@
 
     if (NULL != m_eventHandler.get() || 0 != m_id)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgEventTimer.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -117,7 +117,7 @@
 
     if (NULL == m_eventHandler.get() || 0 != m_id)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgEventTimer.Schedule", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Core/LoadPackageCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/LoadPackageCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/LoadPackageCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -34,7 +34,7 @@
             Ptr<MgResourceService> resSvc = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
             if (NULL == (MgResourceService*)resSvc)
             {
-                throw new MgServiceNotAvailableException(L"MgLoadPackageCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"MgLoadPackageCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             Ptr<MgByteSource> bs = new MgByteSource(m_path);

Modified: trunk/MgDev/Server/src/Core/Server.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/Server.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/Server.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -457,7 +457,7 @@
 
                             MgStringCollection arguments;
                             arguments.Add(buffer);
-                            throw new MgPortNotAvailableException(L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgPortNotAvailableException, L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
                         }
                     }
                     else
@@ -472,7 +472,7 @@
 
                         MgStringCollection arguments;
                         arguments.Add(buffer);
-                        throw new MgPortNotAvailableException(L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgPortNotAvailableException, L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
                     }
                 }
                 else
@@ -487,7 +487,7 @@
 
                     MgStringCollection arguments;
                     arguments.Add(buffer);
-                    throw new MgPortNotAvailableException(L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgPortNotAvailableException, L"MgServer.svc", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
             }
             else
@@ -647,7 +647,7 @@
             whyArguments.Add(MgConfigProperties::GeneralPropertiesSection);
             whyArguments.Add(locale);
 
-            throw new MgConfigurationException(
+            throw new MgException(MgExceptionCodes::MgConfigurationException, 
                 L"MgServer.open",
                 __LINE__, __WFILE__, &whatArguments,
                 L"MgConfigurationPropertyValueIsInvalid", &whyArguments);
@@ -736,7 +736,7 @@
             // Check if we have a catalog
             if (NULL == csCatalog.p)
             {
-                throw new MgCoordinateSystemInitializationFailedException(
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
                     L"MgServer.open", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -794,7 +794,7 @@
             LibraryStatus status = csCatalog->GetLibraryStatus();
             if(lsInitialized != status)
             {
-                throw new MgCoordinateSystemInitializationFailedException(
+                throw new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
                     L"MgServer.open", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -922,7 +922,7 @@
             if (NULL == hlib)
             {
                 ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) MgServer::open() - Failed to load FDO library.\n")));
-                throw new MgFdoException(L"MgServer.svc",
+                throw new MgException(MgExceptionCodes::MgFdoException, L"MgServer.svc",
                      __LINE__, __WFILE__, NULL, L"MgFailedToLoadFdoLibrary", NULL);
             }
 

Modified: trunk/MgDev/Server/src/Core/ServiceHandlerFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/ServiceHandlerFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/ServiceHandlerFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -149,7 +149,7 @@
 
         case MgPacketParser::msiUnknown:
         default:
-            throw new MgServiceNotSupportedException(L"GetHandler",
+            throw new MgException(MgExceptionCodes::MgServiceNotSupportedException, L"GetHandler",
                 __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Core/SetPwdCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/SetPwdCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/SetPwdCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -33,7 +33,7 @@
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (NULL == (MgServerSiteService*)pService)
         {
-            throw new MgServiceNotAvailableException(L"MgSetPwdCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"MgSetPwdCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (m_strUser.empty()) //Need to have passed username

Modified: trunk/MgDev/Server/src/Core/TestCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/TestCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/TestCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -71,7 +71,7 @@
         else
         {
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot open library: %W\n"), library.c_str()));
-            throw new MgUnclassifiedException(L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #else
         string library = "libMgUnitTesting.so";
@@ -84,7 +84,7 @@
         else
         {
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot open library: %s (reason: %s)\n"), library.c_str(), dlerror()));
-            throw new MgUnclassifiedException(L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #endif // _WIN32
         if (execute != NULL)
@@ -102,7 +102,7 @@
         {
             // Failed to retrieve function
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot locate 'Execute' procedure address inside library.\n")));
-            throw new MgUnclassifiedException(L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         ACE_DEBUG((LM_INFO, ACE_TEXT("Finished running the unit tests.\n\n")));

Modified: trunk/MgDev/Server/src/Core/TestFdoCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/TestFdoCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/TestFdoCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -70,7 +70,7 @@
         else
         {
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot open library: %W\n"), library.c_str()));
-            throw new MgUnclassifiedException(L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #else
         string library = "libMgFdoUnitTesting.so";
@@ -83,7 +83,7 @@
         else
         {
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot open library: %s\n"), library.c_str()));
-            throw new MgUnclassifiedException(L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #endif // _WIN32
         if (execute != NULL)
@@ -101,7 +101,7 @@
         {
             // Failed to retrieve function
             ACE_DEBUG((LM_INFO, ACE_TEXT("Cannot locate 'Execute' procedure address inside library.\n")));
-            throw new MgUnclassifiedException(L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgTestFdoCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         ACE_DEBUG((LM_INFO, ACE_TEXT("Finished running the FDO unit tests.\n")));

Modified: trunk/MgDev/Server/src/Core/TimedEventHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/TimedEventHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Core/TimedEventHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
             break;
 
         default:
-            throw new MgInvalidArgumentException(
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
                 L"MgTimedEventHandler.Create", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/DrawingOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/DrawingOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/DrawingOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -77,7 +77,7 @@
                 handler.reset(new MgOpGetDrawing());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -89,7 +89,7 @@
                 handler.reset(new MgOpDescribeDrawing());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -101,7 +101,7 @@
                 handler.reset(new MgOpGetSection());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -113,7 +113,7 @@
                 handler.reset(new MgOpGetSectionResource());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -125,7 +125,7 @@
                 handler.reset(new MgOpEnumerateLayers());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -137,7 +137,7 @@
                 handler.reset(new MgOpGetLayer());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -149,7 +149,7 @@
                 handler.reset(new MgOpEnumerateSections());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -161,7 +161,7 @@
                 handler.reset(new MgOpEnumerateSectionResources());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
@@ -173,13 +173,13 @@
                 handler.reset(new MgOpGetCoordinateSpace());
                 break;
             default:
-                throw new MgInvalidOperationVersionException(
+                throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                     L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
             }
             break;
 
         default:
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpDescribeDrawing.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpDescribeDrawing.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpDescribeDrawing.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDescribeDrawing.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDescribeDrawing.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpEnumerateLayers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpEnumerateLayers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpEnumerateLayers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateLayers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateLayers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSectionResources.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSectionResources.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSectionResources.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateSectionResources.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateSectionResources.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSections.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSections.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpEnumerateSections.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateSections.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateSections.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpGetCoordinateSpace.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpGetCoordinateSpace.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpGetCoordinateSpace.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetCoordinateSpace.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetCoordinateSpace.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpGetDrawing.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpGetDrawing.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpGetDrawing.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetDrawing.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetDrawing.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpGetLayer.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpGetLayer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpGetLayer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -96,7 +96,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetLayer.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetLayer.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpGetSection.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpGetSection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpGetSection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSection.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSection.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/OpGetSectionResource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/OpGetSectionResource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/OpGetSectionResource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSectionResource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSectionResource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Drawing/ServerDrawingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/ServerDrawingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/ServerDrawingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -126,7 +126,7 @@
                 DWFCORE_FREE_OBJECT(pStream);
             if (0 != pBuffer)
                 DWFCORE_FREE_MEMORY(pBuffer);
-            throw new MgInvalidCastException(L"MgServerDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgServerDrawingService.DescribeDrawing", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Return the manifest via a MgByteReader
@@ -194,7 +194,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgDwfSectionNotFoundException(L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Create a DWFPackageWriter for writing the section to a temporary DWF file
@@ -288,7 +288,7 @@
             arguments.Add(L"2");
             arguments.Add(resourceName);
 
-            throw new MgInvalidArgumentException(L"MgServerDrawingService.GetSectionResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerDrawingService.GetSectionResource",
                 __LINE__, __WFILE__, &arguments, L"MgResourceNameSeparatorNotFound", NULL);
         }
         sectionName = resourceName.substr(0, index);
@@ -299,7 +299,7 @@
             arguments.Add(L"2");
             arguments.Add(resourceName);
 
-            throw new MgInvalidArgumentException(L"MgServerDrawingService.GetSectionResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerDrawingService.GetSectionResource",
                 __LINE__, __WFILE__, &arguments, L"MgResourceNameDoesNotContainSectionName", NULL);
         }
 
@@ -310,7 +310,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgDwfSectionNotFoundException(L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         // ...check if the resource exists in the section
         DWFResource* pResource = pSection->findResourceByHREF(resourceName.c_str());
@@ -318,7 +318,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(resourceName);
-            throw new MgDwfSectionResourceNotFoundException(L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionResourceNotFoundException, L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         // ...get the mime type for the resource
         STRING wsMimeType = (STRING)pResource->mime();
@@ -335,7 +335,7 @@
                 DWFCORE_FREE_OBJECT(pStream);
             if (0 != pBuffer)
                 DWFCORE_FREE_MEMORY(pBuffer);
-            throw new MgInvalidCastException(L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, L"MgServerDrawingService.GetSectionResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Return the resource via a MgByteReader
@@ -405,7 +405,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgDwfSectionNotFoundException(L"MgServerDrawingService.EnumerateLayers", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgServerDrawingService.EnumerateLayers", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Get the resources for the section
@@ -425,7 +425,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(sectionName);
-                    throw new MgInvalidDwfSectionException(L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 pResource = piResources->get();
@@ -452,7 +452,7 @@
         FILE* fp = fopen( tempW2dFileName.c_str(), "wb+" );  // NOXLATE
         if (0 == fp)
         {
-            throw new MgTemporaryFileNotAvailableException(L"MgServerDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgTemporaryFileNotAvailableException, L"MgServerDrawingService.EnumerateLayers", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         fwrite(pBuffer, sizeof(char), nBytes, fp);
@@ -548,7 +548,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgDwfSectionNotFoundException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         pSection->readDescriptor();
 
@@ -569,7 +569,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(sectionName);
-                    throw new MgInvalidDwfSectionException(L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgServerDrawingService.GetSection", __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
 
                 pResource = piResources->get();
@@ -596,7 +596,7 @@
         FILE* fp = fopen( tempW2dFileName.c_str(), "wb+" );  // NOXLATE
         if (0 == fp)
         {
-            throw new MgTemporaryFileNotAvailableException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgTemporaryFileNotAvailableException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         fwrite(pBuffer, sizeof(char), nBytes, fp);
@@ -668,7 +668,7 @@
             // Cannot find specified layer in the Dwf section
             MgStringCollection arguments;
             arguments.Add(targetLayer.name);
-            throw new MgLayerNotFoundException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgLayerNotFoundException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Use EPlotSection to get section color, paper
@@ -691,7 +691,7 @@
             pPaper) );
         if (0 == pPage)
         {
-            throw new MgOutOfMemoryException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         // Set properties for the section
         pPage->provideProperty(
@@ -708,7 +708,7 @@
             L"") );
         if (0 == p2Dgfx)
         {
-            throw new MgOutOfMemoryException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         p2Dgfx->configureGraphic(pTransform, pExtents, pClip);
 
@@ -718,7 +718,7 @@
         if (pW2DFile == NULL)
         {
             DWFCORE_FREE_OBJECT( p2Dgfx );
-            throw new MgOutOfMemoryException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         DWFFileInputStream* pW2DFilestream = DWFCORE_ALLOC_OBJECT( DWFFileInputStream );
         if (pW2DFilestream == NULL)
@@ -725,7 +725,7 @@
         {
             DWFCORE_FREE_OBJECT( p2Dgfx );
             DWFCORE_FREE_OBJECT( pW2DFile );
-            throw new MgOutOfMemoryException(L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgServerDrawingService.GetLayer", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         //... open the file and bind it to the stream
         pW2DFile->open();
@@ -936,7 +936,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgDwfSectionNotFoundException(L"MgServerDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgDwfSectionNotFoundException, L"MgServerDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Get all the resources in the section
@@ -946,7 +946,7 @@
         {
             MgStringCollection arguments;
             arguments.Add(sectionName);
-            throw new MgInvalidDwfSectionException(L"MgServerDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidDwfSectionException, L"MgServerDrawingService.EnumerateSectionResources", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Iterate through the resources and write to xml document

Modified: trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceDefs.h
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -34,7 +34,7 @@
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(STRING(e.message()));                                   \
-        mgException = new MgDwfException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgDwfException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Drawing/ServerDrawingServiceUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -308,7 +308,7 @@
 
     if (resourceService == 0)
     {
-        throw new MgServiceNotAvailableException(L"MgServerDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"MgServerDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     byteReader = resourceService->GetResourceContent(resource, L"Substitution");
@@ -348,7 +348,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(dwfFileName);
-        throw new MgInvalidDwfPackageException(L"MgServerDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgServerDrawingServiceUtil.OpenDrawingResource", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     MG_SERVER_DRAWING_SERVICE_CATCH_AND_THROW(L"MgServerDrawingServiceUtil.OpenDrawingResource")
@@ -409,7 +409,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(X2W(e.getMessage()));
-        throw new MgXmlParserException(L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
     catch (const DOMException& e)
@@ -416,12 +416,12 @@
     {
         MgStringCollection arguments;
         arguments.Add(X2W(e.msg));
-        throw new MgXmlParserException(L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments);
     }
     catch (...)
     {
-        throw new MgUnclassifiedException(L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
+        throw new MgException(MgExceptionCodes::MgUnclassifiedException, L"MgServerDrawingServiceUtil.ParseDrawingResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Server/src/Services/Feature/ByteSourceRasterStreamImpl.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ByteSourceRasterStreamImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ByteSourceRasterStreamImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -70,7 +70,7 @@
         arguments.Add(L"2");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"ByteSourceRasterStreamImpl.Read",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"ByteSourceRasterStreamImpl.Read",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgFeatureDistribution.CreateDistributionFunction", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -231,7 +231,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, 
                     L"MgFeatureGeometricFunctions.ExecuteOperation",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -254,7 +254,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgFeatureGeometricFunctions.CheckSupportedPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -283,7 +283,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                     L"MgFeatureGeometricFunctions.GetValue",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -311,7 +311,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgFeatureGeometricFunctions.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -72,7 +72,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgFeatureManipulationCommand.CreateCommand", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgFeatureManipulationCommand.CreateCommand", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     return command.Detach();

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -189,7 +189,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -248,7 +248,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
@@ -266,7 +266,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // find the range of the data values
@@ -501,7 +501,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgFeatureNumericFunctions.CheckSupportedPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -529,7 +529,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // collect information about the data values
@@ -629,7 +629,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.GetEqualCategories", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     int count = (int)values.size();

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -116,7 +116,7 @@
             handler.reset(new MgOpGetFeatureProviders());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -128,7 +128,7 @@
             handler.reset(new MgOpGetConnectionPropertyValues());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -140,7 +140,7 @@
             handler.reset(new MgOpTestConnection());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -152,7 +152,7 @@
             handler.reset(new MgOpTestFeatureSourceConnection());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -166,7 +166,7 @@
             handler.reset(new MgOpGetCapabilities());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -178,7 +178,7 @@
             handler.reset(new MgOpDescribeSchema());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -190,7 +190,7 @@
             handler.reset(new MgOpDescribeSchemaAsXml());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -202,7 +202,7 @@
             handler.reset(new MgOpGetSchemas());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -214,7 +214,7 @@
             handler.reset(new MgOpGetClasses());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -226,7 +226,7 @@
             handler.reset(new MgOpGetClassDefinition());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -238,7 +238,7 @@
             handler.reset(new MgOpSelectFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -250,7 +250,7 @@
             handler.reset(new MgOpSelectFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -262,7 +262,7 @@
             handler.reset(new MgOpSelectFeaturesSpatial());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -274,7 +274,7 @@
             handler.reset(new MgOpExecuteSqlQuery());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -286,7 +286,7 @@
             handler.reset(new MgOpExecuteSqlQuery());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -298,7 +298,7 @@
             handler.reset(new MgOpExecuteSqlNonQuery());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -310,7 +310,7 @@
             handler.reset(new MgOpExecuteSqlNonQuery());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -322,7 +322,7 @@
             handler.reset(new MgOpGetSpatialContexts());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -334,7 +334,7 @@
             handler.reset(new MgOpUpdateFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -346,7 +346,7 @@
             handler.reset(new MgOpUpdateFeaturesWithTransaction());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -358,7 +358,7 @@
             handler.reset(new MgOpInsertFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -370,7 +370,7 @@
             handler.reset(new MgOpInsertFeaturesBatched());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -382,7 +382,7 @@
             handler.reset(new MgOpUpdateMatchingFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -394,7 +394,7 @@
             handler.reset(new MgOpDeleteFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -406,7 +406,7 @@
             handler.reset(new MgOpGetFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -418,7 +418,7 @@
             handler.reset(new MgOpCloseFeatureReader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -430,7 +430,7 @@
             handler.reset(new MgOpGetSqlRows());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -442,7 +442,7 @@
             handler.reset(new MgOpCloseSqlReader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -454,7 +454,7 @@
             handler.reset(new MgOpGetDataRows());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -466,7 +466,7 @@
             handler.reset(new MgOpCloseDataReader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -478,7 +478,7 @@
             handler.reset(new MgOpGetLongTransactions());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -490,7 +490,7 @@
             handler.reset(new MgOpSetLongTransaction());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -502,7 +502,7 @@
             handler.reset(new MgOpGetRaster());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -514,7 +514,7 @@
             handler.reset(new MgOpSchemaToXml());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -526,7 +526,7 @@
             handler.reset(new MgOpXmlToSchema());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -538,7 +538,7 @@
             handler.reset(new MgOpCreateFeatureSource());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -550,7 +550,7 @@
             handler.reset(new MgOpGetIdentityProperties());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -563,7 +563,7 @@
             handler.reset(new MgOpDescribeWfsFeatureType());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -576,7 +576,7 @@
             handler.reset(new MgOpGetWfsFeature());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -588,7 +588,7 @@
             handler.reset(new MgOpGetWfsReader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -600,7 +600,7 @@
             handler.reset(new MgOpGetWfsFeatureTotal());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -612,7 +612,7 @@
             handler.reset(new MgOpEnumerateDataStores());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -625,7 +625,7 @@
             handler.reset(new MgOpGetSchemaMapping());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -638,7 +638,7 @@
             handler.reset(new MgOpGetFdoCacheInfo());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -650,7 +650,7 @@
             handler.reset(new MgOpGetClassDefinition());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -662,7 +662,7 @@
             handler.reset(new MgOpApplySchema());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -674,7 +674,7 @@
             handler.reset(new MgOpBeginTransaction());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -686,7 +686,7 @@
             handler.reset(new MgOpCommitTransaction());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -698,7 +698,7 @@
             handler.reset(new MgOpRollbackTransaction());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -710,7 +710,7 @@
             handler.reset(new MgOpAddSavePoint());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -722,7 +722,7 @@
             handler.reset(new MgOpRollbackSavePoint());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -734,13 +734,13 @@
             handler.reset(new MgOpReleaseSavePoint());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgFeatureOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -80,7 +80,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgFeatureDistribution.Initialize", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     m_reader = SAFE_ADDREF(reader);
@@ -139,7 +139,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgFeatureStringFunctions.CheckSupportedPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -161,7 +161,7 @@
             }
             default:
             {
-                throw new MgInvalidPropertyTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                     L"MgFeatureStringFunctions.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
@@ -196,7 +196,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, 
                     L"MgServerSelectFeatures.ExecuteOperation", __LINE__, __WFILE__, &arguments, L"", NULL);
             }
         }
@@ -218,7 +218,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                 L"MgFeatureStringFunctions.GetReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -71,7 +71,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -101,7 +101,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -129,7 +129,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -157,7 +157,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -185,7 +185,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -213,7 +213,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -241,7 +241,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -269,7 +269,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -297,7 +297,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -325,7 +325,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -384,7 +384,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -417,7 +417,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -482,7 +482,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -517,7 +517,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgJoinFeatureReader.GetFeatureObject",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgJoinFeatureReader.GetFeatureObject",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1041,7 +1041,7 @@
             // TODO: Fdo has some inconsistency with Decimal, therefore MapGuide
             // TODO: does not support it. Making this type as invalid argument
             // TODO: until we determine what to do with it???
-            //throw new MgInvalidArgumentException(L"MgServerGetFeatures.GetMgPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
+            //throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetFeatures.GetMgPropertyType", __LINE__, __WFILE__, NULL, L"", NULL);
             // propDef = new MgPropertyDefinition(name, ptDecimal);
             // break;
         //}
@@ -1108,7 +1108,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgJoinFeatureReader.GetFdoDataType",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgJoinFeatureReader.GetFdoDataType",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyType", NULL);
         }
     }

Modified: trunk/MgDev/Server/src/Services/Feature/OpAddSavePoint.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpAddSavePoint.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpAddSavePoint.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpAddSavePoint.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpAddSavePoint.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     

Modified: trunk/MgDev/Server/src/Services/Feature/OpApplySchema.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpApplySchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpApplySchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpApplySchema.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpApplySchema.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpBeginTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpBeginTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpBeginTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpBeginTransaction.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpBeginTransaction.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpCloseDataReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpCloseDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpCloseDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCloseDataReader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCloseDataReader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpCloseFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpCloseFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpCloseFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCloseFeatureReader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCloseFeatureReader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpCloseSqlReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpCloseSqlReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpCloseSqlReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCloseSqlReader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCloseSqlReader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpCommitTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpCommitTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpCommitTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCommitTransaction.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCommitTransaction.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpCreateFeatureSource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpCreateFeatureSource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpCreateFeatureSource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCreateFeatureSource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCreateFeatureSource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpDeleteFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpDeleteFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpDeleteFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -128,7 +128,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpDescribeSchema.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpDescribeSchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpDescribeSchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDescribeSchema.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDescribeSchema.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpDescribeSchemaAsXml.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpDescribeSchemaAsXml.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpDescribeSchemaAsXml.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDescribeSchemaAsXml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDescribeSchemaAsXml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -130,7 +130,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDescribeWfsFeatureType.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDescribeWfsFeatureType.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpEnumerateDataStores.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpEnumerateDataStores.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpEnumerateDataStores.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -96,7 +96,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateDataStores.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateDataStores.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlNonQuery.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlNonQuery.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlNonQuery.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -140,7 +140,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpExecuteSqlNonQuery.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpExecuteSqlNonQuery.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlQuery.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlQuery.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpExecuteSqlQuery.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -188,7 +188,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpExecuteSqlQuery.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpExecuteSqlQuery.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -114,7 +114,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetCapabilities.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetCapabilities.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetClassDefinition.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetClassDefinition.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetClassDefinition.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -143,7 +143,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetClassDefinition.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetClassDefinition.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetClasses.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetClasses.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetClasses.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetClasses.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetClasses.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetConnectionPropertyValues.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetConnectionPropertyValues.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetConnectionPropertyValues.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -102,7 +102,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetConnectionPropertyValues.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetConnectionPropertyValues.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetDataRows.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetDataRows.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetDataRows.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetDataRows.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetDataRows.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetFdoCacheInfo.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetFdoCacheInfo.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetFdoCacheInfo.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetFdoCacheInfo.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetFdoCacheInfo.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetFeatureProviders.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetFeatureProviders.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetFeatureProviders.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -85,7 +85,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetFeatureProviders.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetFeatureProviders.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetIdentityProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetIdentityProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetIdentityProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -102,7 +102,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetIdentityProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetIdentityProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetLongTransactions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetLongTransactions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetLongTransactions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetLongTransactions.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetLongTransactions.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetRaster.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetRaster.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetRaster.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -102,7 +102,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetRaster.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetRaster.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetSchemaMapping.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetSchemaMapping.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetSchemaMapping.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -96,7 +96,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSchemaMapping.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSchemaMapping.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetSchemas.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetSchemas.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetSchemas.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSchemas.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSchemas.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetSpatialContexts.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetSpatialContexts.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetSpatialContexts.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSpatialContexts.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSpatialContexts.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetSqlRows.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetSqlRows.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetSqlRows.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSqlRows.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSqlRows.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -198,7 +198,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetWfsFeature.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetWfsFeature.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeatureTotal.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeatureTotal.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeatureTotal.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -81,7 +81,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetWfsReader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetWfsReader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetWfsReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetWfsReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetWfsReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -118,7 +118,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetWfsReader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetWfsReader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpInsertFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpInsertFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpInsertFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -128,7 +128,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpInsertFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpInsertFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpInsertFeaturesBatched.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpInsertFeaturesBatched.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpInsertFeaturesBatched.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -128,7 +128,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpInsertFeaturesBatched.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpInsertFeaturesBatched.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpReleaseSavePoint.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpReleaseSavePoint.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpReleaseSavePoint.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpReleaseSavePoint.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpReleaseSavePoint.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpRollbackSavePoint.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpRollbackSavePoint.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpRollbackSavePoint.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRollbackSavePoint.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRollbackSavePoint.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpRollbackTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpRollbackTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpRollbackTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRollbackTransaction.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRollbackTransaction.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpSchemaToXml.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpSchemaToXml.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpSchemaToXml.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSchemaToXml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSchemaToXml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpSelectFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpSelectFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpSelectFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -132,7 +132,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSelectFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSelectFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpSelectFeaturesSpatial.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpSelectFeaturesSpatial.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpSelectFeaturesSpatial.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSelectFeaturesSpatial.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSelectFeaturesSpatial.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpSetLongTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpSetLongTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpSetLongTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetLongTransaction.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetLongTransaction.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpTestConnection.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpTestConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpTestConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpTestConnection.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpTestConnection.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpTestFeatureSourceConnection.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpTestFeatureSourceConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpTestFeatureSourceConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpTestFeatureSourceConnection.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpTestFeatureSourceConnection.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -123,7 +123,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpUpdateFeaturesWithTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpUpdateFeaturesWithTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpUpdateFeaturesWithTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateFeaturesWithTransaction.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateFeaturesWithTransaction.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpUpdateMatchingFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpUpdateMatchingFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpUpdateMatchingFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -136,7 +136,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateMatchingFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateMatchingFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/OpXmlToSchema.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpXmlToSchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/OpXmlToSchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSchemaToXml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSchemaToXml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -41,7 +41,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgSelectAggregateCommand.MgSelectAggregateCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgSelectAggregateCommand.MgSelectAggregateCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     // Create FdoISelectAggregates command
     FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();

Modified: trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -42,7 +42,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgSelectCommand.MgSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgSelectCommand.MgSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
@@ -99,7 +99,7 @@
     // This operation is not supported by FdoISelect
     // m_command->SetDistinct(value);
 
-    // throw new MgInvalidOperationException(L"MgSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 bool MgSelectCommand::GetDistinct()
@@ -108,7 +108,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetDistinct();
 
-    // throw new MgInvalidOperationException(L"MgSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
 
     return false;
 }
@@ -170,7 +170,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetGrouping();
 
-    // throw new MgInvalidOperationException(L"MgSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 
@@ -180,7 +180,7 @@
     // This operation is not supported by FdoISelect
     // m_command->SetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 FdoFilter* MgSelectCommand::GetGroupingFilter()
@@ -189,7 +189,7 @@
     // This operation is not supported by FdoISelect
     // return m_command->GetGroupingFilter(filter);
 
-    // throw new MgInvalidOperationException(L"MgSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
+    // throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerApplySchema.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerApplySchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerApplySchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -55,7 +55,7 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgServerFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgServerApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerApplySchema.ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIDescribeSchema> fdoDecribeSchemaCmd = (FdoIDescribeSchema*) fdoConn->CreateCommand(FdoCommandType_DescribeSchema);

Modified: trunk/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -56,7 +56,7 @@
             creator->CreateFeatureSource(false, false);
         }
         else
-            throw new MgInvalidArgumentException(L"MgServerCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerCreateFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resource, L"MgServerCreateFeatureSource.CreateFeatureSource")
@@ -89,13 +89,13 @@
     //
     Ptr<MgFeatureSchema> schema = m_params->GetFeatureSchema();
     if(schema == NULL)
-        throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSchema", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSchema", NULL);
 
     if (bCheckFeatureClass)
     {
         Ptr<MgClassDefinitionCollection> classes = schema->GetClasses();
         if(classes == NULL || classes->GetCount() == 0)
-            throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
 
         for(INT32 ci = 0; ci < classes->GetCount(); ci++)
         {
@@ -102,7 +102,7 @@
             Ptr<MgClassDefinition> classDef = classes->GetItem(ci);
             Ptr<MgPropertyDefinitionCollection> idProps = classDef->GetIdentityProperties();
             if(idProps == NULL || idProps->GetCount() == 0)
-                throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
         }
     }
 
@@ -110,7 +110,7 @@
     {
         // A coordinate system must be defined
         if(m_params->GetCoordinateSystemWkt().empty())
-            throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
     }
 
     // Connect to provider
@@ -120,7 +120,7 @@
     {
         if(NULL == msfc.p)
         {
-            throw new MgConnectionFailedException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // The reference to the FDO connection from the MgServerFeatureConnection object must be cleaned up before the parent object
@@ -128,7 +128,7 @@
         FdoPtr<FdoIConnection> conn =  msfc->GetConnection();
         if (conn == NULL)
         {
-            throw new MgConnectionFailedException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         CreateDataStore(conn);

Modified: trunk/MgDev/Server/src/Services/Feature/ServerDataReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -186,7 +186,7 @@
             FdoDataType dataType = m_dataReader->GetDataType(propertyName.c_str());
             if (FdoDataType(-1) == dataType)
             {
-                throw new MgInvalidPropertyTypeException(L"MgServerDataReader.GetPropertyType",
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerDataReader.GetPropertyType",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -200,7 +200,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerDataReader.GetPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerDataReader.GetPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -239,7 +239,7 @@
             FdoDataType dataType = m_dataReader->GetDataType(index);
             if (FdoDataType(-1) == dataType)
             {
-                throw new MgInvalidPropertyTypeException(L"MgServerDataReader.GetPropertyType",
+                throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerDataReader.GetPropertyType",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -253,7 +253,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerDataReader.GetPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerDataReader.GetPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -325,7 +325,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -361,7 +361,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -394,7 +394,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -430,7 +430,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -464,7 +464,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -502,7 +502,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -537,7 +537,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -573,7 +573,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -606,7 +606,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -642,7 +642,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -675,7 +675,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -711,7 +711,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -744,7 +744,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -780,7 +780,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -815,7 +815,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -853,7 +853,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -886,7 +886,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -927,7 +927,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -965,7 +965,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1001,7 +1001,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1034,7 +1034,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1070,7 +1070,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1119,7 +1119,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerDataReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1170,7 +1170,7 @@
             MgStringCollection arguments;
             arguments.Add(buffer);
 
-            throw new MgNullPropertyValueException(L"MgServerDataReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1201,7 +1201,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1263,7 +1263,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1315,7 +1315,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1356,7 +1356,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1496,7 +1496,7 @@
 
 void MgServerDataReader::Deserialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1508,55 +1508,55 @@
 /// <returns>MgByteReader holding XML.</returns>
 MgByteReader* MgServerDataReader::ToXml()
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.ToXml",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.ToXml",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerDataReader::GetResponseElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.GetResponseElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.GetResponseElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerDataReader::GetBodyElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.GetBodyElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.GetBodyElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::ResponseStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.ResponseStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.ResponseStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::ResponseEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.ResponseEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.ResponseEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::BodyStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.BodyStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.BodyStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::BodyEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.BodyEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.BodyEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::HeaderToStringUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.HeaderToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.HeaderToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerDataReader::CurrentToStringUtf8(string& str, MgTransform* xform)
 {
-    throw new MgInvalidOperationException(L"MgServerDataReader.CurrentToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.CurrentToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1576,7 +1576,7 @@
     {
         // TODO: specify which argument and message, once we have the mechanism
         STRING message = MgServerFeatureUtil::GetMessage(L"MgMissingRasterProperty");
-        throw new MgInvalidOperationException(L"MgServerDataReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerDataReader.GetRaster",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
     byteReader = MgServerFeatureUtil::GetRaster(m_dataReader, rasterPropName, xSize, ySize);
@@ -1627,7 +1627,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1667,7 +1667,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else

Modified: trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -201,7 +201,7 @@
                     }
                     else
                     {
-                        throw new MgConnectionFailedException(L"MgServerDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
 
@@ -211,7 +211,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerDescribeSchema.DescribeFdoSchema", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resource, L"MgServerDescribeSchema.DescribeFdoSchema")
@@ -548,7 +548,7 @@
                         }
                         else
                         {
-                            throw new MgConnectionFailedException(L"MgServerDescribeSchema.DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerDescribeSchema.DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
 
                     }  // end if (NULL != secFeatureSource)
@@ -897,7 +897,7 @@
         }
         else
         {
-            throw new MgConnectionFailedException(L"MgServerDescribeSchema.GetSchemas",
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerDescribeSchema.GetSchemas",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1000,7 +1000,7 @@
         }
         else
         {
-            throw new MgConnectionFailedException(L"MgServerDescribeSchema.GetClasses",
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerDescribeSchema.GetClasses",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1028,7 +1028,7 @@
 
     if (className.empty())
     {
-        throw new MgClassNotFoundException(
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
             L"MgServerDescribeSchema.GetClassDefinition",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1055,7 +1055,7 @@
 
         if (NULL == classDefinition.p)
         {
-            throw new MgClassNotFoundException(
+            throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
                 L"MgServerDescribeSchema.GetClassDefinition",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1087,7 +1087,7 @@
 
     if (NULL == classNames || classNames->GetCount() == 0)
     {
-        throw new MgClassNotFoundException(
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, 
             L"MgServerDescribeSchema.GetIdentityProperties",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Feature/ServerEnumerateDataStores.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerEnumerateDataStores.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerEnumerateDataStores.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerEnumerateDataStores::EnumerateDataStores()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerEnumerateDataStores::EnumerateDataStores()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgServerEnumerateDataStores.EnumerateDataStores")

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFdoFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFdoFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFdoFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -120,7 +120,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -162,7 +162,7 @@
             MgStringCollection arguments;
             arguments.Add(buffer);
 
-            throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -194,7 +194,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -229,7 +229,7 @@
             MgStringCollection arguments;
             arguments.Add(buffer);
 
-            throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -255,7 +255,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetFeatureObject",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetFeatureObject",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -285,7 +285,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetFeatureObject",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetFeatureObject",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -312,7 +312,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -342,7 +342,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -369,7 +369,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -399,7 +399,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -426,7 +426,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -456,7 +456,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -483,7 +483,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -513,7 +513,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -540,7 +540,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -570,7 +570,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -597,7 +597,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -627,7 +627,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -654,7 +654,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -684,7 +684,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -711,7 +711,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -741,7 +741,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -768,7 +768,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -798,7 +798,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -825,7 +825,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -856,7 +856,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -885,7 +885,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetLOBStreamReader",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetLOBStreamReader",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -918,7 +918,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetLOBStreamReader",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetLOBStreamReader",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -978,7 +978,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1012,7 +1012,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -294,7 +294,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -329,7 +329,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -364,7 +364,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -401,7 +401,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -436,7 +436,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -471,7 +471,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -506,7 +506,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -543,7 +543,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -578,7 +578,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -618,7 +618,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -664,7 +664,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -711,7 +711,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFdoFeatureReader.GetFeatureObject",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFdoFeatureReader.GetFeatureObject",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -767,7 +767,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -805,7 +805,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -916,7 +916,7 @@
 
 void MgServerFeatureReader::Deserialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -928,55 +928,55 @@
 /// <returns>MgByteReader holding XML.</returns>
 MgByteReader* MgServerFeatureReader::ToXml()
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.ToXml",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.ToXml",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerFeatureReader::GetResponseElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.GetResponseElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.GetResponseElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerFeatureReader::GetBodyElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.GetBodyElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.GetBodyElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::ResponseStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.ResponseStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.ResponseStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::ResponseEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.ResponseEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.ResponseEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::BodyStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.BodyStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.BodyStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::BodyEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.BodyEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.BodyEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::HeaderToStringUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.HeaderToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.HeaderToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerFeatureReader::CurrentToStringUtf8(string& str, MgTransform* xform)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureReader.CurrentToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.CurrentToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1056,7 +1056,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1088,7 +1088,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1244,7 +1244,7 @@
     {
         // TODO: specify which argument and message, once we have the mechanism
         STRING message = MgServerFeatureUtil::GetMessage(L"MgMissingRasterProperty");
-        throw new MgInvalidOperationException(L"MgServerFeatureReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureReader.GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // There can be more than one Raster property

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -282,7 +282,7 @@
         userInfo->GetApiVersion() != MG_API_VERSION(2,0,0) &&
         userInfo->GetApiVersion() != MG_API_VERSION(4,0,0)) //This is 2.0.0 with optional clean JSON output
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgServerFeatureService.GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -684,7 +684,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -722,7 +722,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -759,7 +759,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -797,7 +797,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.InsertFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Feature) //Insert result
         {
@@ -835,7 +835,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.UpdateMatchingFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.UpdateMatchingFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Int32) //Update result
         {
@@ -874,7 +874,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.UpdateMatchingFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.UpdateMatchingFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Int32) //Update result
         {
@@ -911,7 +911,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.DeleteFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.DeleteFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Int32) //Delete result
         {
@@ -949,7 +949,7 @@
             MgStringProperty* sp = static_cast<MgStringProperty*>(prop.p);
             MgStringCollection args;
             args.Add(sp->GetValue());
-            throw new MgFdoException(L"MgServerFeatureService.DeleteFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
+            throw new MgException(MgExceptionCodes::MgFdoException, L"MgServerFeatureService.DeleteFeatures", __LINE__, __WFILE__, &args, L"MgFormatInnerExceptionMessage", NULL);
         }
         else if (prop->GetPropertyType() == MgPropertyType::Int32) //Delete result
         {
@@ -990,7 +990,7 @@
                                                            CREFSTRING className,
                                                            MgFeatureQueryOptions* options)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgServerFeatureService::GetLockedFeatures",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -1371,7 +1371,7 @@
     CHECKARGUMENTNULL(featureSourceId, L"MgServerFeatureService.SetLongTransaction");
 
     if (featureSourceId->GetResourceType() != MgResourceType::FeatureSource)
-        throw new MgInvalidResourceTypeException(L"MgServerFeatureService.SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, L"MgServerFeatureService.SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_FEATURE_SERVICE_TRY()
 
@@ -1382,7 +1382,7 @@
         sessionId = userInfo->GetMgSessionId();
 
     if (sessionId.empty())
-        throw new MgSessionNotFoundException(L"MgServerFeatureService.SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgSessionNotFoundException, L"MgServerFeatureService.SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // set the name in the manager
     MgLongTransactionManager::SetLongTransactionName(sessionId, featureSourceId, longTransactionName);
@@ -1584,7 +1584,7 @@
                 qualifiedName += currClassName;
                 MgStringCollection args;
                 args.Add(qualifiedName);
-                throw new MgObjectNotFoundException(L"DescribeWfsFeatureType",
+                throw new MgException(MgExceptionCodes::MgObjectNotFoundException, L"DescribeWfsFeatureType",
                     __LINE__, __WFILE__, NULL, L"MgNoNameForObject", &args);
             }
             else
@@ -1689,7 +1689,7 @@
         arguments.Add(L"1");
         arguments.Add(featureReader);
 
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetFeatures",
             __LINE__, __WFILE__, &arguments, L"MgFeatureReaderIdNotFound", NULL);
     }
 
@@ -1855,7 +1855,7 @@
         arguments.Add(L"1");
         arguments.Add(reader);
 
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetRaster",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetRaster",
             __LINE__, __WFILE__, &arguments, L"MgReaderIdNotFound", NULL);
     }
 
@@ -1886,7 +1886,7 @@
         arguments.Add(L"1");
         arguments.Add(sqlReader);
 
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetSqlRows",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetSqlRows",
             __LINE__, __WFILE__, &arguments, L"MgSqlReaderIdNotFound", NULL);
     }
 
@@ -1964,7 +1964,7 @@
         arguments.Add(L"1");
         arguments.Add(dataReader);
 
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetDataRows",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetDataRows",
              __LINE__, __WFILE__, &arguments, L"MgDataReaderIdNotFound", NULL);
     }
 
@@ -2215,7 +2215,7 @@
     }
     else
     {
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetWfsFeature",
         __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -2254,7 +2254,7 @@
     }
     else
     {
-        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureService.GetWfsFeature",
         __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceExceptionDef.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceExceptionDef.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceExceptionDef.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -53,7 +53,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 
@@ -85,7 +86,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 
@@ -161,7 +163,8 @@
         }                                                                     \
                                                                               \
         FDO_SAFE_RELEASE(e);                                                  \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                     \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransaction.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransaction.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransaction.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -154,7 +154,7 @@
 
 void MgServerFeatureTransaction::Deserialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgServerFeatureTransaction.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureTransaction.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -189,12 +189,12 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgServerFeatureUtil::GetMessage(L"MgTransactionNotSupported");
-            throw new MgInvalidOperationException(L"MgServerFeatureTransaction.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerFeatureTransaction.Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerFeatureTransaction::Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerFeatureTransaction::Initialize", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransactionPool.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransactionPool.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureTransactionPool.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -346,6 +346,6 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerFeatureTransactionPool.ValidateTimeout", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerFeatureTransactionPool.ValidateTimeout", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -207,7 +207,7 @@
 
         MgStringCollection arguments;
         arguments.Add(customFunction->GetName());
-        throw new MgFeatureServiceException(L"MgServerFeatureUtil.GetArguments", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerFeatureUtil.GetArguments", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoString *arg0 = NULL, *arg1 = NULL, *arg2 = NULL, *arg3 = NULL;
@@ -293,7 +293,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerFeatureUtil.GetPropertyDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerFeatureUtil.GetPropertyDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // Get the name of property
@@ -349,7 +349,7 @@
 
                     MgStringCollection arguments;
                     arguments.Add(message);
-                    throw new MgFeatureServiceException(L"MgServerFeatureUtil.ValidateCustomConstraints",
+                    throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerFeatureUtil.ValidateCustomConstraints",
                         __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
                 break;
@@ -367,7 +367,7 @@
 
                     MgStringCollection arguments;
                     arguments.Add(message);
-                    throw new MgFeatureServiceException(L"MgServerFeatureUtil.ValidateCustomConstraints",
+                    throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerFeatureUtil.ValidateCustomConstraints",
                         __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
                 break;
@@ -380,7 +380,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgServerFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgServerFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
     double min = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -395,7 +395,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgServerFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgServerFeatureUtil.Minimum", __LINE__, __WFILE__, NULL, L"", NULL);
     INT64 min = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -410,7 +410,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgServerFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgServerFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
     double max = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -425,7 +425,7 @@
 {
     int cnt = (int)v.size();
     if (cnt <= 0)
-        throw new MgIndexOutOfRangeException(L"MgServerFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgIndexOutOfRangeException, L"MgServerFeatureUtil.Maximum", __LINE__, __WFILE__, NULL, L"", NULL);
     INT64 max = v[0];
     for (int i = 1; i < cnt; ++i)
     {
@@ -533,7 +533,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgServerFeatureUtil.GetRaster",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.GetRaster",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -616,7 +616,7 @@
 
     if (source->GetCount() != target->GetCount())
     {
-        throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateParameterCollection",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateParameterCollection",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1094,13 +1094,13 @@
         }
         case MgPropertyType::Feature:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerFeatureUtil.MgPropertyToFdoProperty",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerFeatureUtil.MgPropertyToFdoProperty",
                 __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         }
         case MgPropertyType::Raster:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerFeatureUtil.MgPropertyToFdoProperty",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerFeatureUtil.MgPropertyToFdoProperty",
                 __LINE__, __WFILE__, NULL, L"", NULL);
             break;
         }
@@ -2289,7 +2289,7 @@
         {
             MgStringCollection args;
             args.Add(mgSchema->GetName());
-            throw new MgDuplicateObjectException(L"MgServerFeatureUtil.GetFdoFeatureSchemaCollection", __LINE__, __WFILE__, NULL, L"MgDuplicateObject", &args);
+            throw new MgException(MgExceptionCodes::MgDuplicateObjectException, L"MgServerFeatureUtil.GetFdoFeatureSchemaCollection", __LINE__, __WFILE__, NULL, L"MgDuplicateObject", &args);
         }
         else
         {
@@ -2907,7 +2907,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgServerFeatureUtil.GetFdoDataType",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.GetFdoDataType",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPropertyType", NULL);
         }
     }
@@ -2950,7 +2950,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgServerFeatureUtil.GetFdoParameterDirection",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.GetFdoParameterDirection",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -2993,7 +2993,7 @@
             arguments.Add(L"1");
             arguments.Add(buffer);
 
-            throw new MgInvalidArgumentException(L"MgServerFeatureUtil.GetMgParameterDirection",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.GetMgParameterDirection",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -3155,7 +3155,7 @@
     {
         FdoFeatureClass* fdoFeatureClass = dynamic_cast<FdoFeatureClass*>(fdoClassDef);
         if (NULL == fdoFeatureClass)
-            throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
         FdoPtr<FdoGeometricPropertyDefinition> defaultGeom = (FdoGeometricPropertyDefinition*)fdoPropDefCol->GetItem(geomName.c_str());
         fdoFeatureClass->SetGeometryProperty(defaultGeom);
@@ -3280,7 +3280,7 @@
         {
             FdoDataPropertyDefinition* fdoDataPropDef = dynamic_cast<FdoDataPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoDataPropDef)
-                throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateDataPropertyDefinition((MgDataPropertyDefinition*)mgPropDef, fdoDataPropDef);
             break;
@@ -3290,7 +3290,7 @@
         {
             FdoObjectPropertyDefinition* fdoObjectPropDef = dynamic_cast<FdoObjectPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoObjectPropDef)
-                throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateObjectPropertyDefinition((MgObjectPropertyDefinition*)mgPropDef, fdoObjectPropDef, fdoClassCol);
             break;
@@ -3301,7 +3301,7 @@
         {
             FdoGeometricPropertyDefinition* fdoGeometricPropDef = dynamic_cast<FdoGeometricPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoGeometricPropDef)
-                throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateGeometricPropertyDefinition((MgGeometricPropertyDefinition*)mgPropDef, fdoGeometricPropDef);
             break;
@@ -3318,7 +3318,7 @@
         {
             FdoRasterPropertyDefinition* fdoRasterPropDef = dynamic_cast<FdoRasterPropertyDefinition*>(fdoPropDef);
             if (NULL == fdoRasterPropDef)
-                throw new MgInvalidArgumentException(L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerFeatureUtil.UpdateFdoClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
 
             UpdateRasterPropertyDefinition((MgRasterPropertyDefinition*)mgPropDef, fdoRasterPropDef);
             break;


Property changes on: trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp
___________________________________________________________________
Modified: svn:mergeinfo
## -3,5 +3,6 ##
 /sandbox/adsk/3.0m/Server/src/Services/Feature/ServerFeatureUtil.cpp:8584
 /sandbox/jng/convenience_apis/Server/src/Services/Feature/ServerFeatureUtil.cpp:8264-8268
 /sandbox/jng/createruntimemap/Server/src/Services/Feature/ServerFeatureUtil.cpp:7486-7555
+/sandbox/jng/flatten_exceptions/Server/src/Services/Feature/ServerFeatureUtil.cpp:9743-9755
 /sandbox/rfc94/Server/src/Services/Feature/ServerFeatureUtil.cpp:5099-5163
 /trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp:6250-6326
\ No newline at end of property
Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetConnectionPropertyValues.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetConnectionPropertyValues.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetConnectionPropertyValues.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -44,7 +44,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -54,7 +54,7 @@
         arguments.Add(L"2");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -90,7 +90,7 @@
     {
         if(NULL == msfc.p)
         {
-            throw new MgConnectionFailedException(L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // The reference to the FDO connection from the MgServerFeatureConnection object must be cleaned up before the parent object
@@ -113,7 +113,7 @@
             arguments.Add(L"2");
             arguments.Add(propertyName);
 
-            throw new MgInvalidArgumentException(L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetConnectionPropertyValues.GetConnectionPropertyValues",
                 __LINE__, __WFILE__, &arguments, L"MgPropertyNotEnumerable", NULL);
         }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetLongTransactions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetLongTransactions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetLongTransactions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -55,7 +55,7 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgServerFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgServerGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGetLongTransactions.GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIGetLongTransactions> fdoCommand = (FdoIGetLongTransactions*)fdoConn->CreateCommand(FdoCommandType_GetLongTransactions);
@@ -93,7 +93,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerGetLongTransactions::GetLongTransactions()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerGetLongTransactions::GetLongTransactions()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CHECK_CONNECTION_CATCH_AND_THROW(resId, L"MgServerGetLongTransactions.GetLongTransactions")

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -46,7 +46,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgServerGetProviderCapabilities.MgServerGetProviderCapabilities",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGetProviderCapabilities.MgServerGetProviderCapabilities",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerGetSchemaMapping::GetSchemaMapping()", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerGetSchemaMapping::GetSchemaMapping()", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgServerGetSchemaMapping.GetSchemaMapping")

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetSpatialContexts.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetSpatialContexts.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetSpatialContexts.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -62,7 +62,7 @@
             {
                 // TODO: specify which argument and message, once we have the mechanism
                 STRING message = MgServerFeatureUtil::GetMessage(L"MgCommandNotSupported");
-                throw new MgInvalidOperationException(L"MgServerGetSpatialContexts.GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGetSpatialContexts.GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             FdoPtr<FdoIGetSpatialContexts> fdoCommand = (FdoIGetSpatialContexts*)fdoConn->CreateCommand(FdoCommandType_GetSpatialContexts);
@@ -89,7 +89,7 @@
         }
         else
         {
-            throw new MgConnectionFailedException(L"MgServerGetSpatialContexts.GetSpatialContexts()", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerGetSpatialContexts.GetSpatialContexts()", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -199,7 +199,7 @@
                 if (m_attributeNameDelimiters->GetCount() != (INT32)m_primaryExtendedFeatureDescription->GetCount())
                 {
                     // Should never get here
-                    throw new MgInvalidArgumentException(L"MgServerGwsFeatureReader.ReadNext",
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGwsFeatureReader.ReadNext",
                         __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                 }
 
@@ -318,7 +318,7 @@
                         if (m_attributeNameDelimiters->GetCount() != (INT32)m_primaryExtendedFeatureDescription->GetCount())
                         {
                             // Should never get here
-                            throw new MgInvalidArgumentException(L"MgServerGwsFeatureReader.ReadNext",
+                            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGwsFeatureReader.ReadNext",
                                 __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                         }
 
@@ -509,7 +509,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -546,7 +546,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -583,7 +583,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -622,7 +622,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -659,7 +659,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -696,7 +696,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -733,7 +733,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -772,7 +772,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -809,7 +809,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -850,7 +850,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -898,7 +898,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -934,7 +934,7 @@
 MgFeatureReader* MgServerGwsFeatureReader::GetFeatureObject(CREFSTRING propertyName)
 {
     // TODO: Figure out how to support object properties.
-    throw new MgNotImplementedException(L"MgServerGwsFeatureReader.GetFeatureObject", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgServerGwsFeatureReader.GetFeatureObject", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -976,7 +976,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1019,7 +1019,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetRaster",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetRaster",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1217,7 +1217,7 @@
 
 void MgServerGwsFeatureReader::Deserialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1230,55 +1230,55 @@
 /// <returns>MgByteReader holding XML.</returns>
 MgByteReader* MgServerGwsFeatureReader::ToXml()
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.ToXml",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.ToXml",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerGwsFeatureReader::GetResponseElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.GetResponseElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.GetResponseElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerGwsFeatureReader::GetBodyElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.GetBodyElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.GetBodyElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::ResponseStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.ResponseStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.ResponseStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::ResponseEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.ResponseEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.ResponseEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::BodyStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.BodyStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.BodyStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::BodyEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.BodyEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.BodyEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::HeaderToStringUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.HeaderToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.HeaderToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerGwsFeatureReader::CurrentToStringUtf8(string& str, MgTransform* xform)
 {
-    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.CurrentToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerGwsFeatureReader.CurrentToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1393,7 +1393,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1429,7 +1429,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerGwsFeatureReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerGwsFeatureReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1470,7 +1470,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgServerGwsFeatureReader.DeterminePropertyFeatureSource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGwsFeatureReader.DeterminePropertyFeatureSource",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -1809,7 +1809,7 @@
                 if (m_attributeNameDelimiters->GetCount() != nSecondaryFeatures)
                 {
                     // Should never get here
-                    throw new MgInvalidArgumentException(L"MgServerGwsFeatureReader.GetMgClassDefinition", __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerGwsFeatureReader.GetMgClassDefinition", __LINE__, __WFILE__, NULL, L"MgInvalidCollectionSize", NULL);
                 }
             }
 
@@ -1882,8 +1882,11 @@
 
                     FDO_SAFE_RELEASE(e);
 
-                    throw new MgFdoException(L"MgServerGwsFeatureReader.GetMgClassDefinition",
-                        __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode);
+                    auto ex = new MgException(MgExceptionCodes::MgFdoException, L"MgServerGwsFeatureReader.GetMgClassDefinition",
+                        __LINE__, __WFILE__, NULL, messageId, &arguments);
+
+                    ex->SetNativeErrorCode(nativeErrorCode);
+                    throw ex;
                 }
             }
 

Modified: trunk/MgDev/Server/src/Services/Feature/ServerInsertCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerInsertCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerInsertCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerInsertCommand::Execute", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerInsertCommand::Execute", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoPtr<FdoIConnection> fdoConn = m_srvrFeatConn->GetConnection();
@@ -121,7 +121,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerGwsGetFeatures.BatchInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerGwsGetFeatures.BatchInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     char buff[32];
@@ -169,7 +169,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgServerInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         bool available = false;
@@ -193,7 +193,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgServerInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerInsertCommand.SingleInsert", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Performance improvement: Only return the key values

Modified: trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -174,7 +174,7 @@
 
             MgStringCollection arguments;
             arguments.Add(message);
-            throw new MgFeatureServiceException(L"MgServerSelectFeatures.SelectFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.SelectFeatures", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         // Custom function specified using SelectAggregate,
@@ -225,7 +225,7 @@
                     arguments.Add(L"1");
                     arguments.Add(L"MgFeatureServiceCommand");
 
-                    throw new MgInvalidArgumentException(L"MgServerSelectFeatures::SelectFeatures()",
+                    throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerSelectFeatures::SelectFeatures()",
                         __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
 
                 }
@@ -621,7 +621,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.ApplyOrderingOptions", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.ApplyOrderingOptions", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     if ((cnt == 1) && bExtended)
@@ -739,7 +739,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.AddCustomComputedProperty", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.AddCustomComputedProperty", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // Downcast to FdoFunction
@@ -797,7 +797,7 @@
 
                 MgStringCollection arguments;
                 arguments.Add(message);
-                throw new MgFeatureServiceException(L"MgServerSelectFeatures.ValidateConstraintsOnCustomFunctions",
+                throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.ValidateConstraintsOnCustomFunctions",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
             MgServerFeatureUtil::ValidateCustomConstraints(m_customFunction);
@@ -888,7 +888,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.ApplyFdoGroupingProperties", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.ApplyFdoGroupingProperties", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     FdoPtr<FdoIdentifierCollection> fic = ((MgFeatureServiceCommand*)m_command)->GetGrouping();
@@ -944,7 +944,7 @@
 
         MgStringCollection arguments;
         arguments.Add(message);
-        throw new MgFeatureServiceException(L"MgServerSelectFeatures.ContainsCustomFunction",
+        throw new MgException(MgExceptionCodes::MgFeatureServiceException, L"MgServerSelectFeatures.ContainsCustomFunction",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -1277,7 +1277,7 @@
             }
             else
             {
-                throw new MgConnectionFailedException(L"MgServerSelectFeatures.JoinFeatures",
+                throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSelectFeatures.JoinFeatures",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
@@ -1424,7 +1424,7 @@
                     }
                     else
                     {
-                        throw new MgConnectionFailedException(L"MgServerSelectFeatures.JoinFeatures",
+                        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSelectFeatures.JoinFeatures",
                             __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
@@ -1667,7 +1667,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgConnectionFailedException(L"MgServerSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIConnection> fdoConn = conn->GetConnection();
@@ -1861,7 +1861,7 @@
     if (NULL == (FdoClassDefinition*)classDef)
     {
         //TODO: Refine message if available
-        throw new MgClassNotFoundException(L"MgServerSelectFeatures.IsFunctionOnPrimaryProperty", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgServerSelectFeatures.IsFunctionOnPrimaryProperty", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     FdoPtr<FdoPropertyDefinitionCollection> properties = classDef->GetProperties();
@@ -1893,7 +1893,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgConnectionFailedException(L"MgServerSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSelectFeatures.SupportsFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoIConnection> fdoConn = conn->GetConnection();
@@ -1935,7 +1935,7 @@
         if (NULL == (FdoClassDefinition*)classDef)
         {
             //TODO: Refine message if available
-            throw new MgClassNotFoundException(L"MgServerSelectFeatures.FilterContainsSecondaryProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgServerSelectFeatures.FilterContainsSecondaryProperties", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         FdoPtr<FdoPropertyDefinitionCollection> propDefs = classDef->GetProperties();
@@ -2016,7 +2016,7 @@
     {
         if (!conn->IsConnectionOpen())
         {
-            throw new MgConnectionFailedException(L"MgServerSelectFeatures.SelectFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSelectFeatures.SelectFdoJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         CHECKNULL(m_command, L"MgServerSelectFeatures.SelectFdoJoin");
@@ -2256,7 +2256,7 @@
     if (NULL == (FdoClassDefinition*)classDef)
     {
         //TODO: Refine message if available
-        throw new MgClassNotFoundException(L"MgServerSelectFeatures.ApplyClassProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgServerSelectFeatures.ApplyClassProperties", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     FdoPtr<FdoIdentifierCollection> propNames = m_command->GetPropertyNames();

Modified: trunk/MgDev/Server/src/Services/Feature/ServerSqlCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerSqlCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerSqlCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -166,11 +166,11 @@
         {
             // TODO: specify which argument and message, once we have the mechanism
             STRING message = MgServerFeatureUtil::GetMessage(L"MgCommandNotSupported");
-            throw new MgInvalidOperationException(L"MgServerSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlCommand.Validate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
     else
     {
-        throw new MgConnectionFailedException(L"MgServerSqlCommand::Validate", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerSqlCommand::Validate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Server/src/Services/Feature/ServerSqlDataReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerSqlDataReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerSqlDataReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -191,7 +191,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerSqlDataReader.GetPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerSqlDataReader.GetPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -238,7 +238,7 @@
         }
         default:
         {
-            throw new MgInvalidPropertyTypeException(L"MgServerSqlDataReader.GetPropertyType",
+            throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerSqlDataReader.GetPropertyType",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -310,7 +310,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -346,7 +346,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetBoolean",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetBoolean",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -379,7 +379,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -415,7 +415,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetByte",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetByte",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -448,7 +448,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -486,7 +486,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetDateTime",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetDateTime",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -522,7 +522,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -558,7 +558,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetSingle",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetSingle",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -591,7 +591,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -627,7 +627,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetDouble",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetDouble",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -660,7 +660,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -696,7 +696,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt16",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt16",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -729,7 +729,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -765,7 +765,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt32",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt32",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -800,7 +800,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -838,7 +838,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetInt64",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetInt64",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -871,7 +871,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -912,7 +912,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -950,7 +950,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -986,7 +986,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetBLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetBLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1019,7 +1019,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1055,7 +1055,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetCLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetCLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1104,7 +1104,7 @@
             MgStringCollection arguments;
             arguments.Add(propertyName);
 
-            throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1155,7 +1155,7 @@
             MgStringCollection arguments;
             arguments.Add(buffer);
 
-            throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetGeometry",
+            throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetGeometry",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
         else
@@ -1179,7 +1179,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1218,7 +1218,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetLOB",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetLOB",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1336,7 +1336,7 @@
 
 void MgServerSqlDataReader::Deserialize(MgStream* stream)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1348,55 +1348,55 @@
 /// <returns>MgByteReader holding XML.</returns>
 MgByteReader* MgServerSqlDataReader::ToXml()
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.ToXml",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.ToXml",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerSqlDataReader::GetResponseElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.GetResponseElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.GetResponseElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 string MgServerSqlDataReader::GetBodyElementName()
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.GetBodyElementName",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.GetBodyElementName",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::ResponseStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.ResponseStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.ResponseStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::ResponseEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.ResponseEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.ResponseEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::BodyStartUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.BodyStartUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.BodyStartUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::BodyEndUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.BodyEndUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.BodyEndUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::HeaderToStringUtf8(string& str)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.HeaderToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.HeaderToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 void MgServerSqlDataReader::CurrentToStringUtf8(string& str, MgTransform* xform)
 {
-    throw new MgInvalidOperationException(L"MgServerSqlDataReader.CurrentToStringUtf8",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgServerSqlDataReader.CurrentToStringUtf8",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1411,7 +1411,7 @@
 /// MgFdoException
 MgRaster* MgServerSqlDataReader::GetRaster(CREFSTRING propertyName)
 {
-    throw new MgInvalidPropertyTypeException(L"MgServerSqlDataReader.GetRaster",
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerSqlDataReader.GetRaster",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1426,7 +1426,7 @@
 /// MgFdoException
 MgRaster* MgServerSqlDataReader::GetRaster(INT32 index)
 {
-    throw new MgInvalidPropertyTypeException(L"MgServerSqlDataReader.GetRaster",
+    throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, L"MgServerSqlDataReader.GetRaster",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
@@ -1451,7 +1451,7 @@
         MgStringCollection arguments;
         arguments.Add(propertyName);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else
@@ -1491,7 +1491,7 @@
         MgStringCollection arguments;
         arguments.Add(buffer);
 
-        throw new MgNullPropertyValueException(L"MgServerSqlDataReader.GetString",
+        throw new MgException(MgExceptionCodes::MgNullPropertyValueException, L"MgServerSqlDataReader.GetString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     else

Modified: trunk/MgDev/Server/src/Services/Feature/ServerUpdateFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerUpdateFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/ServerUpdateFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -48,7 +48,7 @@
     if ((NULL != m_SrvrFeatConn.p) && ( !m_SrvrFeatConn->IsConnectionOpen() ))
     {
 
-        throw new MgConnectionFailedException(L"MgServerUpdateFeatures::MgServerUpdateFeatures()",
+        throw new MgException(MgExceptionCodes::MgConnectionFailedException, L"MgServerUpdateFeatures::MgServerUpdateFeatures()",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -74,7 +74,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgServerUpdateFeatures.UpdateFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerUpdateFeatures.UpdateFeatures",
             __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
     }
 
@@ -164,7 +164,7 @@
         arguments.Add(L"2");
         arguments.Add(L"0");
 
-        throw new MgInvalidArgumentException(L"MgServerUpdateFeatures.UpdateFeatures",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerUpdateFeatures.UpdateFeatures",
             __LINE__, __WFILE__, &arguments, L"MgCollectionEmpty", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Feature/TransformedGeometryFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/TransformedGeometryFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Feature/TransformedGeometryFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -189,7 +189,7 @@
 //that will not return this type of reader
 BYTE_ARRAY_OUT MgTransformedGeometryFeatureReader::GetGeometry(CREFSTRING propertyName, INT32& length) 
 { 
-    throw new MgNotImplementedException(L"MgTransformedGeometryFeatureReader.GetGeometry", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgTransformedGeometryFeatureReader.GetGeometry", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 //This won't be used by RS_FeatureReader because stylization will use SelectFeatures()
@@ -196,7 +196,7 @@
 //that will not return this type of reader
 BYTE_ARRAY_OUT MgTransformedGeometryFeatureReader::GetGeometry(INT32 index, INT32& length) 
 { 
-    throw new MgNotImplementedException(L"MgTransformedGeometryFeatureReader.GetGeometry", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgTransformedGeometryFeatureReader.GetGeometry", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 MgRaster* MgTransformedGeometryFeatureReader::GetRaster(CREFSTRING propertyName) 
@@ -443,7 +443,7 @@
 
 void MgTransformedGeometryFeatureReader::Deserialize(MgStream* stream) 
 { 
-    throw new MgInvalidOperationException(L"MgTransformedGeometryFeatureReader.Deserialize",
+    throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgTransformedGeometryFeatureReader.Deserialize",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 

Modified: trunk/MgDev/Server/src/Services/Kml/KmlOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Kml/KmlOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Kml/KmlOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
             handler.reset(new MgOpGetMapKml());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgKmlOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -81,7 +81,7 @@
             handler.reset(new MgOpGetLayerKml());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgKmlOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -93,13 +93,13 @@
             handler.reset(new MgOpGetFeaturesKml());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgKmlOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgKmlOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Kml/OpGetFeaturesKml.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Kml/OpGetFeaturesKml.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Kml/OpGetFeaturesKml.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -139,7 +139,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetFeaturesKml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetFeaturesKml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Kml/OpGetLayerKml.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Kml/OpGetLayerKml.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Kml/OpGetLayerKml.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -105,7 +105,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetLayerKml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetLayerKml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Kml/OpGetMapKml.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Kml/OpGetMapKml.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Kml/OpGetMapKml.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetMapKml.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetMapKml.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1238,7 +1238,7 @@
             arguments.Add(L"1");
             arguments.Add(pageUnits);
 
-            throw new MgInvalidArgumentException(L"MgLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPrintLayoutPageSizeUnits", NULL);
         }
     }
@@ -1275,7 +1275,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgInvalidPrintLayoutPositionUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1314,7 +1314,7 @@
         else
         {
             // invalid positionUnits specified - should never get here
-            throw new MgInvalidPrintLayoutPositionUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1338,7 +1338,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgInvalidPrintLayoutPositionUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1355,7 +1355,7 @@
         else
         {
             // invalid units specified - should never get here
-            throw new MgInvalidPrintLayoutSizeUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement",
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutSizeUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1398,7 +1398,7 @@
             arguments.Add(L"1");
             arguments.Add(pageUnits);
 
-            throw new MgInvalidArgumentException(L"MgLegendPlotUtil.AddCustomTextElement",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgLegendPlotUtil.AddCustomTextElement",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidPrintLayoutPageSizeUnits", NULL);
         }
     }
@@ -1440,7 +1440,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgInvalidPrintLayoutPositionUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (positionUnits == L"percent")  // NOXLATE
@@ -1478,7 +1478,7 @@
         else
         {
             // invalid positionUnits specified - should never get here
-            throw new MgInvalidPrintLayoutPositionUnitsException(L"MgLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutPositionUnitsException, L"MgLegendPlotUtil.AddCustomLogoElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         double textSize = 0.0;
@@ -1502,7 +1502,7 @@
         else
         {
             // invalid positionUnits specified
-            throw new MgInvalidPrintLayoutFontSizeUnitsException(L"MgLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         if (sizeUnits == L"inches")  // NOXLATE
@@ -1520,7 +1520,7 @@
         else
         {
             // invalid units specified
-            throw new MgInvalidPrintLayoutFontSizeUnitsException(L"MgLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidPrintLayoutFontSizeUnitsException, L"MgLegendPlotUtil.AddCustomTextElement", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         fontName = textInfo.GetFontName();
         fontHeight = textSize;

Modified: trunk/MgDev/Server/src/Services/Mapping/MappingOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/MappingOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/MappingOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
             handler.reset(new MgOpGeneratePlot());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -94,7 +94,7 @@
             handler.reset(new MgOpGeneratePlot());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -106,7 +106,7 @@
             handler.reset(new MgOpGeneratePlot());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -118,7 +118,7 @@
             handler.reset(new MgOpGenerateMultiPlot());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -130,7 +130,7 @@
             handler.reset(new MgOpGenerateLegendPlot());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -142,7 +142,7 @@
             handler.reset(new MgOpGenerateLegendImage());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -154,7 +154,7 @@
             handler.reset(new MgOpMQueryFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -166,7 +166,7 @@
             handler.reset(new MgOpQueryFeaturesWms());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -178,7 +178,7 @@
             handler.reset(new MgOpCreateRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -190,7 +190,7 @@
             handler.reset(new MgOpCreateRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -202,7 +202,7 @@
             handler.reset(new MgOpCreateRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -214,7 +214,7 @@
             handler.reset(new MgOpDescribeRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -226,7 +226,7 @@
             handler.reset(new MgOpDescribeRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -238,13 +238,13 @@
             handler.reset(new MgOpDescribeRuntimeMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgMappingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -68,7 +68,7 @@
         STRING errorMsg = parser.GetErrorMessage();
         MgStringCollection arguments;
         arguments.Add(errorMsg);
-        throw new MgInvalidMapDefinitionException(L"MgMappingUtil::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgMappingUtil::GetMapDefinition", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     // detach the map definition from the parser - it's
@@ -914,8 +914,8 @@
             MgStringCollection argumentsWhy;
             argumentsWhy.Add(mgException->GetExceptionMessage(locale));
 
-            Ptr<MgStylizeLayerFailedException> exception;
-            exception = new MgStylizeLayerFailedException(L"MgMappingUtil.StylizeLayers", __LINE__, __WFILE__, &arguments, L"MgFormatInnerExceptionMessage", &argumentsWhy);
+            Ptr<MgException> exception;
+            exception = new MgException(MgExceptionCodes::MgStylizeLayerFailedException, L"MgMappingUtil.StylizeLayers", __LINE__, __WFILE__, &arguments, L"MgFormatInnerExceptionMessage", &argumentsWhy);
 
             STRING message = exception->GetExceptionMessage(locale);
             STRING stackTrace = exception->GetStackTrace(locale);
@@ -1315,7 +1315,8 @@
         arguments.Add(buf);
     }
 
-    mgException = new MgFdoException(L"MgStylizationUtil.ExceptionTrap", line, file, NULL, messageId, &arguments, nativeErrorCode);
+    mgException = new MgException(MgExceptionCodes::MgFdoException, L"MgStylizationUtil.ExceptionTrap", line, file, NULL, messageId, &arguments);
+    mgException->SetNativeErrorCode(nativeErrorCode);
 
     MG_CATCH(L"MgStylizationUtil.ExceptionTrap")
 


Property changes on: trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
___________________________________________________________________
Modified: svn:mergeinfo
## -4,5 +4,6 ##
 /sandbox/adsk/3.1n/Server/src/Services/Mapping/MappingUtil.cpp:8942
 /sandbox/jng/clean_json/Server/src/Services/Mapping/MappingUtil.cpp:8818-9180
 /sandbox/jng/createruntimemap/Server/src/Services/Mapping/MappingUtil.cpp:7486-7555
+/sandbox/jng/flatten_exceptions/Server/src/Services/Mapping/MappingUtil.cpp:9743-9755
 /sandbox/jng/ogc/Server/src/Services/Mapping/MappingUtil.cpp:9240-9255
 /sandbox/rfc94/Server/src/Services/Mapping/MappingUtil.cpp:5099-5163
\ No newline at end of property
Modified: trunk/MgDev/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpCreateRuntimeMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -187,7 +187,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCreateRuntimeMap.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCreateRuntimeMap.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpDescribeRuntimeMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -181,7 +181,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDescribeRuntimeMap.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDescribeRuntimeMap.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendImage.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendImage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendImage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -107,7 +107,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGenerateLegendImage.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGenerateLegendImage.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendPlot.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendPlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpGenerateLegendPlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -103,7 +103,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGenerateLegendPlot.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGenerateLegendPlot.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpGenerateMultiPlot.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpGenerateMultiPlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpGenerateMultiPlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -98,7 +98,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGenerateMultiPlot.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGenerateMultiPlot.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpGeneratePlot.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpGeneratePlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpGeneratePlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -182,7 +182,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGeneratePlot.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGeneratePlot.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpQueryFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpQueryFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpQueryFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpQueryFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpQueryFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/OpQueryFeaturesWms.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/OpQueryFeaturesWms.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/OpQueryFeaturesWms.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -108,7 +108,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpQueryFeaturesWms.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpQueryFeaturesWms.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -285,7 +285,7 @@
         STRING message;
         message = ex->GetExceptionMessage();
 
-        bool shouldThrow = (NULL == dynamic_cast<MgFdoException*>(ex));
+        bool shouldThrow = (ex->GetExceptionCode() == MgExceptionCodes::MgFdoException);
         ex->Release();
         if (shouldThrow)
         {

Modified: trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -457,10 +457,7 @@
             {
                 dstCs = m_pCSFactory->Create(srs);
             }
-            catch (MgInvalidCoordinateSystemException* e)
-            {
-                e->Release();
-            }
+            MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
         }
 
         double metersPerUnit = (dstCs.p) ? dstCs->ConvertCoordinateSystemUnitsToMeters(1.0) : 1.0;
@@ -550,7 +547,7 @@
                 arguments.Add(L"1");
                 arguments.Add(L"MgMapPlotCollection");
 
-                throw new MgInvalidArgumentException(L"MgServerMappingService.GenerateMultiPlot",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerMappingService.GenerateMultiPlot",
                     __LINE__, __WFILE__, &arguments, L"MgInvalidMapPlotCollectionMapPlotInstruction", NULL);
             }
             break;
@@ -754,10 +751,7 @@
         {
             dstCs = m_pCSFactory->Create(srs);
         }
-        catch (MgInvalidCoordinateSystemException* e)
-        {
-            e->Release();
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
     }
 
     double metersPerUnit = (dstCs.p) ? dstCs->ConvertCoordinateSystemUnitsToMeters(1.0) : 1.0;
@@ -852,7 +846,7 @@
 MgByteReader* MgServerMappingService::QueryFeatures(MgMap* map,
     CREFSTRING layerName, CREFSTRING coordinateSpace)
 {
-    throw new MgNotImplementedException(L"MgServerMappingService.QueryFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgServerMappingService.QueryFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 
@@ -895,7 +889,7 @@
     MgStringCollection* layerNames, INT32 x, INT32 y,
     INT32 maxFeatures, CREFSTRING coordinateSpace)
 {
-    throw new MgNotImplementedException(L"MgServerMappingService.QueryFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgServerMappingService.QueryFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
     return NULL;
 }
 
@@ -1231,7 +1225,7 @@
     {
         MgStringCollection args;
         args.Add(iconFormat);
-        throw new MgInvalidArgumentException(L"MgServerMappingService.DescribeRuntimeMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageFormat", &args);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerMappingService.DescribeRuntimeMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageFormat", &args);
     }
     Ptr<MgByteReader> byteReader;
 
@@ -1526,7 +1520,7 @@
     {
         MgStringCollection args;
         args.Add(iconFormat);
-        throw new MgInvalidArgumentException(L"MgServerMappingService.CreateRuntimeMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageFormat", &args);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerMappingService.CreateRuntimeMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageFormat", &args);
     }
     Ptr<MgByteReader> byteReader;
 

Modified: trunk/MgDev/Server/src/Services/Mapping/ServerMappingServiceDefs.h
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/ServerMappingServiceDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Mapping/ServerMappingServiceDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -50,7 +50,7 @@
     }                                                                       \
     catch (exception& e)                                                    \
     {                                                                       \
-        mgException = MgSystemException::Create(e, methodName, __LINE__, __WFILE__); \
+        mgException = MgException::Create(e, methodName, __LINE__, __WFILE__); \
     }                                                                       \
     catch (FdoException* e)                                                 \
     {                                                                       \
@@ -64,11 +64,12 @@
             arguments.Add(buf);                                             \
         }                                                                   \
         FDO_SAFE_RELEASE(e);                                                \
-        mgException = new MgFdoException(methodName, __LINE__, __WFILE__, NULL, messageId, &arguments, nativeErrorCode); \
+        mgException = new MgException(MgExceptionCodes::MgFdoException, methodName, __LINE__, __WFILE__, NULL, messageId, &arguments); \
+        mgException->SetNativeErrorCode(nativeErrorCode);                   \
     }                                                                       \
     catch (...)                                                             \
     {                                                                       \
-        mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+        mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
     }                                                                       \
 
 #define MG_SERVER_MAPPING_SERVICE_THROW()                                     \

Modified: trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderDynamicOverlay.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderDynamicOverlay.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderDynamicOverlay.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpProfileRenderDynamicOverlay.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpProfileRenderDynamicOverlay.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Profiling/OpProfileRenderMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -126,7 +126,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpProfileRenderMap.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpProfileRenderMap.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Profiling/ProfilingOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Profiling/ProfilingOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Profiling/ProfilingOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -68,7 +68,7 @@
             handler.reset(new MgOpProfileRenderDynamicOverlay());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgProfilingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -80,13 +80,13 @@
             handler.reset(new MgOpProfileRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgProfilingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgProfilingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -147,7 +147,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpQueryFeatureProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpQueryFeatureProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -115,7 +115,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpQueryFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpQueryFeatures.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -152,7 +152,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderDynamicOverlay.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderDynamicOverlay.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -484,7 +484,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderMap.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderMap.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMapLegend.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMapLegend.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMapLegend.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -106,7 +106,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderMapLegend.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderMapLegend.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -109,7 +109,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderMetatile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderMetatile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatileXYZ.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatileXYZ.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMetatileXYZ.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -109,7 +109,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderMetatileXYZ.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderMetatileXYZ.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderTile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderTile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderTile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -215,7 +215,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderTile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderTile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderTileFromMetatile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderTileFromMetatile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderTileFromMetatile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderTileFromMetatile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderTileFromMetatile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderTileMVT.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderTileMVT.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderTileMVT.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderTileMVT.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderTileMVT.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderTileUTFGrid.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderTileUTFGrid.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderTileUTFGrid.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderTileUTFGrid.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderTileUTFGrid.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderTileXYZ.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderTileXYZ.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderTileXYZ.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -212,7 +212,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenderTileXYZ.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenderTileXYZ.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/RenderingOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/RenderingOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/RenderingOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -68,7 +68,7 @@
             handler.reset(new MgOpRenderTile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -80,7 +80,7 @@
             handler.reset(new MgOpRenderTile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -92,7 +92,7 @@
             handler.reset(new MgOpRenderTileXYZ());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -105,7 +105,7 @@
             handler.reset(new MgOpRenderTileXYZ());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -116,7 +116,7 @@
             handler.reset(new MgOpRenderMetatile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -127,7 +127,7 @@
             handler.reset(new MgOpRenderMetatileXYZ());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -138,7 +138,7 @@
             handler.reset(new MgOpRenderTileFromMetatile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -149,7 +149,7 @@
             handler.reset(new MgOpRenderTileUTFGrid());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -160,7 +160,7 @@
             handler.reset(new MgOpRenderTileMVT());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -172,7 +172,7 @@
             handler.reset(new MgOpRenderDynamicOverlay());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -184,7 +184,7 @@
             handler.reset(new MgOpRenderDynamicOverlay());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -196,7 +196,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -208,7 +208,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -220,7 +220,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -233,7 +233,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -245,7 +245,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -256,7 +256,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -267,7 +267,7 @@
             handler.reset(new MgOpRenderMap());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -278,7 +278,7 @@
             handler.reset(new MgOpQueryFeatures());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -289,7 +289,7 @@
             handler.reset(new MgOpQueryFeatureProperties());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -300,7 +300,7 @@
             handler.reset(new MgOpQueryFeatureProperties());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -311,7 +311,7 @@
             handler.reset(new MgOpQueryFeatureProperties());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -322,13 +322,13 @@
             handler.reset(new MgOpRenderMapLegend());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgRenderingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -317,7 +317,7 @@
         arguments.Add(L"2");
         arguments.Add(baseMapLayerGroupName);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderTileUTFGrid",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderTileUTFGrid",
             __LINE__, __WFILE__, &arguments, L"MgMapLayerGroupNameNotFound", NULL);
     }
 
@@ -358,7 +358,7 @@
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (drawWidth * drawHeight > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderTileUTFGrid", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderTileUTFGrid", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // create a temporary collection containing all the layers for the base group
     Ptr<MgLayerCollection> layers = map->GetLayers();
@@ -394,10 +394,7 @@
         {
             dstCs = m_pCSFactory->Create(srs);
         }
-        catch (MgInvalidCoordinateSystemException* e)
-        {
-            e->Release();
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
     }
 
     RS_String units = dstCs.p ? dstCs->GetUnits() : L"";
@@ -470,7 +467,7 @@
         arguments.Add(L"2");
         arguments.Add(baseMapLayerGroupName);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderTileMVT",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderTileMVT",
             __LINE__, __WFILE__, &arguments, L"MgMapLayerGroupNameNotFound", NULL);
     }
 
@@ -692,23 +689,23 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderDynamicOverlay", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // compute map extent that corresponds to pixel extent
     Ptr<MgPoint> pt          = map->GetViewCenter();
@@ -887,16 +884,16 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // compute a view center and scale from the given extents
     // and pass on to the RenderMap that uses center and scale
@@ -913,7 +910,7 @@
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (drawWidth * drawHeight > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // use the supplied background color
     RS_Color bgcolor(backgroundColor->GetRed(),
@@ -1028,23 +1025,23 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderMap", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     double unitsPerPixel = METERS_PER_INCH / (double)dpi / metersPerUnit;
     double mapWidth2 = 0.5 * (double)width * unitsPerPixel * scale;
@@ -1334,10 +1331,7 @@
         {
             dstCs = m_pCSFactory->Create(srs);
         }
-        catch (MgInvalidCoordinateSystemException* e)
-        {
-            e->Release();
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgInvalidCoordinateSystemException)
     }
 
     RS_String units = dstCs.p? dstCs->GetUnits() : L"";
@@ -1450,14 +1444,14 @@
     CHECKARGUMENTNULL(backgroundColor, L"MgServerRenderingService.RenderMapLegend");
     // validate map view parameters
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (width * height > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderMapLegend", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     RS_Color bgcolor(backgroundColor->GetRed(),
                      backgroundColor->GetGreen(),
@@ -1555,7 +1549,7 @@
         arguments.Add(L"5");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection",
             __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
     }
 
@@ -1573,19 +1567,19 @@
     double metersPerUnit = map->GetMetersPerUnit();
 
     if (width <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayWidthCannotBeLessThanOrEqualToZero", NULL);
 
     if (height <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayHeightCannotBeLessThanOrEqualToZero", NULL);
 
     if (dpi <= 0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapDisplayDpiCannotBeLessThanOrEqualToZero", NULL);
 
     if (scale <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapViewScaleCannotBeLessThanOrEqualToZero", NULL);
 
     if (metersPerUnit <= 0.0)
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"MgMapMetersPerUnitCannotBeLessThanOrEqualToZero", NULL);
 
     // compute map extent that corresponds to pixel extent
     Ptr<MgPoint> pt          = map->GetViewCenter();
@@ -1915,20 +1909,26 @@
                     maxFeatures -= numFeaturesProcessed;
                 }
             }
-            catch (MgFdoException* e)
+            catch (MgException* e)
             {
-                //TODO: what should we really be doing in this case?
-                //This can happen if the underlying FDO provider does not
-                //support a particular spatial operation. One way around this
-                //is to select all features which appear on the screen and then
-                //do our own geometry math.
-                #ifdef _DEBUG
-                STRING error = e->GetExceptionMessage();
-                ACE_DEBUG((LM_INFO, ACE_TEXT("(%t) RenderForSelection() - Error: %S\n"), error.c_str()));
-                #endif
-
-                // Let's throw the exception here, so that it can be recorded in the error log.
-                throw e;
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFdoException)
+                {
+                    //TODO: what should we really be doing in this case?
+                    //This can happen if the underlying FDO provider does not
+                    //support a particular spatial operation. One way around this
+                    //is to select all features which appear on the screen and then
+                    //do our own geometry math.
+#ifdef _DEBUG
+                    STRING error = e->GetExceptionMessage();
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("(%t) RenderForSelection() - Error: %S\n"), error.c_str()));
+#endif
+                    // Let's throw the exception here, so that it can be recorded in the error log.
+                    throw e;
+                }
+                else
+                {
+                    e->Raise();
+                }
             }
         }
     }
@@ -2470,7 +2470,7 @@
 
     // if we don't find a nearest scale then something is wrong with the map
     if (scaleIndex < 0)
-        throw new MgInvalidMapDefinitionException(L"MgServerRenderingService.RenderMetatile", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgServerRenderingService.RenderMetatile", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // get the layer group associated with the name
     Ptr<MgLayerGroupCollection> layerGroups = map->GetLayerGroups();
@@ -2481,7 +2481,7 @@
         arguments.Add(L"2");
         arguments.Add(baseMapLayerGroupName);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMetatile",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMetatile",
             __LINE__, __WFILE__, &arguments, L"MgMapLayerGroupNameNotFound", NULL);
     }
 
@@ -2541,7 +2541,7 @@
         arguments.Add(L"2");
         arguments.Add(baseMapLayerGroupName);
 
-        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderMetatileXYZ",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerRenderingService.RenderMetatileXYZ",
             __LINE__, __WFILE__, &arguments, L"MgMapLayerGroupNameNotFound", NULL);
     }
 
@@ -2586,7 +2586,7 @@
 
     // sanity check - number of image pixels cannot exceed MAX_PIXELS
     if (drawWidth * drawHeight > (m_maxRenderImageHeight * m_maxRenderImageWidth))
-        throw new MgOutOfRangeException(L"MgServerRenderingService.RenderMetatileXYZ", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfRangeException, L"MgServerRenderingService.RenderMetatileXYZ", __LINE__, __WFILE__, NULL, L"MgInvalidImageSizeTooBig", NULL);
 
     // initialize the renderer (set clipping to false so that we label
     // the unclipped geometry)
@@ -2815,7 +2815,7 @@
             bs->SetMimeType(MgMimeType::Meta);
     }
     else
-        throw new MgNullReferenceException(L"MgImageProcessor.CreateImageFromRenderer", __LINE__, __WFILE__, NULL, L"MgNoDataFromRenderer", NULL);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgImageProcessor.CreateImageFromRenderer", __LINE__, __WFILE__, NULL, L"MgNoDataFromRenderer", NULL);
 
     if (NULL != pPRMResult)
     {

Modified: trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -75,7 +75,7 @@
     {
         MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-        throw new MgUnauthorizedAccessException(
+        throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
             L"MgApplicationRepositoryManager.MgApplicationRepositoryManager",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -117,7 +117,7 @@
 
     if (NULL == resourceService)
     {
-        throw new MgServiceNotAvailableException(
+        throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
             L"MgApplicationRepositoryManager.Create",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -137,7 +137,7 @@
 
     if (NULL == appResourceContentMan)
     {
-        throw new MgInvalidCastException(
+        throw new MgException(MgExceptionCodes::MgInvalidCastException, 
             L"MgApplicationResourceContentManager.GetApplicationResourceContentManager",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -186,7 +186,7 @@
 
     if (!resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.UpdateRepository",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -257,7 +257,7 @@
 
     if (!resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.GetRepositoryContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -286,7 +286,7 @@
 MgByteReader* MgApplicationRepositoryManager::GetRepositoryHeader(
     MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgApplicationRepositoryManager.GetRepositoryHeader",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -307,7 +307,7 @@
     MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
     INT32 properties, CREFSTRING fromDate, CREFSTRING toDate, bool computeChildren)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgApplicationRepositoryManager.EnumerateResources",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -336,7 +336,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.GetResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -369,7 +369,7 @@
     }
     else
     {
-        throw new MgInvalidResourcePreProcessingTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourcePreProcessingTypeException, 
             L"MgApplicationRepositoryManager.GetResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -392,7 +392,7 @@
 MgByteReader* MgApplicationRepositoryManager::GetResourceHeader(
     MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgApplicationRepositoryManager.GetResourceHeader",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -426,7 +426,7 @@
         arguments.Add(L"1");
         arguments.Add(sourceResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.MoveResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.MoveResource",
             __LINE__, __WFILE__, &arguments, L"MgInvalidResourceCannotBeRoot", NULL);
     }
 
@@ -437,7 +437,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.MoveResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.MoveResource",
             __LINE__, __WFILE__, &arguments, L"MgInvalidResourceCannotBeRoot", NULL);
     }
 
@@ -450,7 +450,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.MoveResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.MoveResource",
             __LINE__, __WFILE__, &arguments, L"MgResourceRootPathsDifferent", NULL);
     }
 
@@ -463,7 +463,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.MoveResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.MoveResource",
             __LINE__, __WFILE__, &arguments, L"MgResourceTypesDifferent", NULL);
     }
 
@@ -476,7 +476,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.MoveResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.MoveResource",
             __LINE__, __WFILE__, &arguments, L"MgResourcesIdentical", NULL);
     }
 
@@ -573,7 +573,7 @@
         arguments.Add(L"1");
         arguments.Add(sourceResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.CopyResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.CopyResource",
             __LINE__, __WFILE__, &arguments, L"MgInvalidResourceCannotBeRoot", NULL);
     }
 
@@ -584,7 +584,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.CopyResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.CopyResource",
             __LINE__, __WFILE__, &arguments, L"MgInvalidResourceCannotBeRoot", NULL);
     }
 
@@ -597,7 +597,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.CopyResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.CopyResource",
             __LINE__, __WFILE__, &arguments, L"MgResourceTypesDifferent", NULL);
     }
 
@@ -610,7 +610,7 @@
         arguments.Add(L"2");
         arguments.Add(destResource->ToString());
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.CopyResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.CopyResource",
             __LINE__, __WFILE__, &arguments, L"MgResourcesIdentical", NULL);
     }
 
@@ -816,7 +816,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.EnumerateResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -855,7 +855,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.SetResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -923,7 +923,7 @@
                 MgStringCollection arguments;
                 arguments.Add(dataName);
 
-                throw new MgDuplicateResourceDataException(
+                throw new MgException(MgExceptionCodes::MgDuplicateResourceDataException, 
                     L"MgApplicationRepositoryManager.SetResourceData",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -951,7 +951,7 @@
 
             if (!cryptoManager.IsStringEncrypted(dataValue))
             {
-                throw new MgDecryptionException(
+                throw new MgException(MgExceptionCodes::MgDecryptionException, 
                     L"MgApplicationRepositoryManager.SetResourceData",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -961,7 +961,7 @@
     }
     else
     {
-        throw new MgInvalidResourceDataTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
             L"MgApplicationRepositoryManager.SetResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -995,7 +995,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.DeleteResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1044,7 +1044,7 @@
     }
     else if (MgResourceDataType::String != dataType)
     {
-        throw new MgInvalidResourceDataTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
             L"MgApplicationRepositoryManager.DeleteResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1085,13 +1085,13 @@
         arguments.Add(L"2");
         arguments.Add(newDataName);
 
-        throw new MgInvalidArgumentException(L"MgApplicationRepositoryManager.RenameResourceData",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgApplicationRepositoryManager.RenameResourceData",
             __LINE__, __WFILE__, &arguments, L"MgFilenamesIdentical", NULL);
     }
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.RenameResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1137,7 +1137,7 @@
     }
     else
     {
-        throw new MgInvalidResourceDataTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
             L"MgApplicationRepositoryManager.RenameResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1173,7 +1173,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgApplicationRepositoryManager.RenameResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1250,7 +1250,7 @@
     }
     else
     {
-        throw new MgInvalidResourceDataTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
             L"MgApplicationRepositoryManager.GetResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1287,7 +1287,7 @@
     }
     else if (!preProcessTags.empty())
     {
-        throw new MgInvalidResourcePreProcessingTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourcePreProcessingTypeException, 
             L"MgApplicationRepositoryManager.GetResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/DbEnvironment.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/DbEnvironment.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/DbEnvironment.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -262,7 +262,7 @@
 
             if (dbName.empty())
             {
-                throw new MgNullReferenceException(L"MgDbEnvironment.ResetDatabase",
+                throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgDbEnvironment.ResetDatabase",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
 

Modified: trunk/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -114,7 +114,7 @@
 
     if (!resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgLibraryRepositoryManager.GetRepositoryHeader",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -251,7 +251,7 @@
     {
         if (0 != depth)
         {
-            throw new MgArgumentOutOfRangeException(
+            throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, 
                 L"MgLibraryRepositoryManager.EnumerateResources",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -258,7 +258,7 @@
 
         if (!type.empty() && !resource->IsResourceTypeOf(type))
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgLibraryRepositoryManager.EnumerateResources",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -268,7 +268,7 @@
 
     if (!toDate.empty() && fromDate > toDate)
     {
-        throw new MgArgumentOutOfRangeException(
+        throw new MgException(MgExceptionCodes::MgArgumentOutOfRangeException, 
             L"MgLibraryRepositoryManager.EnumerateResources",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -301,7 +301,7 @@
         CHECKARGUMENTNULL(resources, L"MgLibraryRepositoryManager.EnumerateResourceDocuments");
         if (resources->GetCount() <= 0)
         {
-            throw new MgNullArgumentException(
+            throw new MgException(MgExceptionCodes::MgNullArgumentException, 
                 L"MgLibraryRepositoryManager.EnumerateResourceDocuments",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -312,7 +312,7 @@
 
         if (MgResourceType::Folder == type)
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgLibraryRepositoryManager.EnumerateResourceDocuments",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -350,7 +350,7 @@
 
     if (resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgLibraryRepositoryManager.GetResourceHeader",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -437,7 +437,7 @@
 
     if (!resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgLibraryRepositoryManager.InheritPermissionsFrom",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/LibraryResourceContentManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/LibraryResourceContentManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/LibraryResourceContentManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -233,7 +233,7 @@
             }
             else
             {
-                throw new MgInvalidResourceDataTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
                     L"MgLibraryResourceContentManager.PackageResource",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }

Modified: trunk/MgDev/Server/src/Services/Resource/OpApplyResourcePackage.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpApplyResourcePackage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpApplyResourcePackage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpApplyResourcePackage.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpApplyResourcePackage.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpChangeResourceOwner.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpChangeResourceOwner.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpChangeResourceOwner.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpChangeResourceOwner.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpChangeResourceOwner.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpCopyResource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpCopyResource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpCopyResource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCopyResource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCopyResource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpCreateRepository.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpCreateRepository.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpCreateRepository.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCreateRepository.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCreateRepository.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpDeleteRepository.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpDeleteRepository.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpDeleteRepository.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteRepository.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteRepository.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpDeleteResource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpDeleteResource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpDeleteResource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteResource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteResource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpDeleteResourceData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpDeleteResourceData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpDeleteResourceData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteResourceData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteResourceData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentMapDefinitions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentMapDefinitions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentMapDefinitions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateParentMapDefinitions.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateParentMapDefinitions.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateParentTileSetDefinitions.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateParentTileSetDefinitions.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateRepositories.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateRepositories.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateRepositories.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateRepositories.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateRepositories.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateResourceData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateResourceData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -96,7 +96,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateResourceDocuments.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateResourceDocuments.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceReferences.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceReferences.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateResourceReferences.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateResourceReferences.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateResourceReferences.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateResources.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateResources.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateResources.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -113,7 +113,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateResources.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateResources.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -98,7 +98,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateUnmanagedData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateUnmanagedData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryContent.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryContent.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryContent.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetRepositoryContent.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetRepositoryContent.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryHeader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryHeader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetRepositoryHeader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetRepositoryHeader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetRepositoryHeader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetResourceContent.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetResourceContent.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetResourceContent.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetResourceContent.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetResourceContent.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetResourceContents.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetResourceContents.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetResourceContents.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -108,7 +108,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetResourceContents.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetResourceContents.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetResourceData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetResourceData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetResourceData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -114,7 +114,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetResourceData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetResourceData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetResourceHeader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetResourceHeader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetResourceHeader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetResourceHeader.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetResourceHeader.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpGetResourceModifiedDate.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpGetResourceModifiedDate.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpGetResourceModifiedDate.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -83,7 +83,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetResourceModifiedDate.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetResourceModifiedDate.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpInheritPermissionsFrom.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpInheritPermissionsFrom.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpInheritPermissionsFrom.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpInheritPermissionsFrom.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpInheritPermissionsFrom.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpMoveResource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpMoveResource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpMoveResource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -102,7 +102,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpMoveResource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpMoveResource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpRenameResourceData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpRenameResourceData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpRenameResourceData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenameResourceData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenameResourceData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpResourceExists.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpResourceExists.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpResourceExists.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -80,7 +80,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpResourceExists.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpResourceExists.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpSetResource.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpSetResource.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpSetResource.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetResource.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetResource.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpSetResourceData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpSetResourceData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpSetResourceData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetResourceData.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetResourceData.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OpUpdateRepository.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpUpdateRepository.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OpUpdateRepository.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,7 +92,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateRepository.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateRepository.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -66,7 +66,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgOperationInfo.MgOperationInfo",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
@@ -149,7 +149,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgParameterNotFoundException(
+        throw new MgException(MgExceptionCodes::MgParameterNotFoundException, 
             L"MgOperationInfo.GetParameter", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -175,7 +175,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgDuplicateParameterException(
+        throw new MgException(MgExceptionCodes::MgDuplicateParameterException, 
             L"MgOperationInfo.SetParameter", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }

Modified: trunk/MgDev/Server/src/Services/Resource/Repository.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/Repository.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/Repository.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
         MgStringCollection arguments;
         arguments.Add(pathname);
 
-        throw new MgRepositoryOpenFailedException(
+        throw new MgException(MgExceptionCodes::MgRepositoryOpenFailedException, 
             L"MgRepository.VerifyAccess",
             __LINE__, __WFILE__, &arguments, L"MgRepositoryAlreadyOpened", NULL);
     }
@@ -107,7 +107,7 @@
             MgUtil::Int32ToString(MG_DBXML_CURRENT_VERSION, version);
             whyArguments.Add(version);
 
-            throw new MgRepositoryOpenFailedException(
+            throw new MgException(MgExceptionCodes::MgRepositoryOpenFailedException, 
                 L"MgRepository.VerifyAccess",
                 __LINE__, __WFILE__, &whatArguments, L"MgRepositoryVersionMismatch", &whyArguments);
         }
@@ -138,7 +138,7 @@
     }
     else
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgRepository.IsTypeOf",
             __LINE__,  __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/RepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/RepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/RepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -117,7 +117,7 @@
 
     if (!m_transacted || NULL != m_dbTxn || NULL != m_xmlTxn.get())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgRepositoryManager.CreateTransaction",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -136,7 +136,7 @@
     }
     else
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgRepositoryManager.CreateTransaction",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -153,7 +153,7 @@
 {
     if (!m_transacted)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgRepositoryManager.ValidateTransaction",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -224,7 +224,7 @@
     {
         arguments.Add(resource.ToString());
 
-        throw new MgRepositoryNotFoundException(
+        throw new MgException(MgExceptionCodes::MgRepositoryNotFoundException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::User))
@@ -231,7 +231,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgUserNotFoundException(
+        throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::Group))
@@ -238,7 +238,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgGroupNotFoundException(
+        throw new MgException(MgExceptionCodes::MgGroupNotFoundException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::Role))
@@ -245,7 +245,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgRoleNotFoundException(
+        throw new MgException(MgExceptionCodes::MgRoleNotFoundException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else
@@ -252,7 +252,7 @@
     {
         arguments.Add(resource.ToString());
 
-        throw new MgResourceNotFoundException(
+        throw new MgException(MgExceptionCodes::MgResourceNotFoundException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
 }
@@ -280,7 +280,7 @@
     {
         arguments.Add(resource.ToString());
 
-        throw new MgDuplicateRepositoryException(
+        throw new MgException(MgExceptionCodes::MgDuplicateRepositoryException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::User))
@@ -287,7 +287,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgDuplicateUserException(
+        throw new MgException(MgExceptionCodes::MgDuplicateUserException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::Group))
@@ -294,7 +294,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgDuplicateGroupException(
+        throw new MgException(MgExceptionCodes::MgDuplicateGroupException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else if (resource.IsResourceTypeOf(MgResourceType::Role))
@@ -301,7 +301,7 @@
     {
         arguments.Add(resource.GetName());
 
-        throw new MgDuplicateRoleException(
+        throw new MgException(MgExceptionCodes::MgDuplicateRoleException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
     else
@@ -308,7 +308,7 @@
     {
         arguments.Add(resource.ToString());
 
-        throw new MgDuplicateResourceException(
+        throw new MgException(MgExceptionCodes::MgDuplicateResourceException, 
             methodName, lineNumber, fileName, &arguments, L"", NULL);
     }
 }
@@ -325,7 +325,7 @@
 
 MgByteReader* MgRepositoryManager::EnumerateRepositories()
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgRepositoryManager.EnumerateRepositories",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -353,7 +353,7 @@
 
     if (!resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgRepositoryManager.CreateRepository", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -382,7 +382,7 @@
         arguments.Add(L"3");
         arguments.Add(L"MgByteReader");
 
-        throw new MgInvalidArgumentException(L"MgRepositoryManager.CreateRepository",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgRepositoryManager.CreateRepository",
             __LINE__, __WFILE__, &arguments, L"MgHeaderDocumentNotEmpty", NULL);
     }
 
@@ -414,7 +414,7 @@
 
 void MgRepositoryManager::DeleteRepository(MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgRepositoryManager.DeleteRepository",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
@@ -442,7 +442,7 @@
     {
         if (resource->IsRoot())
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgRepositoryManager.AddResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -452,7 +452,7 @@
             arguments.Add(L"2");
             arguments.Add(L"MgByteReader");
 
-            throw new MgInvalidArgumentException(L"MgRepositoryManager.AddResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgRepositoryManager.AddResource",
                 __LINE__, __WFILE__, &arguments, L"MgContentNotNull", NULL);
         }
     }
@@ -487,7 +487,7 @@
         arguments.Add(L"3");
         arguments.Add(L"MgByteReader");
 
-        throw new MgInvalidArgumentException(L"MgRepositoryManager.AddResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgRepositoryManager.AddResource",
             __LINE__, __WFILE__, &arguments, L"MgHeaderDocumentNotEmpty", NULL);
     }
 
@@ -501,7 +501,7 @@
         MgStringCollection arguments;
         arguments.Add(resource->GetRootPath());
 
-        throw new MgRepositoryNotFoundException(
+        throw new MgException(MgExceptionCodes::MgRepositoryNotFoundException, 
             L"MgRepositoryManager.AddResource",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -525,7 +525,7 @@
         arguments.Add(L"2");
         arguments.Add(L"MgByteReader");
 
-        throw new MgInvalidArgumentException(L"MgRepositoryManager.AddResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgRepositoryManager.AddResource",
             __LINE__, __WFILE__, &arguments, L"MgContentDocumentNotEmpty", NULL);
     }
 
@@ -618,7 +618,7 @@
     {
         if (resource->IsRoot())
         {
-            throw new MgInvalidResourceTypeException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
                 L"MgRepositoryManager.UpdateResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -628,7 +628,7 @@
             arguments.Add(L"2");
             arguments.Add(L"MgByteReader");
 
-            throw new MgInvalidArgumentException(L"MgRepositoryManager.UpdateResource",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgRepositoryManager.UpdateResource",
                 __LINE__, __WFILE__, &arguments, L"MgContentNotNull", NULL);
         }
 
@@ -638,7 +638,7 @@
     {
         if (NULL == content && NULL == header)
         {
-            throw new MgNullArgumentException(
+            throw new MgException(MgExceptionCodes::MgNullArgumentException, 
                 L"MgRepositoryManager.UpdateResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
@@ -693,7 +693,7 @@
 ///
 void MgRepositoryManager::DeleteResourceData(CREFSTRING resourceTags, MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgRepositoryManager.DeleteResourceData",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
@@ -706,7 +706,7 @@
 void MgRepositoryManager::CopyResourceData(CREFSTRING sourceResourceTags,
     REFSTRING destResourceTags, bool overwrite)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgRepositoryManager.CopyResourceData",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceContentManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceContentManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceContentManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
 
 MgByteReader* MgResourceContentManager::EnumerateRepositories()
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgResourceContentManager.EnumerateRepositories",
         __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -547,7 +547,7 @@
     if (!valid)
     {
         // TODO: Throw a more specific exception?
-        throw new MgXmlParserException(L"MgResourceContentManager.ValidateDocument",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgResourceContentManager.ValidateDocument",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceDataFileManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceDataFileManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceDataFileManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -43,7 +43,7 @@
         arguments.Add(L"1");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgResourceDataFileManager.MgResourceDataFileManager",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgResourceDataFileManager.MgResourceDataFileManager",
             __LINE__, __WFILE__, &arguments, L"MgResourceDataFilePathEmpty", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceDataStreamManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceDataStreamManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceDataStreamManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -79,7 +79,7 @@
     CHECKNULL(dataBuffer, L"MgResourceDataStreamManager.SetResourceData");
     if (0 == dataSize)
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgResourceDataStreamManager.SetResourceData",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -133,7 +133,7 @@
         MgStringCollection arguments;
         arguments.Add(dataName);
 
-        throw new MgResourceDataNotFoundException(
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, 
             L"MgResourceDataStreamManager.DeleteResourceData",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -186,7 +186,7 @@
         MgStringCollection arguments;
         arguments.Add(dataName);
 
-        throw new MgResourceDataNotFoundException(
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, 
             L"MgResourceDataStreamManager.CopyResourceData",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -241,7 +241,7 @@
         MgStringCollection arguments;
         arguments.Add(dataName);
 
-        throw new MgResourceDataNotFoundException(
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, 
             L"MgResourceDataStreamManager.GetResourceData",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -72,7 +72,7 @@
 
 void MgResourceDefinitionManager::DeleteRepository(MgResourceIdentifier* resource)
 {
-    throw new MgNotImplementedException(
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, 
         L"MgResourceDefinitionManager.DeleteRepository",
         __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceHeader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceHeader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceHeader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,7 +63,7 @@
 
     if (NULL != m_xmlUtil.get() || NULL != m_resourceInfo.get())
     {
-        throw new MgInvalidOperationException(L"MgResourceHeader.Initialize",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgResourceHeader.Initialize",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -174,7 +174,7 @@
 {
     if (NULL == m_resourceInfo.get())
     {
-        throw new MgNullReferenceException(L"MgResourceHeader.GetResourceInfo",
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgResourceHeader.GetResourceInfo",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -277,7 +277,7 @@
                 MgStringCollection arguments;
                 arguments.Add(wcParentId);
 
-                throw new MgResourceNotFoundException(
+                throw new MgException(MgExceptionCodes::MgResourceNotFoundException, 
                     L"MgResourceHeader.GetDocument",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -305,7 +305,7 @@
     }
     else
     {
-        throw new MgXmlParserException(L"MgResourceHeader.GetDocument",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgResourceHeader.GetDocument",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -326,7 +326,7 @@
 {
     if (NULL == m_xmlUtil.get() || NULL == m_resourceInfo.get())
     {
-        throw new MgNullReferenceException(
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, 
             L"MgResourceHeader.CheckInitialization", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -347,7 +347,7 @@
 
     if (!IsFilteredOn(MgResourceHeaderProperties::Security))
     {
-        throw new MgInvalidOperationException(L"MgResourceHeader.GetSecurity",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgResourceHeader.GetSecurity",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -374,7 +374,7 @@
 
     if (!IsFilteredOn(MgResourceHeaderProperties::Security))
     {
-        throw new MgInvalidOperationException(L"MgResourceHeader.SetSecurity",
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgResourceHeader.SetSecurity",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -595,7 +595,7 @@
             MgStringCollection arguments;
             arguments.Add(resource.ToString());
 
-            throw new MgInvalidResourceNameException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceNameException, 
                 L"MgResourceHeaderManager.AddParentResources",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -988,7 +988,7 @@
     else
     {
         // TODO: Throw a more specific exception?
-        throw new MgXmlParserException(
+        throw new MgException(MgExceptionCodes::MgXmlParserException, 
             L"MgResourceHeaderManager.GetResourceModifiedDate",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1129,7 +1129,7 @@
         MgStringCollection arguments;
         arguments.Add(owner);
 
-        throw new MgUserNotFoundException(
+        throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
             L"MgResourceHeaderManager.ChangeResourceOwner",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -1253,7 +1253,7 @@
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
 
-            throw new MgPermissionDeniedException(
+            throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
                 L"MgResourceHeaderManager.ChangeResourceOwner",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1383,7 +1383,7 @@
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
 
-            throw new MgPermissionDeniedException(
+            throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
                 L"MgResourceHeaderManager.InheritPermissionsFrom",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1571,7 +1571,7 @@
     else
     {
         // TODO: Throw a more specific exception?
-        throw new MgXmlParserException(
+        throw new MgException(MgExceptionCodes::MgXmlParserException, 
             L"MgResourceHeaderManager.CreatePermissionInfo",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1590,7 +1590,7 @@
     }
     else
     {
-        throw new MgXmlParserException(
+        throw new MgException(MgExceptionCodes::MgXmlParserException, 
             L"MgResourceHeaderManager.CreatePermissionInfo",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1608,7 +1608,7 @@
 
         if (nameResults.size() != permissionResults.size())
         {
-            throw new MgXmlParserException(
+            throw new MgException(MgExceptionCodes::MgXmlParserException, 
                 L"MgResourceHeaderManager.CreatePermissionInfo",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1631,7 +1631,7 @@
 
         if (nameResults.size() != permissionResults.size())
         {
-            throw new MgXmlParserException(
+            throw new MgException(MgExceptionCodes::MgXmlParserException, 
                 L"MgResourceHeaderManager.CreatePermissionInfo",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1726,7 +1726,7 @@
             MgStringCollection arguments;
             arguments.Add(resource.ToString());
 
-            throw new MgInvalidResourceNameException(
+            throw new MgException(MgExceptionCodes::MgInvalidResourceNameException, 
                 L"MgResourceHeaderManager.GetParentResources",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -2347,7 +2347,7 @@
         MgStringCollection arguments;
         arguments.Add(MgUtil::MultiByteToWideChar(xmlDoc.getName()));
 
-        throw new MgPermissionDeniedException(
+        throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
             L"MgResourceHeaderManager.CheckOwnership",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -2446,7 +2446,7 @@
         {
             MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-            throw new MgUnauthorizedAccessException(
+            throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
                 L"MgResourceHeaderManager.CheckPermission",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -2548,7 +2548,7 @@
                         MgStringCollection arguments;
                         arguments.Add(currPathname);
 
-                        throw new MgPermissionDeniedException(
+                        throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
                             L"MgResourceHeaderManager.CheckPermission",
                             __LINE__, __WFILE__, &arguments, L"", NULL);
                     }
@@ -2603,7 +2603,7 @@
                     MgStringCollection arguments;
                     arguments.Add(currPathname);
 
-                    throw new MgPermissionDeniedException(
+                    throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
                         L"MgResourceHeaderManager.CheckPermission",
                         __LINE__, __WFILE__, &arguments, L"", NULL);
                 }
@@ -2675,7 +2675,7 @@
     if (!valid)
     {
         // TODO: Throw a more specific exception?
-        throw new MgXmlParserException(L"MgResourceHeaderManager.ValidateDocument",
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgResourceHeaderManager.ValidateDocument",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -107,7 +107,7 @@
             handler.reset(new MgOpEnumerateRepositories());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -119,7 +119,7 @@
             handler.reset(new MgOpCreateRepository());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -131,7 +131,7 @@
             handler.reset(new MgOpDeleteRepository());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -143,7 +143,7 @@
             handler.reset(new MgOpUpdateRepository());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -155,7 +155,7 @@
             handler.reset(new MgOpGetRepositoryContent());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -167,7 +167,7 @@
             handler.reset(new MgOpGetRepositoryHeader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -179,7 +179,7 @@
             handler.reset(new MgOpApplyResourcePackage());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -191,7 +191,7 @@
             handler.reset(new MgOpResourceExists());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -203,7 +203,7 @@
             handler.reset(new MgOpEnumerateResources());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -215,7 +215,7 @@
             handler.reset(new MgOpEnumerateResourceDocuments());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -227,7 +227,7 @@
             handler.reset(new MgOpSetResource());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -239,7 +239,7 @@
             handler.reset(new MgOpDeleteResource());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -252,7 +252,7 @@
             handler.reset(new MgOpMoveResource());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -264,7 +264,7 @@
             handler.reset(new MgOpCopyResource());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -276,7 +276,7 @@
             handler.reset(new MgOpGetResourceContent());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -288,7 +288,7 @@
             handler.reset(new MgOpGetResourceContents());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -300,7 +300,7 @@
             handler.reset(new MgOpGetResourceHeader());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -312,7 +312,7 @@
             handler.reset(new MgOpGetResourceModifiedDate());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -324,7 +324,7 @@
             handler.reset(new MgOpEnumerateResourceReferences());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -336,7 +336,7 @@
             handler.reset(new MgOpEnumerateParentMapDefinitions());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -348,7 +348,7 @@
             handler.reset(new MgOpEnumerateParentTileSetDefinitions());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -360,7 +360,7 @@
             handler.reset(new MgOpChangeResourceOwner());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -372,7 +372,7 @@
             handler.reset(new MgOpInheritPermissionsFrom());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -384,7 +384,7 @@
             handler.reset(new MgOpEnumerateResourceData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -396,7 +396,7 @@
             handler.reset(new MgOpSetResourceData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -408,7 +408,7 @@
             handler.reset(new MgOpDeleteResourceData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -420,7 +420,7 @@
             handler.reset(new MgOpRenameResourceData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -432,7 +432,7 @@
             handler.reset(new MgOpGetResourceData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -444,13 +444,13 @@
             handler.reset(new MgOpEnumerateUnmanagedData());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ResourcePackageLoader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourcePackageLoader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourcePackageLoader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -58,7 +58,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgResourcePackageLoader.CreateResourceIdentifier",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/ResourcePackageMaker.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourcePackageMaker.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourcePackageMaker.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -55,7 +55,7 @@
 
     if (!resource.IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgResourcePackageMaker.GeneratePathnames",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -56,8 +56,8 @@
         }                                                                     \
                                                                               \
         arguments.Add(message);                                               \
-        mgException = new MgDbXmlException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
-        (static_cast<MgThirdPartyException*>(mgException.p))->SetErrorCode(e.getDbErrno()); \
+        mgException = new MgException(MgExceptionCodes::MgDbXmlException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException->SetNativeErrorCode(e.getDbErrno());                      \
     }                                                                         \
     catch (DbException& e)                                                    \
     {                                                                         \
@@ -75,20 +75,20 @@
         }                                                                     \
                                                                               \
         arguments.Add(message);                                               \
-        mgException = new MgDbException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
-        (static_cast<MgThirdPartyException*>(mgException.p))->SetErrorCode(e.get_errno()); \
+        mgException = new MgException(MgExceptionCodes::MgDbException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException->SetNativeErrorCode(e.get_errno()); \
     }                                                                      \
     catch (const XMLException& e)                                             \
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(X2W(e.getMessage()));                                   \
-        mgException = new MgXmlParserException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgXmlParserException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
     }                                                                         \
     catch (const DOMException& e)                                             \
     {                                                                         \
         MgStringCollection arguments;                                         \
         arguments.Add(X2W(e.msg));                                            \
-        mgException = new MgXmlParserException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
+        mgException = new MgException(MgExceptionCodes::MgXmlParserException, methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
                                                                               \
     MG_CATCH(methodName)                                                      \
 

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -74,8 +74,8 @@
             {                                                                 \
                 ++numRetries;                                                 \
                                                                               \
-                if ((e->IsOfClass(MapGuide_Exception_MgDbXmlException) || e->IsOfClass(MapGuide_Exception_MgDbException)) \
-                 && (DB_LOCK_DEADLOCK == (static_cast<MgThirdPartyException*>(e))->GetErrorCode())) \
+                if ((e->GetExceptionCode() == MgExceptionCodes::MgDbXmlException || e->GetExceptionCode() == MgExceptionCodes::MgDbException) \
+                    && DB_LOCK_DEADLOCK == e->GetNativeErrorCode())           \
                 {                                                             \
                     if (numRetries < maxRetries)                              \
                     {                                                         \
@@ -279,7 +279,7 @@
 
     if (MgRepositoryType::Session != repositoryType)
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.EnumerateRepositories",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -332,7 +332,7 @@
             {
                 MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-                throw new MgUnauthorizedAccessException(
+                throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
                     L"MgServerResourceService.EnumerateRepositories",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -341,7 +341,7 @@
             {
                 MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-                throw new MgUnauthorizedAccessException(
+                throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
                     L"MgServerResourceService.EnumerateRepositories",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -408,7 +408,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Session))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.CreateRepository", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -464,7 +464,7 @@
         {
             MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-            throw new MgUnauthorizedAccessException(
+            throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
                 L"MgServerResourceService.CreateRepository",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -483,7 +483,7 @@
                 MgStringCollection arguments;
                 arguments.Add(resource->ToString());
 
-                throw new MgRepositoryCreationFailedException(
+                throw new MgException(MgExceptionCodes::MgRepositoryCreationFailedException, 
                     L"MgServerResourceService.CreateRepository", __LINE__, __WFILE__, &arguments, L"", NULL);
             }
 
@@ -529,7 +529,7 @@
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
 
-            throw new MgDuplicateRepositoryException(
+            throw new MgException(MgExceptionCodes::MgDuplicateRepositoryException, 
                 L"MgServerResourceService.CreateRepository", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
     }
@@ -559,7 +559,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Session))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.DeleteRepository", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -585,7 +585,7 @@
     {
         MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-        throw new MgUnauthorizedAccessException(
+        throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
             L"MgServerResourceService.CreateRepository",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -637,7 +637,7 @@
             MgStringCollection arguments;
             arguments.Add(name);
 
-            throw new MgRepositoryNotFoundException(
+            throw new MgException(MgExceptionCodes::MgRepositoryNotFoundException, 
                 L"MgServerResourceService.DeleteRepository",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -666,7 +666,7 @@
     CHECKARGUMENTNULL(resource, L"MgServerResourceService.UpdateRepository");
     if ((NULL == content && NULL == header))
     {
-        throw new MgNullArgumentException(
+        throw new MgException(MgExceptionCodes::MgNullArgumentException, 
             L"MgServerResourceService.UpdateRepository", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -757,7 +757,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.GetRepositoryHeader",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -831,7 +831,7 @@
         MgStringCollection arguments;
         arguments.Add(packagePathname);
 
-        throw new MgFileNotFoundException(
+        throw new MgException(MgExceptionCodes::MgFileNotFoundException, 
             L"MgServerResourceService.LoadResourcePackage",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
@@ -867,7 +867,7 @@
 
     if (!resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgServerResourceService.MakeResourcePackage",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -874,7 +874,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.MakeResourcePackage",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -945,7 +945,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.EnumerateResources",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1180,7 +1180,7 @@
     bool hasPreprocess = (NULL != preProcessTags);
     if(hasPreprocess && resources->GetCount() != preProcessTags->GetCount())
     {
-        throw new MgInvalidArgumentException(
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, 
             L"MgServerResourceService.GetResourceContents", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1237,7 +1237,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.GetResourceHeader", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -1284,7 +1284,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.GetResourceModifiedDate",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1369,7 +1369,7 @@
 
         if (NULL == resource)
         {
-            throw new MgInvalidCastException(
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, 
                 L"MgServerResourceService.EnumerateParentMapDefinitions",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1389,7 +1389,7 @@
             }
             else
             {
-                throw new MgInvalidRepositoryTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
                     L"MgServerResourceService.EnumerateParentMapDefinitions",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -1493,7 +1493,7 @@
 
         if (NULL == resource)
         {
-            throw new MgInvalidCastException(
+            throw new MgException(MgExceptionCodes::MgInvalidCastException, 
                 L"MgServerResourceService.EnumerateParentTileSetDefinitions",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1513,7 +1513,7 @@
             }
             else
             {
-                throw new MgInvalidRepositoryTypeException(
+                throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
                     L"MgServerResourceService.EnumerateParentTileSetDefinitions",
                     __LINE__, __WFILE__, NULL, L"", NULL);
             }
@@ -1638,7 +1638,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.ChangeResourceOwner",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1677,7 +1677,7 @@
 
     if (!resource->IsRepositoryTypeOf(MgRepositoryType::Library))
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.InheritPermissionsFrom",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1946,7 +1946,7 @@
                 MgStringCollection arguments;
                 arguments.Add(name);
 
-                throw new MgRepositoryNotFoundException(
+                throw new MgException(MgExceptionCodes::MgRepositoryNotFoundException, 
                     L"MgServerResourceService.CreateApplicationRepositoryManager",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
@@ -1954,7 +1954,7 @@
     }
     else
     {
-        throw new MgInvalidRepositoryTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidRepositoryTypeException, 
             L"MgServerResourceService.CreateApplicationRepositoryManager",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/SessionRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/SessionRepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/SessionRepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -71,7 +71,7 @@
     {
         MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-        throw new MgUnauthorizedAccessException(
+        throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
             L"MgSessionRepositoryManager.EnumerateRepositories",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -105,7 +105,7 @@
 
     if (!resource->IsRoot())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgSessionRepositoryManager.DeleteRepository",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/SessionResourceContentManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/SessionResourceContentManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/SessionResourceContentManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -230,7 +230,7 @@
         MgStringCollection arguments;
         arguments.Add(resource.ToString());
 
-        throw new MgPermissionDeniedException(
+        throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
             L"MgSessionResourceContentManager.CheckPermission",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -200,7 +200,7 @@
         arguments.Add(L"2");
         arguments.Add(role);
 
-        throw new MgInvalidArgumentException(L"MgSiteRepositoryManager.EnumerateUsers",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSiteRepositoryManager.EnumerateUsers",
             __LINE__, __WFILE__, &arguments, L"MgGroupAndRoleNotEmpty", NULL);
     }
 
@@ -229,7 +229,7 @@
         {
             MG_LOG_AUTHENTICATION_ENTRY(MgResources::UnauthorizedAccess.c_str());
 
-            throw new MgUnauthorizedAccessException(
+            throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, 
                 L"MgSiteRepositoryManager.EnumerateUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -333,7 +333,7 @@
         arguments.Add(L"2");
         arguments.Add(role);
 
-        throw new MgInvalidArgumentException(L"MgSiteRepositoryManager.EnumerateGroups",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSiteRepositoryManager.EnumerateGroups",
             __LINE__, __WFILE__, &arguments, L"MgUserAndRoleNotEmpty", NULL);
     }
 
@@ -474,7 +474,7 @@
         arguments.Add(L"2");
         arguments.Add(group);
 
-        throw new MgInvalidArgumentException(L"MgSiteRepositoryManager.EnumerateRoles",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgSiteRepositoryManager.EnumerateRoles",
             __LINE__, __WFILE__, &arguments, L"MgUserAndGroupNotEmpty", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -544,7 +544,7 @@
 
         if (MgSecurityManager::IsSystemUser(id))
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.DeleteUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -559,7 +559,7 @@
             MgStringCollection arguments;
             arguments.Add(id);
 
-            throw new MgUserNotFoundException(
+            throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
                 L"MgSiteResourceContentManager.DeleteUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -606,7 +606,7 @@
         // Disallow changing the system user IDs.
         if (MgSecurityManager::IsSystemUser(userId))
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.UpdateUser",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -623,7 +623,7 @@
     // Disallow changing the Anonymous user's blank password.
     if (!newPassword.empty() && MgUser::Anonymous == userId)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.UpdateUser",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -959,7 +959,7 @@
 
     if (MgGroup::Everyone == group)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.AddGroup",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1025,7 +1025,7 @@
 
         if (MgGroup::Everyone == id)
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.DeleteGroups",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1040,7 +1040,7 @@
             MgStringCollection arguments;
             arguments.Add(id);
 
-            throw new MgGroupNotFoundException(
+            throw new MgException(MgExceptionCodes::MgGroupNotFoundException, 
                 L"MgSiteResourceContentManager.DeleteGroups",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1078,7 +1078,7 @@
 
     if (MgGroup::Everyone == group || MgGroup::Everyone == newGroup)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.UpdateGroup",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -1165,7 +1165,7 @@
             MgStringCollection arguments;
             arguments.Add(userRes.GetName());
 
-            throw new MgUserNotFoundException(
+            throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
                 L"MgSiteResourceContentManager.GrantGroupMembershipsToUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1191,7 +1191,7 @@
 
         if (MgGroup::Everyone == groupRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.GrantGroupMembershipsToUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1211,7 +1211,7 @@
             // Users node must exist according to the schema.
             // Should not reach here as XML validation is performed when adding
             // a resource.
-            throw new MgXmlParserException(
+            throw new MgException(MgExceptionCodes::MgXmlParserException, 
                 L"MgSiteResourceContentManager.GrantGroupMembershipsToUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1310,7 +1310,7 @@
             MgStringCollection arguments;
             arguments.Add(userRes.GetName());
 
-            throw new MgUserNotFoundException(
+            throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeGroupMembershipsFromUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1330,7 +1330,7 @@
 
         if (MgGroup::Everyone == groupRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.RevokeGroupMembershipsFromUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1340,7 +1340,7 @@
             MgStringCollection arguments;
             arguments.Add(groupRes.GetName());
 
-            throw new MgGroupNotFoundException(
+            throw new MgException(MgExceptionCodes::MgGroupNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeGroupMembershipsFromUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1555,7 +1555,7 @@
             MgStringCollection arguments;
             arguments.Add(userRes.GetName());
 
-            throw new MgUserNotFoundException(
+            throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1581,7 +1581,7 @@
 
         if (MgRole::Viewer == roleRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1601,7 +1601,7 @@
             // Users node must exist according to the schema.
             // Should not reach here as XML validation is performed when adding
             // a resource.
-            throw new MgXmlParserException(
+            throw new MgException(MgExceptionCodes::MgXmlParserException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1700,7 +1700,7 @@
             MgStringCollection arguments;
             arguments.Add(userRes.GetName());
 
-            throw new MgUserNotFoundException(
+            throw new MgException(MgExceptionCodes::MgUserNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1720,7 +1720,7 @@
 
         if (MgRole::Viewer == roleRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromUsers",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1730,7 +1730,7 @@
             MgStringCollection arguments;
             arguments.Add(roleRes.GetName());
 
-            throw new MgRoleNotFoundException(
+            throw new MgException(MgExceptionCodes::MgRoleNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromUsers",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1787,7 +1787,7 @@
             MgStringCollection arguments;
             arguments.Add(groupRes.GetName());
 
-            throw new MgGroupNotFoundException(
+            throw new MgException(MgExceptionCodes::MgGroupNotFoundException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToGroups",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1813,7 +1813,7 @@
 
         if (MgRole::Viewer == roleRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToGroups",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1833,7 +1833,7 @@
             // Groups node must exist according to the schema.
             // Should not reach here as XML validation is performed when adding
             // a resource.
-            throw new MgXmlParserException(
+            throw new MgException(MgExceptionCodes::MgXmlParserException, 
                 L"MgSiteResourceContentManager.GrantRoleMembershipsToGroups",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1941,7 +1941,7 @@
             MgStringCollection arguments;
             arguments.Add(groupRes.GetName());
 
-            throw new MgGroupNotFoundException(
+            throw new MgException(MgExceptionCodes::MgGroupNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromGroups",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -1961,7 +1961,7 @@
 
         if (MgRole::Viewer == roleRes.GetName())
         {
-            throw new MgInvalidOperationException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromGroups",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -1971,7 +1971,7 @@
             MgStringCollection arguments;
             arguments.Add(roleRes.GetName());
 
-            throw new MgRoleNotFoundException(
+            throw new MgException(MgExceptionCodes::MgRoleNotFoundException, 
                 L"MgSiteResourceContentManager.RevokeRoleMembershipsFromGroups",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
@@ -2012,7 +2012,7 @@
 
     if (MgGroup::Everyone == groupRes->GetName())
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.RemoveUserFromGroup",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -2126,7 +2126,7 @@
     if ((MgRole::Administrator == roleRes->GetName() && MgUser::Administrator == userId)
      || (MgRole::Author        == roleRes->GetName() && MgUser::Author        == userId))
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.RemoveUserFromRole",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -2240,7 +2240,7 @@
 
     if (MgRole::Viewer == roleRes->GetName() && MgGroup::Everyone == groupId)
     {
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgSiteResourceContentManager.RemoveGroupFromRole",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/SystemRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/SystemRepositoryManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/SystemRepositoryManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -67,7 +67,7 @@
 
     if (resource->IsFolder())
     {
-        throw new MgInvalidResourceTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceTypeException, 
             L"MgSystemRepositoryManager.GetResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -82,7 +82,7 @@
     }
     else
     {
-        throw new MgInvalidResourcePreProcessingTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourcePreProcessingTypeException, 
             L"MgSystemRepositoryManager.GetResourceContent",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/TagManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/TagManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/TagManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,7 +92,7 @@
         arguments.Add(L"1");
         arguments.Add(str);
 
-        throw new MgInvalidArgumentException(L"MgTagManager.CheckTagString",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgTagManager.CheckTagString",
             __LINE__, __WFILE__, &arguments, L"MgStringTooLong", NULL);
     }
 
@@ -105,7 +105,7 @@
         MgStringCollection whyArguments;
         whyArguments.Add(MgTagReservedCharacterSet);
 
-        throw new MgInvalidArgumentException(L"MgTagManager.CheckTagString",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgTagManager.CheckTagString",
             __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
     }
 }
@@ -127,7 +127,7 @@
         MgStringCollection arguments;
         arguments.Add(tag);
 
-        throw new MgResourceTagNotFoundException(L"MgTagManager.CheckTagString",
+        throw new MgException(MgExceptionCodes::MgResourceTagNotFoundException, L"MgTagManager.CheckTagString",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }
@@ -170,7 +170,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgInvalidResourceDataNameException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataNameException, 
             L"MgTagManager.ValidateTag", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -179,7 +179,7 @@
         || (MgResourceDataType::String == type
                 && ((MgResourceDataName::UserCredentials != name) && (MgResourceDataName::ProxyServerName != name) && (MgResourceDataName::ProxyServerPort != name) && (MgResourceDataName::ProxyCredentials != name))))
     {
-        throw new MgInvalidResourceDataTypeException(
+        throw new MgException(MgExceptionCodes::MgInvalidResourceDataTypeException, 
             L"MgTagManager.ValidateTag", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
@@ -231,7 +231,7 @@
                 arguments.Add(L"1");
                 arguments.Add(tags);
 
-                throw new MgInvalidArgumentException(L"MgTagManager.ParseTags",
+                throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgTagManager.ParseTags",
                     __LINE__, __WFILE__, &arguments, L"MgTagFieldNotFound", NULL);
             }
             else if (fieldCount < MAX_RESOURCE_TAG_ATTRIBUTE_NUMBER)
@@ -408,7 +408,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgResourceDataNotFoundException(L"MgTagManager.GetTag",
+        throw new MgException(MgExceptionCodes::MgResourceDataNotFoundException, L"MgTagManager.GetTag",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
@@ -442,7 +442,7 @@
             MgStringCollection arguments;
             arguments.Add(name);
 
-            throw new MgDuplicateResourceDataException(L"MgTagManager.SetTag",
+            throw new MgException(MgExceptionCodes::MgDuplicateResourceDataException, L"MgTagManager.SetTag",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
@@ -478,7 +478,7 @@
         MgStringCollection arguments;
         arguments.Add(name);
 
-        throw new MgDuplicateResourceDataException(L"MgTagManager.AddTag",
+        throw new MgException(MgExceptionCodes::MgDuplicateResourceDataException, L"MgTagManager.AddTag",
             __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -72,7 +72,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(filePath);
-        throw new MgInvalidDwfPackageException(L"MgZipFileReader.MgZipFileReader", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileReader.MgZipFileReader", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 }
 
@@ -88,7 +88,7 @@
 #ifdef _DEBUG
         if (r != UNZ_OK)
         {
-            throw new MgInvalidDwfPackageException(L"MgZipFileReader.~MgZipFileReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileReader.~MgZipFileReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #endif
     }
@@ -112,7 +112,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(filePath);
-        throw new MgInvalidDwfPackageException(L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     int err = UNZ_OK;
@@ -122,7 +122,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(filePath);
-        throw new MgInvalidDwfPackageException(L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
     }
 
     MgByteSourceUnzipImpl* impl = new MgByteSourceUnzipImpl(file_info, m_unzip);

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,7 +92,7 @@
     m_zip = zipOpen(mbFilePath.c_str(), 0);
     if (!m_zip)
     {
-        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileWriter.MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }
 
@@ -108,7 +108,7 @@
 #ifdef _DEBUG
         if (r != ZIP_OK)
         {
-            throw new MgInvalidDwfPackageException(L"MgZipFileWriter.~MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileWriter.~MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 #endif
     }
@@ -156,7 +156,7 @@
 
     if (err != ZIP_OK)
     {
-        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     const INT32 length = 4096;
@@ -168,7 +168,7 @@
         err = zipWriteInFileInZip(m_zip, buffer, numBytes);
         if (err < 0)
         {
-            throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     } while ((err == ZIP_OK) && (numBytes > 0));
 
@@ -175,7 +175,7 @@
     err = zipCloseFileInZip(m_zip);
     if (err != ZIP_OK)
     {
-        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidDwfPackageException, L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_RESOURCE_SERVICE_CATCH(L"MgZipFileWriter.AddArchive")

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpBringOnline.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpBringOnline.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpBringOnline.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -84,7 +84,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpBringOnline.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpBringOnline.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpClearLog.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpClearLog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpClearLog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpClearLog.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpClearLog.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpDeleteLog.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpDeleteLog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpDeleteLog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteLog.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteLog.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpDeletePackage.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpDeletePackage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpDeletePackage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeletePackage.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeletePackage.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpEnableMaximumLogSize.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpEnableMaximumLogSize.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpEnableMaximumLogSize.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnableMaximumLogSize.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnableMaximumLogSize.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumerateLogs.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumerateLogs.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumerateLogs.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -84,7 +84,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateLogs.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateLogs.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumeratePackages.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumeratePackages.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpEnumeratePackages.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -84,7 +84,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumeratePackages.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumeratePackages.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetConfigurationProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetConfigurationProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetConfigurationProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetConfigurationProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetConfigurationProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetDocument.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetDocument.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetDocument.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetDocument.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetDocument.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetInformationProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetInformationProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLog.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -151,7 +151,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetLog.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetLog.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLogFile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLogFile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetLogFile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetLogFile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetLogFile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageLog.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageLog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageLog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetPackageLog.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetPackageLog.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageStatus.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageStatus.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetPackageStatus.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetPackageStatus.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetPackageStatus.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSiteStatus.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSiteStatus.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSiteVersion.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSiteVersion.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpIsMaximumLogSizeEnabled.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpIsMaximumLogSizeEnabled.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpIsMaximumLogSizeEnabled.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpIsMaximumLogSizeEnabled.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpIsMaximumLogSizeEnabled.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpIsOnline.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpIsOnline.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpIsOnline.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -94,7 +94,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpIsOnline.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpIsOnline.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpLoadPackage.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpLoadPackage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpLoadPackage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -88,7 +88,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpLoadPackage.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpLoadPackage.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpMakePackage.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpMakePackage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpMakePackage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpMakePackage.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpMakePackage.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -101,7 +101,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpNotifyResourcesChanged.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpNotifyResourcesChanged.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRegisterServicesOnServers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRegisterServicesOnServers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRemoveConfigurationProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRemoveConfigurationProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpRenameLog.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpRenameLog.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpRenameLog.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRenameLog.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRenameLog.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpSetConfigurationProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpSetConfigurationProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpSetConfigurationProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetConfigurationProperties.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetConfigurationProperties.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpSetDocument.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpSetDocument.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpSetDocument.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -93,7 +93,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetDocument.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetDocument.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpSetLogDelimiter.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpSetLogDelimiter.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpSetLogDelimiter.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetLogDelimiter.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetLogDelimiter.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpSetMaximumLogSize.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpSetMaximumLogSize.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpSetMaximumLogSize.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -87,7 +87,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetMaximumLogSize.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetMaximumLogSize.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpTakeOffline.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpTakeOffline.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpTakeOffline.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -84,7 +84,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpTakeOffline.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpTakeOffline.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -91,7 +91,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUnregisterServicesOnServers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUnregisterServicesOnServers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -425,7 +425,7 @@
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgServerAdminOperationFactory.GetOperation",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
@@ -432,7 +432,7 @@
 
     if (NULL == handler.get())
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgServerAdminOperationFactory.GetOperation",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -169,7 +169,7 @@
         arguments.Add(L"1");
         arguments.Add(log);
 
-        throw new MgInvalidArgumentException(L"MgServerAdminService.ClearLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerAdminService.ClearLog",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -260,7 +260,7 @@
         arguments.Add(L"1");
         arguments.Add(log);
 
-        throw new MgInvalidArgumentException(L"MgServerAdminService.GetLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerAdminService.GetLog",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -319,7 +319,7 @@
         arguments.Add(L"1");
         arguments.Add(log);
 
-        throw new MgInvalidArgumentException(L"MgServerAdminService.GetLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerAdminService.GetLog",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -378,7 +378,7 @@
         arguments.Add(L"1");
         arguments.Add(log);
 
-        throw new MgInvalidArgumentException(L"MgServerAdminService.GetLog",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerAdminService.GetLog",
             __LINE__, __WFILE__, &arguments, L"MgInvalidLogType", NULL);
     }
 
@@ -934,7 +934,7 @@
     MgServerManager* pMan = MgServerManager::GetInstance();
     if (NULL == pMan)
     {
-        throw new MgNullReferenceException(L"MgServerAdminService::GetDocument", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"MgServerAdminService::GetDocument", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     byteReader = pMan->GetDocument(identifier);

Modified: trunk/MgDev/Server/src/Services/Site/OpAddGroup.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpAddGroup.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpAddGroup.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpAddGroup.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpAddGroup.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpAddServer.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpAddServer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpAddServer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpAddServer.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpAddServer.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpAddUser.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpAddUser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpAddUser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -120,7 +120,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpAddUser.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpAddUser.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -104,7 +104,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpAuthenticate.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpAuthenticate.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpCreateSession.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpCreateSession.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpDeleteGroups.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpDeleteGroups.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpDeleteGroups.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -89,7 +89,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteGroups.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteGroups.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpDeleteUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpDeleteUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpDeleteUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDeleteUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDeleteUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpDestroySession.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpDestroySession.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpDestroySession.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -98,7 +98,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpDestroySession.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpDestroySession.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpEnumerateGroups.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpEnumerateGroups.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpEnumerateGroups.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -106,7 +106,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateGroups.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateGroups.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpEnumerateRoles.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpEnumerateRoles.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpEnumerateRoles.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -106,7 +106,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateRoles.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateRoles.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpEnumerateServers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpEnumerateServers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpEnumerateServers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -86,7 +86,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateServers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateServers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpEnumerateUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpEnumerateUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpEnumerateUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -111,7 +111,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpEnumerateUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpEnumerateUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpGetSessionTimeout.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpGetSessionTimeout.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpGetSessionTimeout.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetSessionTimeout.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetSessionTimeout.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpGetUserForSession.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpGetUserForSession.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpGetUserForSession.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetUserForSession.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetUserForSession.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpGrantGroupMembershipsToUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpGrantGroupMembershipsToUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpGrantGroupMembershipsToUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGrantGroupMembershipsToUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGrantGroupMembershipsToUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToGroups.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToGroups.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToGroups.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGrantRoleMembershipsToGroups.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGrantRoleMembershipsToGroups.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpGrantRoleMembershipsToUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGrantRoleMembershipsToUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGrantRoleMembershipsToUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpRemoveServer.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpRemoveServer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpRemoveServer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,7 +90,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRemoveServer.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRemoveServer.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpRequestServer.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpRequestServer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpRequestServer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -99,7 +99,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRequestServer.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRequestServer.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpRevokeGroupMembershipsFromUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpRevokeGroupMembershipsFromUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpRevokeGroupMembershipsFromUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRevokeGroupMembershipsFromUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRevokeGroupMembershipsFromUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromGroups.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromGroups.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromGroups.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRevokeRoleMembershipsFromGroups.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRevokeRoleMembershipsFromGroups.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromUsers.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromUsers.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpRevokeRoleMembershipsFromUsers.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpRevokeRoleMembershipsFromUsers.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpRevokeRoleMembershipsFromUsers.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpUpdateGroup.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpUpdateGroup.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpUpdateGroup.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -100,7 +100,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateGroup.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateGroup.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpUpdateServer.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpUpdateServer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpUpdateServer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -105,7 +105,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateServer.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateServer.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/OpUpdateUser.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpUpdateUser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/OpUpdateUser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -125,7 +125,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpUpdateUser.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpUpdateUser.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Site/ServerSiteService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
 
         if (NULL == dynamic_cast<MgServerResourceService*>(service.p))
         {
-            throw new MgServiceNotAvailableException(
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
                 L"MgServerSiteService.GetResourceService",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
@@ -695,7 +695,7 @@
 
     if (NULL == userInformation)
     {
-        throw new MgAuthenticationFailedException(
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, 
             L"MgServerSiteService.Authenticate", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -746,7 +746,7 @@
     }
     else
     {
-        throw new MgDuplicateSessionException(
+        throw new MgException(MgExceptionCodes::MgDuplicateSessionException, 
             L"MgServerSiteService.CreateSession", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -858,7 +858,7 @@
         arguments.Add(L"1");
         arguments.Add(session);
 
-        throw new MgInvalidArgumentException(L"MgServerSiteService.GetUserForSession()",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgServerSiteService.GetUserForSession()",
             __LINE__, __WFILE__, &arguments, L"MgInvalidSessionsId", NULL);
     }
 
@@ -1093,7 +1093,7 @@
 
     if (!bAllowed)
     {
-        throw new MgUnauthorizedAccessException(L"MgServerSiteService.ValidateAuthorOrSelf",
+        throw new MgException(MgExceptionCodes::MgUnauthorizedAccessException, L"MgServerSiteService.ValidateAuthorOrSelf",
                 __LINE__, __WFILE__, NULL, L"", NULL);
     }
 }

Modified: trunk/MgDev/Server/src/Services/Site/SiteOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/SiteOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Site/SiteOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -113,7 +113,7 @@
             handler.reset( new MgOpAuthenticate() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -125,7 +125,7 @@
             handler.reset( new MgOpEnumerateUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -137,7 +137,7 @@
             handler.reset( new MgOpAddUser() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -149,7 +149,7 @@
             handler.reset( new MgOpUpdateUser() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -161,7 +161,7 @@
             handler.reset( new MgOpDeleteUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -173,7 +173,7 @@
             handler.reset( new MgOpGrantRoleMembershipsToUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -185,7 +185,7 @@
             handler.reset( new MgOpRevokeRoleMembershipsFromUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -197,7 +197,7 @@
             handler.reset( new MgOpGrantGroupMembershipsToUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -209,7 +209,7 @@
             handler.reset( new MgOpRevokeGroupMembershipsFromUsers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -221,7 +221,7 @@
             handler.reset( new MgOpEnumerateGroups() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -233,7 +233,7 @@
             handler.reset( new MgOpAddGroup() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -245,7 +245,7 @@
             handler.reset( new MgOpUpdateGroup() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -257,7 +257,7 @@
             handler.reset( new MgOpDeleteGroups() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -269,7 +269,7 @@
             handler.reset( new MgOpGrantRoleMembershipsToGroups() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -281,7 +281,7 @@
             handler.reset( new MgOpRevokeRoleMembershipsFromGroups() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -293,7 +293,7 @@
             handler.reset( new MgOpEnumerateRoles() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -305,7 +305,7 @@
             handler.reset( new MgOpEnumerateServers() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -317,7 +317,7 @@
             handler.reset( new MgOpAddServer() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -329,7 +329,7 @@
             handler.reset( new MgOpRemoveServer() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -341,7 +341,7 @@
             handler.reset( new MgOpUpdateServer() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -353,7 +353,7 @@
             handler.reset( new MgOpRequestServer() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -365,7 +365,7 @@
             handler.reset( new MgOpCreateSession() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -377,7 +377,7 @@
             handler.reset( new MgOpDestroySession() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -389,7 +389,7 @@
             handler.reset( new MgOpGetSessionTimeout() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -401,13 +401,13 @@
             handler.reset( new MgOpGetUserForSession() );
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgDrawingOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(L"GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, L"GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_SITE_SERVICE_CATCH_AND_THROW( L"MgSiteOperationFactory::GetOperation" );

Modified: trunk/MgDev/Server/src/Services/Tile/MetatileLockUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/MetatileLockUtil.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/MetatileLockUtil.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -50,7 +50,7 @@
 #endif
             MgStringCollection arguments;
             arguments.Add(tilePathname);
-            throw new MgFileIoException(L"MgServerTileService.GetTile",
+            throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                 __LINE__, __WFILE__, &arguments, L"MgWaitForLockTimedOut", NULL);
         }
 #ifdef _DEBUG

Modified: trunk/MgDev/Server/src/Services/Tile/OpClearCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpClearCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpClearCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -106,7 +106,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpClearCache.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpClearCache.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetDefaultTileSizeX.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetDefaultTileSizeX.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -97,7 +97,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetDefaultTileSizeY.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetDefaultTileSizeY.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/OpGetTile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpGetTile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpGetTile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -140,7 +140,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetTile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetTile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/OpGetTileProviders.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpGetTileProviders.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpGetTileProviders.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -80,7 +80,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpGetTileProviders.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpGetTileProviders.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/OpSetTile.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/OpSetTile.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/OpSetTile.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
 
     if (!m_argsRead)
     {
-        throw new MgOperationProcessingException(L"MgOpSetTile.Execute",
+        throw new MgException(MgExceptionCodes::MgOperationProcessingException, L"MgOpSetTile.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/Services/Tile/ServerTileService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -51,7 +51,7 @@
     // if we don't find a nearest scale then something is wrong with the map
     if (scaleIndex < 0)
     {
-        throw new MgInvalidMapDefinitionException(L"MgServerTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgServerTileService.GetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -490,7 +490,7 @@
             MgStringCollection arguments;
             arguments.Add(resource->ToString());
 
-            throw new MgPermissionDeniedException(L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgPermissionDeniedException, L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         Ptr<MgByteReader> content = resourceService->GetResourceContent(resource);
@@ -510,7 +510,7 @@
             STRING errorMsg = parser.GetErrorMessage();
             MgStringCollection arguments;
             arguments.Add(errorMsg);
-            throw new MgXmlParserException(L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
         MdfModel::TileSetDefinition* tileset = parser.DetachTileSetDefinition();
@@ -651,7 +651,7 @@
     {
         MgStringCollection arguments;
         arguments.Add(provider);
-        throw new MgUnknownTileProviderException(L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"UnknownTileProvider", NULL);
+        throw new MgException(MgExceptionCodes::MgUnknownTileProviderException, L"MgServerTileService.GetTileCache", __LINE__, __WFILE__, &arguments, L"UnknownTileProvider", NULL);
     }
 
     MG_CATCH_AND_THROW(L"MgServerTileService.GetTileCache")

Modified: trunk/MgDev/Server/src/Services/Tile/TileCacheDefault.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/TileCacheDefault.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/TileCacheDefault.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -193,7 +193,7 @@
         arguments.Add(L"5");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgTileCacheDefault.GetTileForResource",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgTileCacheDefault.GetTileForResource",
             __LINE__, __WFILE__, &arguments, L"MgInvalidScaleIndex", NULL);
     }
 
@@ -234,7 +234,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgTileCacheDefault.GetTileForResource",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgTileCacheDefault.GetTileForResource",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToLockTileFile", NULL);
             }
 
@@ -255,7 +255,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgTileCacheDefault.GetTileForResource",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgTileCacheDefault.GetTileForResource",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
             }
             else
@@ -303,7 +303,7 @@
     // if we don't find a nearest scale then something is wrong with the map
     if (scaleIndex < 0)
     {
-        throw new MgInvalidMapDefinitionException(L"MgServerTileService.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidMapDefinitionException, L"MgServerTileService.GetTile",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -335,7 +335,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgServerTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToLockTileFile", NULL);
             }
 
@@ -356,7 +356,7 @@
                 MgStringCollection arguments;
                 arguments.Add(lockPathname);
 
-                throw new MgFileIoException(L"MgServerTileService.GetTile",
+                throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                     __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
             }
             else
@@ -441,7 +441,7 @@
         arguments.Add(L"3");
         arguments.Add(buffer);
 
-        throw new MgInvalidArgumentException(L"MgTileCacheDefault.GetTile",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgTileCacheDefault.GetTile",
             __LINE__, __WFILE__, &arguments, L"MgInvalidScaleIndex", NULL);
     }
 
@@ -467,7 +467,7 @@
             MgStringCollection arguments;
             arguments.Add(lockPathname);
 
-            throw new MgFileIoException(L"MgTileCacheDefault.SetTile",
+            throw new MgException(MgExceptionCodes::MgFileIoException, L"MgTileCacheDefault.SetTile",
                 __LINE__, __WFILE__, &arguments, L"MgUnableToOpenLockFile", NULL);
         }
         else
@@ -551,7 +551,7 @@
         MgStringCollection arguments;
         arguments.Add(mapDefinition->ToString());
 
-        throw new MgPermissionDeniedException(
+        throw new MgException(MgExceptionCodes::MgPermissionDeniedException, 
             funcName, __LINE__, __WFILE__, &arguments, L"", NULL);
     }
     return resourceService.Detach();

Modified: trunk/MgDev/Server/src/Services/Tile/TileCacheDefaultProvider.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/TileCacheDefaultProvider.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/TileCacheDefaultProvider.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -238,7 +238,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(metaTileLockPathname);
-                    throw new MgFileIoException(L"MgServerTileService.GetTile",
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                         __LINE__, __WFILE__, &arguments, L"MgUnableToLockMetaTileFile", NULL);
                 }
             }
@@ -286,7 +286,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(metaTileLockPathname);
-                    throw new MgFileIoException(L"MgServerTileService.GetTile",
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                         __LINE__, __WFILE__, &arguments, L"MgUnableToCreateLockFile", NULL);
                 }
                 else
@@ -319,7 +319,7 @@
         // Bail if no server-side impl exists (we can't use proxy impl)
         if (NULL == svcRendering)
         {
-            throw new MgServiceNotAvailableException(L"MgTileCacheDefaultProvider.GetMetatileForResource", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"MgTileCacheDefaultProvider.GetMetatileForResource", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         //Ptr<MgByteReader> metaTileBitMap = GetTile(metaTileName, map, scaleIndex, baseMapLayerGroupName, metaTileColumn, metaTileRow);

Modified: trunk/MgDev/Server/src/Services/Tile/TileCacheXYZProvider.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/TileCacheXYZProvider.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/TileCacheXYZProvider.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -345,7 +345,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(metaTileLockPathname);
-                    throw new MgFileIoException(L"MgServerTileService.GetTile",
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                         __LINE__, __WFILE__, &arguments, L"MgUnableToLockMetaTileFile", NULL);
                 }
             }
@@ -393,7 +393,7 @@
                 {
                     MgStringCollection arguments;
                     arguments.Add(metaTileLockPathname);
-                    throw new MgFileIoException(L"MgServerTileService.GetTile",
+                    throw new MgException(MgExceptionCodes::MgFileIoException, L"MgServerTileService.GetTile",
                         __LINE__, __WFILE__, &arguments, L"MgUnableToCreateLockFile", NULL);
                 }
                 else

Modified: trunk/MgDev/Server/src/Services/Tile/TileOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Tile/TileOperationFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/Services/Tile/TileOperationFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
             handler.reset(new MgOpGetTile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -81,7 +81,7 @@
             handler.reset(new MgOpSetTile());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -93,7 +93,7 @@
             handler.reset(new MgOpClearCache());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -105,7 +105,7 @@
             handler.reset(new MgOpClearCache());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -117,7 +117,7 @@
             handler.reset(new MgOpGetDefaultTileSizeX());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -129,7 +129,7 @@
             handler.reset(new MgOpGetDefaultTileSizeY());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -141,7 +141,7 @@
             handler.reset(new MgOpGetDefaultTileSizeX());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -153,7 +153,7 @@
             handler.reset(new MgOpGetDefaultTileSizeY());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
@@ -165,13 +165,13 @@
             handler.reset(new MgOpGetTileProviders());
             break;
         default:
-            throw new MgInvalidOperationVersionException(
+            throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
                 L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         break;
 
     default:
-        throw new MgInvalidOperationException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationException, 
             L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Server/src/UnitTesting/CatchHelperMacros.h
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/CatchHelperMacros.h	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/CatchHelperMacros.h	2022-10-10 09:40:18 UTC (rev 9971)
@@ -17,10 +17,19 @@
 
 #include "catch.hpp"
 #define REQUIRE_THROWS_MG(action, extype) \
-    try { \
+    try \
+    { \
         action; \
         FAIL("Expected exception to be thrown"); \
     } \
-    catch (extype ex) { \
-        SAFE_RELEASE(ex); \
+    catch (MgException* ex) \
+    { \
+        if (ex->GetExceptionCode() == MgExceptionCodes::extype) \
+        { \
+            SAFE_RELEASE(ex); \
+        } \
+        else \
+        { \
+            ex->Raise(); \
+        } \
     }

Modified: trunk/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -810,7 +810,7 @@
         REQUIRE(pCoordinateSystem);
 
         ogcWkt = InvalidWkt;
-        REQUIRE_THROWS_MG(pCoordinateSystem = factory.Create(ogcWkt), MgCoordinateSystemConversionFailedException*);
+        REQUIRE_THROWS_MG(pCoordinateSystem = factory.Create(ogcWkt), MgCoordinateSystemConversionFailedException);
 
         ogcWkt = ArbitraryWkt_Feet;
         pCoordinateSystem = factory.Create(ogcWkt);
@@ -854,16 +854,19 @@
         Ptr<MgCoordinateSystem> pCoordinateSystem = factory.Create(ogcWkt);
         REQUIRE(pCoordinateSystem);
     }
-    catch(MgCoordinateSystemConversionFailedException* e)
-    {
-        // This exception is expected
-        SAFE_RELEASE(e);
-    }
     catch(MgException* e)
     {
-        STRING message = e->GetDetails(TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgCoordinateSystemConversionFailedException)
+        {
+            // This exception is expected
+            SAFE_RELEASE(e);
+        }
+        else 
+        {
+            STRING message = e->GetDetails(TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
     catch(...)
     {
@@ -956,7 +959,7 @@
                     }
                     else
                     {
-                        throw new MgInvalidPropertyTypeException(
+                        throw new MgException(MgExceptionCodes::MgInvalidPropertyTypeException, 
                             L"TestCoordinateSystem.TestCase_EnumerateCategories", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
@@ -1039,7 +1042,7 @@
         bResult = pCoordinateSystem->IsValid();
         REQUIRE(bResult == true);
 
-        REQUIRE_THROWS_MG(pCoordinateSystem = factory.Create(InvalidWkt), MgCoordinateSystemConversionFailedException*);
+        REQUIRE_THROWS_MG(pCoordinateSystem = factory.Create(InvalidWkt), MgCoordinateSystemConversionFailedException);
     }
     catch(MgException* e)
     {
@@ -1383,7 +1386,7 @@
         MgCoordinateXY coord1(0.0, 0.0);
         MgCoordinateXY coord2(4.0, 3.0);
 
-        REQUIRE_THROWS_MG(double meters = pCoordinateSystem->MeasureGreatCircleDistance(&coord1, &coord2), MgInvalidCoordinateSystemTypeException*);
+        REQUIRE_THROWS_MG(double meters = pCoordinateSystem->MeasureGreatCircleDistance(&coord1, &coord2), MgInvalidCoordinateSystemTypeException);
     }
     catch(MgException* e)
     {
@@ -3998,10 +4001,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4032,10 +4032,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4066,10 +4063,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4100,10 +4094,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4134,10 +4125,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4168,10 +4156,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4202,10 +4187,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4236,10 +4218,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4270,10 +4249,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4304,10 +4280,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4338,10 +4311,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4372,10 +4342,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4406,10 +4373,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4440,10 +4404,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4474,10 +4435,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4508,10 +4466,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4542,10 +4497,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4576,10 +4528,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4610,10 +4559,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4644,10 +4590,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4678,10 +4621,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4712,10 +4652,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4746,10 +4683,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -4780,10 +4714,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5390,10 +5321,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5424,10 +5352,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5458,10 +5383,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5492,10 +5414,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5526,10 +5445,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5560,10 +5476,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5594,10 +5507,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -5628,10 +5538,7 @@
         {
             Ptr<MgCoordinateSystemTransform> transform = factory.GetTransform(coordinateSystemSource, coordinateSystemTarget);
         }
-        catch(MgCoordinateSystemInitializationFailedException* e)
-        {
-            SAFE_RELEASE(e);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgCoordinateSystemInitializationFailedException)
     }
     catch(MgException* e)
     {
@@ -6388,7 +6295,7 @@
         ogcWkt = factory->ConvertCoordinateSystemCodeToWkt(L"ePsG:4326");
         REQUIRE(ogcWkt == EPSG_4326_Wkt);
 
-        REQUIRE_THROWS_MG(ogcWkt = factory->ConvertCoordinateSystemCodeToWkt(L"test:4000"), MgCoordinateSystemLoadFailedException*);
+        REQUIRE_THROWS_MG(ogcWkt = factory->ConvertCoordinateSystemCodeToWkt(L"test:4000"), MgCoordinateSystemLoadFailedException);
 
         ogcWkt = factory->ConvertEpsgCodeToWkt(4326);
         REQUIRE(ogcWkt == EPSG_4326_Wkt);

Modified: trunk/MgDev/Server/src/UnitTesting/TestDrawingService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestDrawingService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestDrawingService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
     {
         Ptr<MgDrawingService> m_svcDrawing = TestServiceFactory::CreateDrawingService();
         Ptr<MgResourceIdentifier> resId1 = new MgResourceIdentifier(L"Library://UnitTests/Drawings/SpaceShip.DrawingSource");
-        REQUIRE_THROWS_MG(m_svcDrawing->EnumerateSectionResources(resId1, L"foo"), MgDwfSectionNotFoundException*);
+        REQUIRE_THROWS_MG(m_svcDrawing->EnumerateSectionResources(resId1, L"foo"), MgDwfSectionNotFoundException);
         
         STRING sect1 = L"com.autodesk.dwf.ePlot_9E2723744244DB8C44482263E654F764";
         Ptr<MgByteReader> rdr1 = m_svcDrawing->EnumerateSectionResources(resId1, sect1);

Modified: trunk/MgDev/Server/src/UnitTesting/TestFeatureService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestFeatureService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestFeatureService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,13 +90,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetFeatureProviders", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgByteReader> byteReader = pService->GetFeatureProviders();
@@ -133,13 +133,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService.p == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_TestConnectionSDFProvider", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -185,7 +185,7 @@
         MgFdoConnectionManager* pManager = MgFdoConnectionManager::GetInstance();
         if (pManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_TestFdoConnectionManager", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_TestFdoConnectionManager", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         const STRING provider = L"OSGeo.SDF";
@@ -255,19 +255,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetConnectionPropertyValues", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING provider = L"";
         STRING property = L"";
         STRING connectionString = L"";
-        REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetConnectionPropertyValues(provider, property, connectionString), MgInvalidArgumentException);
 
         provider = L"OSGeo.SDF";
         property = L"ReadOnly";
@@ -304,13 +304,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING provider = L"OSGeo.SDF";
@@ -318,7 +318,7 @@
         MgFdoConnectionManager* fdoConnectionManager = MgFdoConnectionManager::GetInstance();
         if (fdoConnectionManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
         }
         STRING providerNoVersion = fdoConnectionManager->UpdateProviderName(provider);
 
@@ -328,7 +328,7 @@
 
         provider = L"";
 
-        REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetCapabilities(provider), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -360,20 +360,20 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_TestConnectionResourceIdentifier", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->TestConnection(resource), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         bool bResult = pService->TestConnection(resource);
@@ -409,13 +409,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSchemas", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -423,10 +423,10 @@
         MgUserInformation::SetCurrentUserInfo(adminUserInfo);
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSchemas(resource), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         Ptr<MgStringCollection> schemas = pService->GetSchemas(resource);
@@ -462,13 +462,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -477,10 +477,10 @@
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
-        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetClasses(resource, schemaName), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
@@ -517,19 +517,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetClassDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
         STRING className = L"";
-        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetClassDefinition(resource, schemaName, className), MgClassNotFoundException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"SHP_Schema";
@@ -567,13 +567,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetIdentityProperties", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -609,7 +609,7 @@
         // Here is where exception should be thrown
         classNames->Clear();
         classNames->Add(L"IDontExist");
-        REQUIRE_THROWS_MG(pService->GetIdentityProperties(fsId, L"UnitTest", classNames), MgFdoException*);
+        REQUIRE_THROWS_MG(pService->GetIdentityProperties(fsId, L"UnitTest", classNames), MgFdoException);
     }
     catch(MgException* e)
     {
@@ -641,13 +641,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_DescribeSchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -656,11 +656,11 @@
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING schemaName = L"";
-        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, NULL), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, NULL), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
         schemaName = L"";
-        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, NULL), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->DescribeSchema(resource, schemaName, NULL), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         schemaName = L"";
@@ -713,13 +713,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ApplySchema", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -978,19 +978,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";
@@ -1028,13 +1028,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         //Create our test data store
@@ -1158,13 +1158,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == 0)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_VotingDistricts.FeatureSource");
@@ -1177,7 +1177,7 @@
         options->SetOrderingFilter(orderProps, MgOrderingOption::Descending);
 
         //Invalid conditions for ordered select
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgFeatureServiceException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgFeatureServiceException);
         
         orderProps->Clear();
         orderProps->Add(L"ID");
@@ -1236,19 +1236,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SelectAggregate", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureAggregateOptions> options = new MgFeatureAggregateOptions();
-        REQUIRE_THROWS_MG(pService->SelectAggregate(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectAggregate(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";
@@ -1289,18 +1289,18 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ExecuteSqlQuery", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         const STRING sqlQuery = L"";
-        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlQuery(resource, sqlQuery), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1335,18 +1335,18 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ExecuteSqlNonQuery", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         const STRING sqlNonQuery = L"";
-        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->ExecuteSqlNonQuery(resource, sqlNonQuery), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1380,13 +1380,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSpatialContexts", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1395,10 +1395,10 @@
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         bool activeOnly = false;
-        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetSpatialContexts(resource, activeOnly), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
 
@@ -1469,13 +1469,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetLongTransactions", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1484,10 +1484,10 @@
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         bool activeOnly = false;
-        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidRepositoryTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->GetLongTransactions(resource, activeOnly), MgInvalidResourceTypeException);
 
         //TODO test with correct input
     }
@@ -1521,36 +1521,36 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SetLongTransaction", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING longTransactionName = L"Live";
 
         // verify exception when passing in a NULL resource
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(NULL, longTransactionName), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(NULL, longTransactionName), MgNullArgumentException);
 
         // verify exception when passing in an invalid resource type
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Geography/World.MapDefinition");
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgInvalidResourceTypeException);
 
         // verify exception when session is not set
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
 
         // set the user information for the current thread to be administrator - this
         // alone doesn't create a session
         Ptr<MgUserInformation> userInfo = new MgUserInformation(MgUser::Administrator, L"");
         MgUserInformation::SetCurrentUserInfo(userInfo);
-        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException*);
+        REQUIRE_THROWS_MG(pService->SetLongTransaction(resource, longTransactionName), MgSessionNotFoundException);
 
         // now set a session
         userInfo->SetMgSessionId(userInfo->CreateMgSessionId());
@@ -1593,17 +1593,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING readerId = L"0";
-        REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetFeatures(readerId), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1637,13 +1637,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseFeatureReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING readerId = L"0";
@@ -1682,17 +1682,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetSqlRows", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING sqlReader = L"0";
-        REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetSqlRows(sqlReader), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1726,13 +1726,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseSqlReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING sqlReader = L"0";
@@ -1771,19 +1771,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetRaster", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING featureReader = L"0";
         INT32 xSize = 0;
         INT32 ySize = 0;
-        REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetRaster(featureReader, xSize, ySize, L""), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1817,17 +1817,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_GetDataRows", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING dataReader = L"0";
-        REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetDataRows(dataReader), MgInvalidArgumentException);
 
         //TODO test with correct input
     }
@@ -1861,13 +1861,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CloseDataReader", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         STRING dataReader = L"0";
@@ -1906,7 +1906,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_JoinFeatures",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_JoinFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1913,7 +1913,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1977,7 +1977,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -1984,7 +1984,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFeaturesChainedInner1ToMany",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2052,7 +2052,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_CreateFeatureSource",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_CreateFeatureSource",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2059,7 +2059,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CreateFeatureSource",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CreateFeatureSource",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2066,7 +2066,7 @@
         Ptr<MgResourceService> pResourceService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_CreateFeatureSource",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_CreateFeatureSource",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2171,13 +2171,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_ConcurrentAccess", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_ConcurrentAccess", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_ConcurrentAccess", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_ConcurrentAccess", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
@@ -2205,7 +2205,7 @@
 
         // Create another reader - this one should timeout and throw exception
         Ptr<MgFeatureReader> readerFail;
-        REQUIRE_THROWS_MG(readerFail = pService->SelectFeatures(resource, className, options), MgAllProviderConnectionsUsedException*);
+        REQUIRE_THROWS_MG(readerFail = pService->SelectFeatures(resource, className, options), MgAllProviderConnectionsUsedException);
 
         if (!featureReaders.empty())
         {
@@ -2274,13 +2274,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> featureSource = new MgResourceIdentifier(L"Library://UnitTests/Data/SavePointTest.FeatureSource");
@@ -2377,13 +2377,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_SavePoint", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> featureSource = new MgResourceIdentifier(L"Library://UnitTests/Data/TestInsert.FeatureSource");
@@ -2459,7 +2459,7 @@
         nameVal->SetValue(L"Bar");
 
         //Execute again, expect MgFdoException due to constraint violation
-        REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException*);
+        REQUIRE_THROWS_MG(result = pService->UpdateFeatures(featureSource, commands, true), MgFdoException);
         
         //Expect one inserted result
         Ptr<MgFeatureQueryOptions> query = new MgFeatureQueryOptions();
@@ -2517,13 +2517,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_JoinFdoFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_JoinFdoFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_JoinFdoFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_JoinFdoFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> lFeatureSource = new MgResourceIdentifier(L"Library://UnitTests/Data/FdoJoin.FeatureSource");
@@ -2599,19 +2599,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_BenchmarkSqliteJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_BenchmarkSqliteJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_BenchmarkSqliteJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_BenchmarkSqliteJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_BenchmarkSqliteJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_BenchmarkSqliteJoin",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2699,19 +2699,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_BenchmarkSqliteAggregateJoin",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2818,13 +2818,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_UpdateFeaturesPartialFailure",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2878,13 +2878,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_InsertFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_InsertFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -2954,13 +2954,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_InsertFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_InsertFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_InsertFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -3037,13 +3037,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_UpdateMatchingFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_UpdateMatchingFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_UpdateMatchingFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_UpdateMatchingFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -3147,13 +3147,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_DeleteFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_DeleteFeatures", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_DeleteFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_DeleteFeatures",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -3249,13 +3249,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_TransactedCrud", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_TransactedCrud", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> featSvc = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (featSvc == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_TransactedCrud",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_TransactedCrud",
                 __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
@@ -3386,19 +3386,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == NULL)
         {
-            throw new MgNullReferenceException(L"TestFeatureService.TestCase_FeatureReader_GetPropertyIndex_BadProp", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestFeatureService.TestCase_FeatureReader_GetPropertyIndex_BadProp", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == NULL)
         {
-            throw new MgServiceNotAvailableException(L"TestFeatureService.TestCase_FeatureReader_GetPropertyIndex_BadProp", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestFeatureService.TestCase_FeatureReader_GetPropertyIndex_BadProp", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";

Modified: trunk/MgDev/Server/src/UnitTesting/TestGeometry.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestGeometry.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestGeometry.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1058,7 +1058,7 @@
 
         Ptr<MgPolygon> testPolygon = CreatePolygon();
         // TODO: Need to investigate why this test throws an exception
-        //CPPUNIT_ASSERT_THROW_MG(testPolygon->Buffer(5.0, measure), MgUnclassifiedException*);
+        //CPPUNIT_ASSERT_THROW_MG(testPolygon->Buffer(5.0, measure), MgUnclassifiedException);
     }
     catch (MgException* e)
     {
@@ -2390,9 +2390,9 @@
         Ptr<MgWktReaderWriter> wktRw = new MgWktReaderWriter();
         Ptr<MgGeometry> geom = wktRw->Read(L"POINT (1 1)");
 
-        REQUIRE_THROWS_MG(simp->Simplify(nullptr, 1.0, MgGeometrySimplificationAlgorithmType::DouglasPeucker), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(simp->Simplify(geom, 1.0, -1), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(simp->Simplify(geom, 1.0, 2), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(simp->Simplify(nullptr, 1.0, MgGeometrySimplificationAlgorithmType::DouglasPeucker), MgNullArgumentException);
+        REQUIRE_THROWS_MG(simp->Simplify(geom, 1.0, -1), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(simp->Simplify(geom, 1.0, 2), MgInvalidArgumentException);
     }
     catch (MgException* e)
     {
@@ -2684,13 +2684,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestGeometry::TestCase_PreparedGeometry", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestGeometry::TestCase_PreparedGeometry", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestGeometry::TestCase_PreparedGeometry", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestGeometry::TestCase_PreparedGeometry", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgAgfReaderWriter> agfRw = new MgAgfReaderWriter();
@@ -2702,7 +2702,7 @@
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
         STRING className = L"";
         Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->SelectFeatures(resource, className, options), MgInvalidArgumentException);
 
         resource = new MgResourceIdentifier(L"Library://UnitTests/Data/Sheboygan_Parcels.FeatureSource");
         className = L"Parcels";

Modified: trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -132,16 +132,23 @@
             STRING mimeType = reader->GetMimeType();
             REQUIRE(mimeType.compare(MgMimeType::Kml) == 0);
         }
-        catch(MgConnectionFailedException* e)
+        catch (MgException* e)
         {
-            SAFE_RELEASE(e);
-            ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetMapKml skipped because unable to connect to test server.\n")));
+            if (e->GetExceptionCode() == MgExceptionCodes::MgConnectionFailedException)
+            {
+                SAFE_RELEASE(e);
+                ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetMapKml skipped because unable to connect to test server.\n")));
 
-            // We need to update the mapguide server status so that it can be used again because we have used the
-            // same exception class for servers outside the one actually executing this code.
-            MgSiteManager* siteManager = MgSiteManager::GetInstance();
-            Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
-            siteInfo->SetStatus(MgSiteInfo::Ok);
+                // We need to update the mapguide server status so that it can be used again because we have used the
+                // same exception class for servers outside the one actually executing this code.
+                MgSiteManager* siteManager = MgSiteManager::GetInstance();
+                Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
+                siteInfo->SetStatus(MgSiteInfo::Ok);
+            }
+            else
+            {
+                e->Raise();
+            }
         }
 
         //compare results against referenced content
@@ -186,16 +193,23 @@
             STRING mimeType = reader->GetMimeType();
             REQUIRE(mimeType.compare(MgMimeType::Kmz) == 0);
         }
-        catch(MgConnectionFailedException* e)
+        catch (MgException* e)
         {
-            SAFE_RELEASE(e);
-            ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetMapKmz skipped because unable to connect to test server.\n")));
+            if (e->GetExceptionCode() == MgExceptionCodes::MgConnectionFailedException)
+            {
+                SAFE_RELEASE(e);
+                ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetMapKmz skipped because unable to connect to test server.\n")));
 
-            // We need to update the mapguide server status so that it can be used again because we have used the
-            // same exception class for servers outside the one actually executing this code.
-            MgSiteManager* siteManager = MgSiteManager::GetInstance();
-            Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
-            siteInfo->SetStatus(MgSiteInfo::Ok);
+                // We need to update the mapguide server status so that it can be used again because we have used the
+                // same exception class for servers outside the one actually executing this code.
+                MgSiteManager* siteManager = MgSiteManager::GetInstance();
+                Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
+                siteInfo->SetStatus(MgSiteInfo::Ok);
+            }
+            else
+            {
+                e->Raise();
+            }
         }
     }
     catch(MgException* e)
@@ -238,16 +252,23 @@
             STRING mimeType = reader->GetMimeType();
             REQUIRE(mimeType.compare(MgMimeType::Kml) == 0);
         }
-        catch(MgConnectionFailedException* e)
+        catch (MgException* e)
         {
-            SAFE_RELEASE(e);
-            ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetLayerKml skipped because unable to connect to test server.\n")));
+            if (e->GetExceptionCode() == MgExceptionCodes::MgConnectionFailedException)
+            {
+                SAFE_RELEASE(e);
+                ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetLayerKml skipped because unable to connect to test server.\n")));
 
-            // We need to update the mapguide server status so that it can be used again because we have used the
-            // same exception class for servers outside the one actually executing this code.
-            MgSiteManager* siteManager = MgSiteManager::GetInstance();
-            Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
-            siteInfo->SetStatus(MgSiteInfo::Ok);
+                // We need to update the mapguide server status so that it can be used again because we have used the
+                // same exception class for servers outside the one actually executing this code.
+                MgSiteManager* siteManager = MgSiteManager::GetInstance();
+                Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
+                siteInfo->SetStatus(MgSiteInfo::Ok);
+            }
+            else
+            {
+                e->Raise();
+            }
         }
 
         //compare results against referenced content
@@ -294,16 +315,23 @@
             STRING mimeType = reader->GetMimeType();
             REQUIRE(mimeType.compare(MgMimeType::Kml) == 0);
         }
-        catch(MgConnectionFailedException* e)
+        catch (MgException* e)
         {
-            SAFE_RELEASE(e);
-            ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetFeaturesKml skipped because unable to connect to test server.\n")));
+            if (e->GetExceptionCode() == MgExceptionCodes::MgConnectionFailedException)
+            {
+                SAFE_RELEASE(e);
+                ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetFeaturesKml skipped because unable to connect to test server.\n")));
 
-            // We need to update the mapguide server status so that it can be used again because we have used the
-            // same exception class for servers outside the one actually executing this code.
-            MgSiteManager* siteManager = MgSiteManager::GetInstance();
-            Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
-            siteInfo->SetStatus(MgSiteInfo::Ok);
+                // We need to update the mapguide server status so that it can be used again because we have used the
+                // same exception class for servers outside the one actually executing this code.
+                MgSiteManager* siteManager = MgSiteManager::GetInstance();
+                Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
+                siteInfo->SetStatus(MgSiteInfo::Ok);
+            }
+            else
+            {
+                e->Raise();
+            }
         }
 
         //compare results against referenced content

Modified: trunk/MgDev/Server/src/UnitTesting/TestLogManager.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestLogManager.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestLogManager.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -227,12 +227,12 @@
         Ptr<MgStringProperty> newTestNameProp = new MgStringProperty(L"LogNameProperty", NewTestName);
         REQUIRE(logs->Contains(newTestNameProp));
 
-        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(L"", NewTestName), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(NewTestName, L""), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(TestName, TestName), MgDuplicateFileException*);
-        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException*);
+        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(L"", NewTestName), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(NewTestName, L""), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(TestName, TestName), MgDuplicateFileException);
+        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(L"DoesNotExist.log", L"NewDoesNotExist.log"), MgFileNotFoundException);
 #ifdef _WIN32
-        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->RenameLog(NewTestName, L"?"), MgInvalidArgumentException);
 #endif
     }
     catch (MgException* e)
@@ -440,12 +440,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(fromDate, toDate), MgInvalidArgumentException);
 
         // Search a log file with an invalid log entry as the first entry
         CreateFile(path + JunkName, L"asdfasdfasdf");
@@ -452,7 +452,7 @@
         pMgLogManager->SetAccessLogFileName(JunkName);
         fromDate = new MgDateTime(2005, 3, 8, 0, 0, 0, 0);
         toDate = new MgDateTime(2005, 3, 9, 0, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(fromDate, toDate), MgInvalidLogEntryException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(fromDate, toDate), MgInvalidLogEntryException);
 
         pMgLogManager->SetAccessLogFileName(originalName);
     }
@@ -479,7 +479,7 @@
 TEST_CASE("GetAccessLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetAccessLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -659,12 +659,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgLogManager->SetAdminLogFileName(originalName);
     }
@@ -691,7 +691,7 @@
 TEST_CASE("GetAdminLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetAdminLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -871,12 +871,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgLogManager->SetAuthenticationLogFileName(originalName);
     }
@@ -903,7 +903,7 @@
 TEST_CASE("GetAuthenticationLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetAuthenticationLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1083,12 +1083,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgLogManager->SetErrorLogFileName(originalName);
     }
@@ -1115,7 +1115,7 @@
 TEST_CASE("GetErrorLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetErrorLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1295,12 +1295,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgLogManager->SetSessionLogFileName(originalName);
     }
@@ -1327,7 +1327,7 @@
 TEST_CASE("GetSessionLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetSessionLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------
@@ -1507,12 +1507,12 @@
         REQUIRE(logContents.length() == 0);
 
         // Use a null value for the date
-        REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(nullptr, toDate), MgNullArgumentException);
 
         // Use dates more than 24 hours apart
         fromDate = new MgDateTime(2005, 2, 18, 14, 0, 0, 0);
         toDate = new MgDateTime(2005, 2, 19, 18, 0, 0, 0);
-        REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(fromDate, toDate), MgInvalidArgumentException);
 
         pMgLogManager->SetTraceLogFileName(originalName);
     }
@@ -1539,7 +1539,7 @@
 TEST_CASE("GetTraceLogInvalid", "[LogManager]")
 {
     MgLogManager* pMgLogManager = MgLogManager::GetInstance();
-    REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException*);
+    REQUIRE_THROWS_MG(pMgLogManager->GetTraceLog(-1), MgArgumentOutOfRangeException);
 }
 
 ///----------------------------------------------------------------------------

Modified: trunk/MgDev/Server/src/UnitTesting/TestLogManagerThread.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestLogManagerThread.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestLogManagerThread.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,7 +32,7 @@
     MgLogManager* pMan = MgLogManager::GetInstance();
     if (nullptr == pMan)
     {
-        throw new MgNullReferenceException(L"TestLogManagerThread.svc", __LINE__, __WFILE__, nullptr, L"", nullptr);
+        throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestLogManagerThread.svc", __LINE__, __WFILE__, nullptr, L"", nullptr);
     }
 
     INT32 nResult = 0;

Modified: trunk/MgDev/Server/src/UnitTesting/TestMisc.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestMisc.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestMisc.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -32,6 +32,57 @@
 #define THREAD_GROUP 65520
 #define TESTREQUESTS 5000
 
+TEST_CASE("Exceptions", "[Misc]")
+{
+    // Testing MG_CATCH_AND_RELEASE_IF_TYPE
+    try 
+    {
+        try
+        {
+            MgObject* ptr = nullptr;
+            CHECKNULL(ptr, L"TestMisc::TestCase_Exceptions");
+        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgNullReferenceException)
+    }
+    catch (MgException* ex)
+    {
+        FAIL("Expected MG_CATCH_AND_RELEASE_IF_TYPE macro to have caught the exception and release it");
+        SAFE_RELEASE(ex);
+    }
+
+    // Testing proper message extraction
+    try
+    {
+        MgObject* ptr = nullptr;
+        CHECKNULL(ptr, L"TestMisc::TestCase_Exceptions");
+    }
+    catch (MgException* ex)
+    {
+        // If proper message extraction is working, we should never see "Failed to retrieve message for $EXCEPTION"
+        // anywhere in the details
+        STRING msg = ex->GetDetails(TestServiceFactory::TEST_LOCALE);
+        REQUIRE(msg.find(L"Failed to retrieve message for ") == STRING::npos);
+        SAFE_RELEASE(ex);
+    }
+
+    // Testing native error code preservation through serialization
+    {
+        Ptr<MgException> ex = new MgException(MgExceptionCodes::MgFdoException, L"TestMisc::TestCase_Exceptions", __LINE__, __WFILE__, nullptr, L"", nullptr);
+        ex->SetNativeErrorCode(1234);
+
+        Ptr<MgMemoryStreamHelper> helper = new MgMemoryStreamHelper();
+        Ptr<MgStream> stream = new MgStream(helper);
+
+        ex->Serialize(stream);
+        
+        Ptr<MgException> ex2 = static_cast<MgException*>(MgException::CreateObject());
+        ex2->Deserialize(stream);
+
+        REQUIRE(MgExceptionCodes::MgFdoException == ex2->GetExceptionCode());
+        REQUIRE(1234 == ex2->GetNativeErrorCode());
+    }
+}
+
 TEST_CASE("CommonExceptionMessages", "[Misc]")
 {
     try
@@ -916,10 +967,7 @@
             map1->Save();
             FAIL("Expected MgGroupNotFoundException to be thrown");
         }
-        catch (MgGroupNotFoundException* gnex)
-        {
-            SAFE_RELEASE(gnex);
-        }
+        MG_CATCH_AND_RELEASE_IF_TYPE(MgGroupNotFoundException)
     }
     catch (MgException* e)
     {

Modified: trunk/MgDev/Server/src/UnitTesting/TestPerformance.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestPerformance.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestPerformance.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -45,13 +45,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestCase_BenchmarkSelectFeatures", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier();
@@ -77,17 +77,20 @@
         ACE_DEBUG((LM_INFO, ACE_TEXT("  Execution Time (Average of %d runs): = %6.4f (s)\n"), iterations, ((GetTickCount()-lStart)/1000.0)/(double)iterations ));
         ACE_DEBUG((LM_INFO, ACE_TEXT("TestCase_BenchmarkSelectFeatures - END\n")));
     }
-    catch(MgResourceNotFoundException* e)
-    {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        ACE_DEBUG((LM_INFO, ACE_TEXT("\n%W\nAre the performance test resources installed?\n\n"), message.c_str()));
-    }
     catch(MgException* e)
     {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgResourceNotFoundException)
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            ACE_DEBUG((LM_INFO, ACE_TEXT("\n%W\nAre the performance test resources installed?\n\n"), message.c_str()));
+        }
+        else
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
     catch(FdoException* e)
     {
@@ -113,7 +116,7 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if(serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestPerformance.TestCase_BenchmarkJoinFeatures",
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestPerformance.TestCase_BenchmarkJoinFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -120,7 +123,7 @@
         Ptr<MgFeatureService> pService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestPerformance.TestCase_BenchmarkJoinFeatures",
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestPerformance.TestCase_BenchmarkJoinFeatures",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
@@ -427,17 +430,20 @@
 
         ACE_DEBUG((LM_INFO, ACE_TEXT("TestCase_BenchmarkJoinFeatures - END\n")));
     }
-    catch(MgResourceNotFoundException* e)
-    {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        ACE_DEBUG((LM_INFO, ACE_TEXT("\n%W\nAre the performance test resources installed?\n\n"), message.c_str()));
-    }
     catch(MgException* e)
     {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgResourceNotFoundException)
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            ACE_DEBUG((LM_INFO, ACE_TEXT("\n%W\nAre the performance test resources installed?\n\n"), message.c_str()));
+        }
+        else
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
     catch(FdoException* e)
     {

Modified: trunk/MgDev/Server/src/UnitTesting/TestResourceService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestResourceService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestResourceService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -164,13 +164,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateRepositories", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -184,7 +184,7 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to enumerate an invalid type of repository
-            REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgInvalidRepositoryTypeException*);
+            REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Library"), MgInvalidRepositoryTypeException);
 
             //Enumerate the Session repositories
             Ptr<MgByteReader> byteReader = pService->EnumerateRepositories(L"Session");
@@ -199,7 +199,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Session"), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->EnumerateRepositories(L"Session"), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -222,13 +222,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_CreateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -242,16 +242,16 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to create a repository using a nullptr identifier
-            REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->CreateRepository(nullptr, nullptr, nullptr), MgNullArgumentException);
 
             //Try to create a repository using an invalid repository identifier
-            REQUIRE_THROWS_MG(pService->CreateRepository(&resourceIdentifier, nullptr, nullptr), MgInvalidRepositoryTypeException*);
+            REQUIRE_THROWS_MG(pService->CreateRepository(&resourceIdentifier, nullptr, nullptr), MgInvalidRepositoryTypeException);
 
             //Create a new repository
             pService->CreateRepository(&sessionRepositoryIdentifier, nullptr, nullptr);
 
             //Try to create the same repository again
-            REQUIRE_THROWS_MG(pService->CreateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgDuplicateRepositoryException*);
+            REQUIRE_THROWS_MG(pService->CreateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgDuplicateRepositoryException);
         }
 
         //Try to create a repository while not an admin
@@ -261,7 +261,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->CreateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->CreateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -284,13 +284,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_UpdateRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -307,18 +307,18 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use a nullptr argument
-            REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->UpdateRepository(nullptr, nullptr, nullptr), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, nullptr, nullptr), MgNullArgumentException);
 
             //Try to update a repository that doesn't exist
             contentSource = new MgByteSource(repositoryContentFileName);
             Ptr<MgByteReader> contentReader = contentSource->GetReader();
-            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryNotExist, contentReader, nullptr), MgRepositoryNotFoundException*);
+            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryNotExist, contentReader, nullptr), MgRepositoryNotFoundException);
 
             //Try to update the repository using invalid content
             string str = "asdf";
             Ptr<MgByteReader> byteReader = MgUtil::GetByteReader(str);
-            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, byteReader, nullptr), MgDbXmlException*);
+            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, byteReader, nullptr), MgDbXmlException);
 
             //Try to update the repository using valid header
             headerSource = new MgByteSource(repositoryHeaderFileName);
@@ -334,7 +334,7 @@
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
             Ptr<MgByteReader> contentReader = contentSource->GetReader();
-            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, contentReader, nullptr), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->UpdateRepository(&sessionRepositoryIdentifier, contentReader, nullptr), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -357,13 +357,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetRepositoryContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -377,10 +377,10 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to get repository content using a nullptr argument
-            REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->GetRepositoryContent(nullptr), MgNullArgumentException);
 
             //Try to get the repository contents of a repository that doesn't exist
-            REQUIRE_THROWS_MG(pService->GetRepositoryContent(&sessionRepositoryNotExist), MgRepositoryNotFoundException*);
+            REQUIRE_THROWS_MG(pService->GetRepositoryContent(&sessionRepositoryNotExist), MgRepositoryNotFoundException);
 
             //Get the repository content using a valid argument
             Ptr<MgByteReader> byteReader = pService->GetRepositoryContent(&sessionRepositoryIdentifier);
@@ -395,7 +395,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->GetRepositoryContent(&sessionRepositoryIdentifier), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->GetRepositoryContent(&sessionRepositoryIdentifier), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -418,20 +418,20 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetRepositoryHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to get repository header using a nullptr argument
-        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(nullptr), MgNullArgumentException);
 
         //Try to get repository header of a repository other than Library://
-        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(&sessionRepositoryIdentifier), MgInvalidRepositoryTypeException*);
+        REQUIRE_THROWS_MG(pService->GetRepositoryHeader(&sessionRepositoryIdentifier), MgInvalidRepositoryTypeException);
 
         // Set the user information for the current thread to be administrator.
         Ptr<MgUserInformation> adminUserInfo = new MgUserInformation(adminName, adminPass);
@@ -462,13 +462,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_ApplyResourcePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -482,7 +482,7 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try using nullptr argument
-            REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->ApplyResourcePackage(nullptr), MgNullArgumentException);
 
             Ptr<MgByteSource> byteSource = new MgByteSource(packageName);
             byteSource->SetMimeType(MgMimeType::Binary);
@@ -503,7 +503,7 @@
             byteSource->SetMimeType(MgMimeType::Binary);
             Ptr<MgByteReader> byteReader = byteSource->GetReader();
 
-            REQUIRE_THROWS_MG(pService->ApplyResourcePackage(byteReader), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->ApplyResourcePackage(byteReader), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -526,13 +526,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteRepository", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -544,7 +544,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->DeleteRepository(&sessionRepositoryIdentifier), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->DeleteRepository(&sessionRepositoryIdentifier), MgUnauthorizedAccessException);
         }
 
         //Sets the user information for the current thread to be administrator
@@ -556,10 +556,10 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use a nullptr argument
-            REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->DeleteRepository(nullptr), MgNullArgumentException);
 
             //Try to delete a repository that does not exist
-            REQUIRE_THROWS_MG(pService->DeleteRepository(&sessionRepositoryNotExist), MgRepositoryNotFoundException*);
+            REQUIRE_THROWS_MG(pService->DeleteRepository(&sessionRepositoryNotExist), MgRepositoryNotFoundException);
 
             //Delete the repository that was created earlier in TestCase_CreateRepository
             pService->DeleteRepository(&sessionRepositoryIdentifier);
@@ -586,7 +586,7 @@
 
         if (nullptr == serviceManager)
         {
-            throw new MgNullReferenceException(
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, 
                 L"TestResourceService.TestCase_ResourceExists",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
@@ -596,7 +596,7 @@
 
         if (nullptr == service)
         {
-            throw new MgServiceNotAvailableException(
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, 
                 L"TestResourceService.TestCase_ResourceExists",
                 __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
@@ -607,7 +607,7 @@
 
         // Try to check a nullptr resource.
         bool existed = false;
-        REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(service->ResourceExists(nullptr), MgNullArgumentException);
 
         // Try to check a resource that exists
         existed = service->ResourceExists(&libraryRepositoryIdentifier);
@@ -637,17 +637,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateResources", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to enumerate resources using a nullptr argument
-        REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResources(nullptr, -1, L"", true), MgNullArgumentException);
 
         // Enumerate the Library resource.
         Ptr<MgByteReader> byteReader = pService->EnumerateResources(&libraryRepositoryIdentifier, -1, L"", true);
@@ -675,13 +675,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_SetResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteSource> contentSource;
@@ -698,8 +698,8 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use nullptr arguments
-            REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->SetResource(nullptr, nullptr, nullptr), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier, nullptr, nullptr), MgNullArgumentException);
 
             //Add a new resource
             contentSource = new MgByteSource(resourceContentFileName);
@@ -725,7 +725,7 @@
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
             Ptr<MgByteReader> contentReader = contentSource->GetReader();
-            REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier2, contentReader, nullptr), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->SetResource(&resourceIdentifier2, contentReader, nullptr), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -749,13 +749,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_MoveResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -770,12 +770,12 @@
 
 
             //Try to use nullptr arguments
-            REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->MoveResource(nullptr, nullptr, true, false), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, nullptr, true, true), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->MoveResource(nullptr, &resourceIdentifier, true, false), MgNullArgumentException);
 
             //Try to move a resource that doesn't exist
-            REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException*);
+            REQUIRE_THROWS_MG(pService->MoveResource(&resourceNotExist, &resourceIdentifier2, false, true), MgResourceNotFoundException);
 
             //Move the resource that was added earlier with cascade = true, and check referencing resource.
             pService->MoveResource(&resourceIdentifier, &resourceIdentifier2, false, true);
@@ -792,7 +792,7 @@
             REQUIRE(referenceContent.find(featureIdTag) != STRING::npos);
 
             //Try to move the resource into itself (ie. itself)
-            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException*);
+            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier, false), MgInvalidArgumentException);
         }
 
 
@@ -803,7 +803,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier2, false), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->MoveResource(&resourceIdentifier, &resourceIdentifier2, false), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -827,13 +827,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_CopyResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -847,18 +847,18 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use nullptr arguments
-            REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException*);
-            REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->CopyResource(nullptr, nullptr, true), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, nullptr, true), MgNullArgumentException);
+            REQUIRE_THROWS_MG(pService->CopyResource(nullptr, &resourceIdentifier2, true), MgNullArgumentException);
 
             //Try to use source & destination as the same thing
-            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException*);
+            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier2, false), MgInvalidArgumentException);
 
             //Copy the moved resource to another location
             pService->CopyResource(&resourceIdentifier, &resourceIdentifier2, false);
 
             //Try to copy a resource to one that should now exist
-            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException*);
+            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier2, &resourceIdentifier, false), MgDuplicateResourceException);
         }
 
         //Try to copy resource while not an admin
@@ -868,7 +868,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, &resourceIdentifier2, false), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->CopyResource(&resourceIdentifier, &resourceIdentifier2, false), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -890,13 +890,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceContent", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -907,10 +907,10 @@
         byteReader = nullptr;
 
         //Try to get the content using nullptr arguments
-        REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContent(nullptr, L""), MgNullArgumentException);
 
         //Try to get the content of a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContent(&resourceNotExist, L""), MgResourceNotFoundException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         byteReader = pService->GetResourceContent(&resourceIdentifier, L"");
@@ -937,13 +937,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceContents", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -951,13 +951,13 @@
         MgUserInformation::SetCurrentUserInfo(adminUserInfo);
 
         //Try to get the contents using nullptr arguments
-        REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContents(nullptr, nullptr), MgNullArgumentException);
 
         //Try to get the content of a resource that doesn't exist
         Ptr<MgStringCollection> resourceNotExistCol = new MgStringCollection();
         resourceNotExistCol->Add(resourceNotExist.ToString());
         resourceNotExistCol->Add(resourceIdentifier.ToString());
-        REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceContents(resourceNotExistCol, nullptr), MgResourceNotFoundException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         Ptr<MgStringCollection> resourceIds = new MgStringCollection();
@@ -990,13 +990,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceHeader", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1007,10 +1007,10 @@
         byteReader = nullptr;
 
         //Try to get the content using nullptr arguments
-        REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceHeader(nullptr), MgNullArgumentException);
 
         //Try to get the content of a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->GetResourceHeader(&resourceNotExist), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceHeader(&resourceNotExist), MgResourceNotFoundException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         byteReader = pService->GetResourceHeader(&resourceIdentifier);
@@ -1037,13 +1037,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateReferences", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1054,7 +1054,7 @@
         byteReader = nullptr;
 
         //Try to get the content using nullptr arguments
-        REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateReferences(nullptr), MgNullArgumentException);
 
         //Get the content of the resource that was added in TestCase_SetResource
         byteReader = pService->EnumerateReferences(&resourceIdentifier);
@@ -1081,13 +1081,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_ChangeResourceOwner", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1101,14 +1101,14 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to change the user using nullptr arguments
-            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(nullptr, L"", false), MgNullArgumentException);
 
             //Try to change the owner of a resource that doesn't exist
             //TODO: this does not throw exception, should it?
-            //REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceNotExist, adminName, false), MgResourceNotFoundException*);
+            //REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceNotExist, adminName, false), MgResourceNotFoundException);
 
             //Try to change the owner of the resource created to a user that doesn't exist
-            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceIdentifier, L"DoesNotExist", false), MgUserNotFoundException*);
+            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceIdentifier, L"DoesNotExist", false), MgUserNotFoundException);
 
             //Change the resource owner to administrator
             pService->ChangeResourceOwner(&resourceIdentifier, adminName, false);
@@ -1121,7 +1121,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceIdentifier, adminName, false), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->ChangeResourceOwner(&resourceIdentifier, adminName, false), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1144,13 +1144,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_InheritPermissionsFrom", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1164,7 +1164,7 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use a nullptr argument
-            REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(nullptr), MgNullArgumentException);
 
             //Set resources to inherit permissions
             pService->InheritPermissionsFrom(&libraryRepositoryIdentifier);
@@ -1177,7 +1177,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(&libraryRepositoryIdentifier), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->InheritPermissionsFrom(&libraryRepositoryIdentifier), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1201,13 +1201,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1218,10 +1218,10 @@
         byteReader = nullptr;
 
         //Try enumerating using a nullptr argument
-        REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResourceData(nullptr), MgNullArgumentException);
 
         //Try enumerating using a resource that doesn't exist
-        REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->EnumerateResourceData(&resourceNotExist), MgResourceNotFoundException);
 
         //Enumerate the resource data of the resource added earlier
         byteReader = pService->EnumerateResourceData(&resourceIdentifier);
@@ -1248,13 +1248,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_SetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1271,12 +1271,12 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try using a nullptr identifier
-            REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->SetResourceData(nullptr, L"", L"", nullptr), MgNullArgumentException);
 
             //Try to name the resource data with a 0 character string
             dataSource = new MgByteSource(dataFileName);
             Ptr<MgByteReader> dataReader = dataSource->GetReader();
-            REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgInvalidArgumentException*);
+            REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, L"", L"File", dataReader), MgInvalidArgumentException);
 
             //Set the resource data
             dataSource = new MgByteSource(dataFileName);
@@ -1293,7 +1293,7 @@
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
             Ptr<MgByteReader> dataReader = dataSource->GetReader();
-            REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, resourceDataName, L"File", dataReader), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->SetResourceData(&resourceIdentifier, resourceDataName, L"File", dataReader), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1316,13 +1316,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_RenameResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1336,16 +1336,16 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try using a null argument for the idenfier
-            REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->RenameResourceData(nullptr, resourceDataName, resourceDataName2, true), MgNullArgumentException);
 
             //Try using a resource identifier that doesn't exist
-            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException*);
+            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceNotExist, resourceDataName, resourceDataName2, true), MgResourceNotFoundException);
 
             //Try to use a resource data name that doesn't exist
-            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException*);
+            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, L"DoesNotExist", resourceDataName2, true), MgResourceDataNotFoundException);
 
             //Try to name the resource data with a 0 character string
-            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgInvalidArgumentException*);
+            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, L"", true), MgInvalidArgumentException);
 
             //Try to do a valid rename
             pService->RenameResourceData(&resourceIdentifier, resourceDataName, resourceDataName2, false);
@@ -1359,7 +1359,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, resourceDataName2, false), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->RenameResourceData(&resourceIdentifier, resourceDataName, resourceDataName2, false), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1382,13 +1382,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_GetResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Set the user information for the current thread to be administrator.
@@ -1399,16 +1399,16 @@
         byteReader = nullptr;
 
         //Try to get resource data using a nullptr identifier
-        REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(nullptr, resourceDataName, L""), MgNullArgumentException);
 
         //Try to get resource data using an empty data name string
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"", L""), MgInvalidArgumentException);
 
         //Try to get the resource data of a resource that does not exist
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceNotExist, resourceDataName, L""), MgResourceNotFoundException);
 
         //Try to get the resource data of a data name that doesn't exist
-        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GetResourceData(&resourceIdentifier, L"DoesNotExist", L""), MgResourceDataNotFoundException);
 
         //Get resource data using valid arguments
         byteReader = pService->GetResourceData(&resourceIdentifier, resourceDataName, L"");
@@ -1433,13 +1433,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResourceData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1453,13 +1453,13 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try using a nullptr resource identifier
-            REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->DeleteResourceData(nullptr, resourceDataName), MgNullArgumentException);
 
             //Try using an empty string for the resource data name
-            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgInvalidArgumentException*);
+            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L""), MgInvalidArgumentException);
 
             //Try deleting data that does not exist
-            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException*);
+            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, L"DoesNotExist"), MgResourceDataNotFoundException);
 
             //Delete the resource data that was set earlier
             pService->DeleteResourceData(&resourceIdentifier, resourceDataName);
@@ -1472,7 +1472,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, resourceDataName2), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->DeleteResourceData(&resourceIdentifier, resourceDataName2), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1496,19 +1496,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgFeatureService> pFeatureService = dynamic_cast<MgFeatureService*>(serviceManager->RequestService(MgServiceType::FeatureService));
         if (pFeatureService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_DeleteResource", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1522,7 +1522,7 @@
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
             //Try to use a nullptr argument
-            REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException*);
+            REQUIRE_THROWS_MG(pService->DeleteResource(nullptr), MgNullArgumentException);
 
             //Try to delete a resource that doesn't exist. We allow doing this for performance reason.
             pService->DeleteResource(&resourceNotExist);
@@ -1540,7 +1540,7 @@
         {
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
-            REQUIRE_THROWS_MG(pService->DeleteResource(&resourceIdentifier), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->DeleteResource(&resourceIdentifier), MgUnauthorizedAccessException);
         }
 
         // Try to delete resource after FDO exception
@@ -1620,13 +1620,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgResourceService> pService = dynamic_cast<MgResourceService*>(serviceManager->RequestService(MgServiceType::ResourceService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestResourceService.TestCase_EnumerateUnmanagedData", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Try to enumerate mappings

Modified: trunk/MgDev/Server/src/UnitTesting/TestServerAdminService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestServerAdminService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestServerAdminService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -47,13 +47,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_TakeOffline", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_TakeOffline", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_TakeOffline", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_TakeOffline", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         pService->TakeOffline();
@@ -85,13 +85,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_BringOnline", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_BringOnline", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_BringOnline", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_BringOnline", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         pService->BringOnline();
@@ -123,13 +123,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = MgServerManager::GetInstance()->GetConfigurationProperties(L"GeneralProperties");
@@ -166,13 +166,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_SetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_SetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_SetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_SetConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"GeneralProperties");
@@ -215,13 +215,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_RemoveConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_RemoveConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_RemoveConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_RemoveConfigurationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // add a property to unmanaged data mappings
@@ -273,13 +273,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_ClearLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_ClearLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_ClearLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_ClearLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         REQUIRE(pService->ClearLog(MgLogFileType::Access));
@@ -288,7 +288,7 @@
         REQUIRE(pService->ClearLog(MgLogFileType::Error));
         REQUIRE(pService->ClearLog(MgLogFileType::Session));
         REQUIRE(pService->ClearLog(MgLogFileType::Trace));
-        REQUIRE_THROWS_MG(pService->ClearLog(L"Invalid"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->ClearLog(L"Invalid"), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -316,13 +316,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_GetLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_GetLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_GetLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_GetLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -345,7 +345,7 @@
         byteReader = pService->GetLog(MgLogFileType::Trace);
         REQUIRE(byteReader.p != nullptr);
 
-        REQUIRE_THROWS_MG(pService->GetLog(L"Invalid"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetLog(L"Invalid"), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -373,13 +373,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -402,7 +402,7 @@
         byteReader = pService->GetLog(MgLogFileType::Trace, 3);
         REQUIRE(byteReader.p != nullptr);
 
-        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, -1), MgArgumentOutOfRangeException*);
+        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, -1), MgArgumentOutOfRangeException);
     }
     catch(MgException* e)
     {
@@ -430,13 +430,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_GetLogEntries", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -463,10 +463,10 @@
         byteReader = pService->GetLog(MgLogFileType::Trace, dateTime1, dateTime2);
         REQUIRE(byteReader.p != nullptr);
 
-        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime1, nullptr), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime2, dateTime1), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime1, dateTime3), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, invalidDateTime, dateTime2), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime1, nullptr), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime2, dateTime1), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, dateTime1, dateTime3), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetLog(MgLogFileType::Access, invalidDateTime, dateTime2), MgInvalidArgumentException);
     }
     catch(MgException* e)
     {
@@ -493,13 +493,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection = MgServerManager::GetInstance()->GetInformationProperties();
@@ -530,13 +530,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_EnumeratePackages", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_EnumeratePackages", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_EnumeratePackages", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_EnumeratePackages", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -583,13 +583,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_LoadPackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_LoadPackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_LoadPackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_LoadPackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -645,13 +645,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_MakePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_MakePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_MakePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_MakePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -687,19 +687,22 @@
 
         REQUIRE(packages->Contains(PACKAGE_NAME_2));
     }
-    catch(MgFileIoException* e)
+    catch (MgException* e)
     {
-        STRING message = e->GetDetails(TEST_LOCALE);
-        SAFE_RELEASE(e);
-        ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+        {
+            STRING message = e->GetDetails(TEST_LOCALE);
+            SAFE_RELEASE(e);
+            ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+        }
+        else 
+        {
+            STRING message = e->GetExceptionMessage(TEST_LOCALE);
+            message += e->GetStackTrace(TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
-    catch(MgException* e)
-    {
-        STRING message = e->GetExceptionMessage(TEST_LOCALE);
-        message += e->GetStackTrace(TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
-    }
     catch(...)
     {
         throw;
@@ -718,13 +721,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetPackageLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetPackageLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetPackageLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetPackageLog", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -772,13 +775,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetPackageStatus", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetPackageStatus", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetPackageStatus", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetPackageStatus", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -826,13 +829,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_DeletePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_DeletePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_DeletePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_DeletePackage", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgPropertyCollection> pPropertyCollection1 = pService->GetConfigurationProperties(L"ResourceServiceProperties");
@@ -883,13 +886,13 @@
 //        MgServiceManager* serviceMan = MgServiceManager::GetInstance();
 //        if (serviceMan == nullptr)
 //        {
-//            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+//            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
 //        }
 //
 //        Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
 //        if (pService == nullptr)
 //        {
-//            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+//            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
 //        }
 //
 //    }
@@ -918,13 +921,13 @@
 //        MgServiceManager* serviceMan = MgServiceManager::GetInstance();
 //        if (serviceMan == nullptr)
 //        {
-//            throw new MgNullReferenceException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+//            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
 //        }
 //
 //        Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
 //        if (pService == nullptr)
 //        {
-//            throw new MgServiceNotAvailableException(L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
+//            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService::TestCase_GetInformationProperties", __LINE__, __WFILE__, nullptr, L"", nullptr);
 //        }
 //    }
 //    catch(MgException* e)
@@ -953,23 +956,23 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_GetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_GetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_GetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_GetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
 
         // Give invalid document
-        REQUIRE_THROWS_MG(pService->GetDocument(L""), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetDocument(L":test"), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:..test"), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:test\\"), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:/test"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->GetDocument(L""), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetDocument(L":test"), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:..test"), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:test\\"), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->GetDocument(L"Wms:/test"), MgInvalidArgumentException);
 
         // Check to see if the path exists before trying to get document
         STRING path;
@@ -1015,13 +1018,13 @@
         MgServiceManager* serviceMan = MgServiceManager::GetInstance();
         if (serviceMan == nullptr)
         {
-            throw new MgNullReferenceException(L"TestServerAdminService.TestCase_SetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestServerAdminService.TestCase_SetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerAdminService> pService = dynamic_cast<MgServerAdminService*>(serviceMan->RequestService(MgServiceType::ServerAdminService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestServerAdminService.TestCase_SetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestServerAdminService.TestCase_SetDocument", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Check to see if the path exists before trying to set document

Modified: trunk/MgDev/Server/src/UnitTesting/TestServiceFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestServiceFactory.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestServiceFactory.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -1622,18 +1622,21 @@
                 Ptr<MgResourceIdentifier> mdfres5 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestTileSet.TileSetDefinition");
                 svcResource->DeleteResource(mdfres5);
             }
-            catch (MgFileIoException* e)
-            {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
-            }
             catch (MgException* e)
             {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+                }
+                else
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                }
             }
             catch (...)
             {
@@ -1902,18 +1905,21 @@
                 Ptr<MgResourceIdentifier> wdfres1 = new MgResourceIdentifier(L"Library://UnitTests/Watermarks/PoweredByMapGuide.WatermarkDefinition");
                 svcResource->DeleteResource(wdfres1);
             }
-            catch (MgFileIoException* e)
-            {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
-            }
             catch (MgException* e)
             {
-                STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-                message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
-                SAFE_RELEASE(e);
-                FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    ACE_DEBUG((LM_INFO, ACE_TEXT("\nMgFileIoException - Possible file permission error.\nError: %W\n"), message.c_str()));
+                }
+                else
+                {
+                    STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+                    message += e->GetStackTrace(TestServiceFactory::TEST_LOCALE);
+                    SAFE_RELEASE(e);
+                    FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+                }
             }
             catch (...)
             {

Modified: trunk/MgDev/Server/src/UnitTesting/TestSiteService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestSiteService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestSiteService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -56,19 +56,19 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_AddUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_AddUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_AddUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_AddUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to add a user with empty strings
-        REQUIRE_THROWS_MG(pService->AddUser(L"", L"username", L"password", L"description"), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"", L"password", L"description"), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"username", L"", L"description"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->AddUser(L"", L"username", L"password", L"description"), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"", L"password", L"description"), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"username", L"", L"description"), MgInvalidArgumentException);
 
         //Add 2 new users
         pService->AddUser(userId1, L"TestUser1", L"TestPassword1", L"This is a test user");
@@ -75,7 +75,7 @@
         pService->AddUser(userId2, L"TestUser2", L"TestPassword2", L"This is another test user");
 
         //Try to add an already existing user id
-        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"TestUser1", L"TestPassword1", L"This is a test user"), MgDuplicateUserException*);
+        REQUIRE_THROWS_MG(pService->AddUser(userId1, L"TestUser1", L"TestPassword1", L"This is a test user"), MgDuplicateUserException);
     }
     catch(MgException* e)
     {
@@ -102,13 +102,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_EnumerateUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_EnumerateUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_EnumerateUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_EnumerateUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -148,23 +148,23 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_UpdateUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_UpdateUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_UpdateUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_UpdateUser", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to update user with empty strings
-        REQUIRE_THROWS_MG(pService->UpdateUser(L"", L"", L"username", L"password", L"description"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->UpdateUser(L"", L"", L"username", L"password", L"description"), MgInvalidArgumentException);
 
         //Try to update a user that does not exist
-        REQUIRE_THROWS_MG(pService->UpdateUser(L"DoesNotExist", L"", L"username", L"password", L"description"), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->UpdateUser(L"DoesNotExist", L"", L"username", L"password", L"description"), MgUserNotFoundException);
 
         //Try to change the user id to one that already exists
-        REQUIRE_THROWS_MG(pService->UpdateUser(userId1, userId1, L"newUsername", L"newPassword", L"newDescription"), MgDuplicateUserException*);
+        REQUIRE_THROWS_MG(pService->UpdateUser(userId1, userId1, L"newUsername", L"newPassword", L"newDescription"), MgDuplicateUserException);
 
         //Update the user that was created earlier
         pService->UpdateUser(userId1, L"", L"newUsername", L"newPassword", L"newDescription");
@@ -194,17 +194,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_AddGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_AddGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_AddGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_AddGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to add an empty group name
-        REQUIRE_THROWS_MG(pService->AddGroup(L"", L"This will throw an exception"), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->AddGroup(L"", L"This will throw an exception"), MgInvalidArgumentException);
 
         //Add a new group
         pService->AddGroup(groupName1, L"This is a group used for testing");
@@ -211,7 +211,7 @@
         pService->AddGroup(groupName2, L"This is a second group used for testing");
 
         //Try to add the group again
-        REQUIRE_THROWS_MG(pService->AddGroup(groupName1, L"This is a duplicate group"), MgDuplicateGroupException*);
+        REQUIRE_THROWS_MG(pService->AddGroup(groupName1, L"This is a duplicate group"), MgDuplicateGroupException);
     }
     catch(MgException* e)
     {
@@ -239,13 +239,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_GrantGroupMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_GrantGroupMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_GrantGroupMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_GrantGroupMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> groupCollection = new MgStringCollection();
@@ -252,8 +252,8 @@
         Ptr<MgStringCollection> userCollection = new MgStringCollection();
 
         //Try to use nullptr arguments
-        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(nullptr, userCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(nullptr, userCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, nullptr), MgNullArgumentException);
 
         //Make both new users members of first group
         groupCollection->Add(groupName1);
@@ -272,13 +272,13 @@
         groupCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         userCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, userCollection), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, userCollection), MgUserNotFoundException);
 
         //Try with a group that doesn't exist
         groupCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         groupCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, userCollection), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GrantGroupMembershipsToUsers(groupCollection, userCollection), MgGroupNotFoundException);
     }
     catch(MgException* e)
     {
@@ -305,13 +305,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_GrantRoleMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_GrantRoleMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_GrantRoleMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_GrantRoleMembershipsToUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -320,14 +320,14 @@
         //Try using nullptr arguments
         roleCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(nullptr, userCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(nullptr, userCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, nullptr), MgNullArgumentException);
 
         //Try using with a user that does not exist
         roleCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         userCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, userCollection), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, userCollection), MgUserNotFoundException);
 
         //Try to give the role viewer to one of the newly created users
         roleCollection = new MgStringCollection();
@@ -334,7 +334,7 @@
         userCollection = new MgStringCollection();
         roleCollection->Add(MgRole::Viewer);
         userCollection->Add(userId1);
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, userCollection), MgInvalidOperationException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToUsers(roleCollection, userCollection), MgInvalidOperationException);
 
         //Give the role of author to one of the newly created users
         roleCollection = new MgStringCollection();
@@ -368,13 +368,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_GrantRoleMembershipsToGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_GrantRoleMembershipsToGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_GrantRoleMembershipsToGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_GrantRoleMembershipsToGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -383,14 +383,14 @@
         //Try using nullptr arguments
         roleCollection = new MgStringCollection();
         groupCollection = new MgStringCollection();
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(nullptr, groupCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(nullptr, groupCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, nullptr), MgNullArgumentException);
 
         //Try using with a group that does not exist
         roleCollection = new MgStringCollection();
         groupCollection = new MgStringCollection();
         groupCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, groupCollection), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, groupCollection), MgGroupNotFoundException);
 
         //Try to give the role viewer to one of the newly created groups
         roleCollection = new MgStringCollection();
@@ -397,7 +397,7 @@
         groupCollection = new MgStringCollection();
         roleCollection->Add(MgRole::Viewer);
         groupCollection->Add(groupName1);
-        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, groupCollection), MgInvalidOperationException*);
+        REQUIRE_THROWS_MG(pService->GrantRoleMembershipsToGroups(roleCollection, groupCollection), MgInvalidOperationException);
 
         //Give the role of administrator to one of the newly created groups
         roleCollection = new MgStringCollection();
@@ -431,23 +431,23 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_UpdateGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_UpdateGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_UpdateGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_UpdateGroup", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to update using an empty string for group name
-        REQUIRE_THROWS_MG(pService->UpdateGroup(L"", L"", L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->UpdateGroup(L"", L"", L""), MgInvalidArgumentException);
 
         //Try to update a group that does not exist
-        REQUIRE_THROWS_MG(pService->UpdateGroup(L"DoesNotExist", L"", L"description for non-existing group"), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->UpdateGroup(L"DoesNotExist", L"", L"description for non-existing group"), MgGroupNotFoundException);
 
         //Try to change the group name to something that already exists
-        REQUIRE_THROWS_MG(pService->UpdateGroup(groupName1, groupName1, L"This shouldn't work since we'll have a duplicate group name"), MgDuplicateGroupException*);
+        REQUIRE_THROWS_MG(pService->UpdateGroup(groupName1, groupName1, L"This shouldn't work since we'll have a duplicate group name"), MgDuplicateGroupException);
 
         //Update group description for first group
         pService->UpdateGroup(groupName1, L"", L"new description for this group used for testing");
@@ -480,13 +480,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_EnumerateGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_EnumerateGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_EnumerateGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_EnumerateGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -532,13 +532,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_EnumerateRoles", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_EnumerateRoles", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_EnumerateRoles", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_EnumerateRoles", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -545,7 +545,7 @@
         INT32 collSize;
 
         //Try to enumerate roles by specifying both a user and group
-        REQUIRE_THROWS_MG(pService->EnumerateRoles(userId1, groupName1), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->EnumerateRoles(userId1, groupName1), MgInvalidArgumentException);
 
         //Enumerate the roles of a user
         roleCollection = pService->EnumerateRoles(userId1, L"");
@@ -592,13 +592,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_RevokeGroupMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_RevokeGroupMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_RevokeGroupMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_RevokeGroupMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> groupCollection = new MgStringCollection();
@@ -605,8 +605,8 @@
         Ptr<MgStringCollection> userCollection = new MgStringCollection();
 
         //Try to use nullptr arguments
-        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(nullptr, userCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(nullptr, userCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, nullptr), MgNullArgumentException);
 
         //Remove both new users from first group
         groupCollection->Add(groupName1);
@@ -618,13 +618,13 @@
         groupCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         userCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, userCollection), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, userCollection), MgUserNotFoundException);
 
         //Try with a group that doesn't exist
         groupCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         groupCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, userCollection), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RevokeGroupMembershipsFromUsers(groupCollection, userCollection), MgGroupNotFoundException);
     }
     catch(MgException* e)
     {
@@ -651,13 +651,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_RevokeRoleMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_RevokeRoleMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_RevokeRoleMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_RevokeRoleMembershipsFromUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -666,14 +666,14 @@
         //Try using nullptr arguments
         roleCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(nullptr, userCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(nullptr, userCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, nullptr), MgNullArgumentException);
 
         //Try using with a user that does not exist
         roleCollection = new MgStringCollection();
         userCollection = new MgStringCollection();
         userCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, userCollection), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, userCollection), MgUserNotFoundException);
 
         //Try to take away the role viewer from one of the newly created users
         roleCollection = new MgStringCollection();
@@ -680,7 +680,7 @@
         userCollection = new MgStringCollection();
         roleCollection->Add(MgRole::Viewer);
         userCollection->Add(userId1);
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, userCollection), MgInvalidOperationException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromUsers(roleCollection, userCollection), MgInvalidOperationException);
 
         //Take away role of author from one of the newly created users
         roleCollection = new MgStringCollection();
@@ -714,13 +714,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_RevokeRoleMembershipsFromGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_RevokeRoleMembershipsFromGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_RevokeRoleMembershipsFromGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_RevokeRoleMembershipsFromGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -729,14 +729,14 @@
         //Try using nullptr arguments
         roleCollection = new MgStringCollection();
         groupCollection = new MgStringCollection();
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(nullptr, groupCollection), MgNullArgumentException*);
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(nullptr, groupCollection), MgNullArgumentException);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, nullptr), MgNullArgumentException);
 
         //Try using with a group that does not exist
         roleCollection = new MgStringCollection();
         groupCollection = new MgStringCollection();
         groupCollection->Add(L"DoesNotExist");
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, groupCollection), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, groupCollection), MgGroupNotFoundException);
 
         //Try to give the role viewer to one of the newly created groups
         roleCollection = new MgStringCollection();
@@ -743,7 +743,7 @@
         groupCollection = new MgStringCollection();
         roleCollection->Add(MgRole::Viewer);
         groupCollection->Add(groupName1);
-        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, groupCollection), MgInvalidOperationException*);
+        REQUIRE_THROWS_MG(pService->RevokeRoleMembershipsFromGroups(roleCollection, groupCollection), MgInvalidOperationException);
 
         //Give the role of administrator to one of the newly created groups
         roleCollection = new MgStringCollection();
@@ -777,17 +777,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_DeleteUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_DeleteUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_DeleteUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_DeleteUsers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try using a nullptr argument
-        REQUIRE_THROWS_MG(pService->DeleteUsers(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->DeleteUsers(nullptr), MgNullArgumentException);
 
         //Delete the two users added earlier
         MgStringCollection userCollection;
@@ -796,7 +796,7 @@
         pService->DeleteUsers(&userCollection);
 
         //Try to delete again now that users shouldn't exist
-        REQUIRE_THROWS_MG(pService->DeleteUsers(&userCollection), MgUserNotFoundException*);
+        REQUIRE_THROWS_MG(pService->DeleteUsers(&userCollection), MgUserNotFoundException);
     }
     catch(MgException* e)
     {
@@ -823,17 +823,17 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_DeleteGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_DeleteGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_DeleteGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_DeleteGroups", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try to use a nullptr argument
-        REQUIRE_THROWS_MG(pService->DeleteGroups(nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(pService->DeleteGroups(nullptr), MgNullArgumentException);
 
         MgStringCollection groupCollection;
         groupCollection.Add(groupName1);
@@ -843,7 +843,7 @@
         pService->DeleteGroups(&groupCollection);
 
         //Try to delete again, the groups should no longer exist
-        REQUIRE_THROWS_MG(pService->DeleteGroups(&groupCollection), MgGroupNotFoundException*);
+        REQUIRE_THROWS_MG(pService->DeleteGroups(&groupCollection), MgGroupNotFoundException);
     }
     catch(MgException* e)
     {
@@ -863,13 +863,10 @@
 ///
 /// This test case adds a new server
 ///----------------------------------------------------------------------------
-#ifdef _WIN32
-//FIXME: On Windows, it appears ACE is actually validating the hostname/IP given
+
+//FIXME: It appears ACE is actually validating the hostname/IP given
 //so we can't put in fake hostnames/IPs for the purpose of exercising this API
 TEST_CASE("AddServer", "[Broken]")
-#else
-TEST_CASE("AddServer", "[SiteService]")
-#endif
 {
     //TODO: does not throw exceptions described in MgServerSiteService.cpp
     try
@@ -877,18 +874,18 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_AddServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_AddServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_AddServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_AddServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Try using empty string arguments
-        REQUIRE_THROWS_MG(pService->AddServer(L"", L"", serverAddress1), MgInvalidArgumentException*);
-        REQUIRE_THROWS_MG(pService->AddServer(serverName1, L"", L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->AddServer(L"", L"", serverAddress1), MgInvalidArgumentException);
+        REQUIRE_THROWS_MG(pService->AddServer(serverName1, L"", L""), MgInvalidArgumentException);
 
         // Disable ACE's ERROR message for the server name
         #ifdef _DEBUG
@@ -909,7 +906,7 @@
         #endif
 
         //Try adding the server again
-        REQUIRE_THROWS_MG(pService->AddServer(serverName1, L"This is a test server", serverAddress1), MgDuplicateServerException*);
+        REQUIRE_THROWS_MG(pService->AddServer(serverName1, L"This is a test server", serverAddress1), MgDuplicateServerException);
     }
     catch(MgException* e)
     {
@@ -936,13 +933,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_EnumerateServers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_EnumerateServers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_EnumerateServers", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_EnumerateServers", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgByteReader> byteReader;
@@ -970,13 +967,10 @@
 ///
 /// This test case updates the description of the server that was added
 ///----------------------------------------------------------------------------
-#ifdef _WIN32
-//FIXME: On Windows, it appears ACE is actually validating the hostname/IP given
+
+//FIXME: It appears ACE is actually validating the hostname/IP given
 //so we can't put in fake hostnames/IPs for the purpose of exercising this API
 TEST_CASE("UpdateServer", "[Broken]")
-#else
-TEST_CASE("UpdateServer", "[SiteService]")
-#endif
 {
     //TODO: does not throw exceptions described in MgServerSiteService.cpp
     try
@@ -984,13 +978,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_UpdateServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_UpdateServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_UpdateServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_UpdateServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         // Disable ACE's ERROR message for the server name
@@ -1001,14 +995,14 @@
         #endif
 
         //Try using a blank string for the name of the server
-        REQUIRE_THROWS_MG(pService->UpdateServer(L"", L"", L"", L""), MgInvalidArgumentException*);
+        REQUIRE_THROWS_MG(pService->UpdateServer(L"", L"", L"", L""), MgInvalidArgumentException);
 
         //Try to update a server that doesn't exist
-        REQUIRE_THROWS_MG(pService->UpdateServer(L"DoesNotExist", L"", L"This server doesn't exist", L""), MgServerNotFoundException*);
+        REQUIRE_THROWS_MG(pService->UpdateServer(L"DoesNotExist", L"", L"This server doesn't exist", L""), MgServerNotFoundException);
 
         //Try to update a server giving it aname that already exists
-        REQUIRE_THROWS_MG(pService->UpdateServer(serverName1, serverName2, L"The new name for the server already exists", L""), MgDuplicateServerException*);
-        REQUIRE_THROWS_MG(pService->UpdateServer(serverName1, L"", L"The new name for the server already exists", serverAddress2), MgDuplicateServerException*);
+        REQUIRE_THROWS_MG(pService->UpdateServer(serverName1, serverName2, L"The new name for the server already exists", L""), MgDuplicateServerException);
+        REQUIRE_THROWS_MG(pService->UpdateServer(serverName1, L"", L"The new name for the server already exists", serverAddress2), MgDuplicateServerException);
 
         //Update the server description
         pService->UpdateServer(serverName1, L"", L"This is the updated description", L"");
@@ -1038,13 +1032,10 @@
 ///
 /// This test case removes the server that was added before
 ///----------------------------------------------------------------------------
-#ifdef _WIN32
-//FIXME: On Windows, it appears ACE is actually validating the hostname/IP given
+
+//FIXME: It appears ACE is actually validating the hostname/IP given
 //so we can't put in fake hostnames/IPs for the purpose of exercising this API
 TEST_CASE("RemoveServer", "[Broken]")
-#else
-TEST_CASE("RemoveServer", "[SiteService]")
-#endif
 {
     //TODO: does not throw exceptions described in MgServerSiteService.cpp
     try
@@ -1052,13 +1043,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_RemoveServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_RemoveServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_RemoveServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_RemoveServer", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         //Delete the servers that were added earlier
@@ -1066,7 +1057,7 @@
         pService->RemoveServer(serverName2);
 
         //Try to delete a server that doesn't exist
-        REQUIRE_THROWS_MG(pService->RemoveServer(L"DoesNotExist"), MgServerNotFoundException*);
+        REQUIRE_THROWS_MG(pService->RemoveServer(L"DoesNotExist"), MgServerNotFoundException);
     }
     catch(MgException* e)
     {
@@ -1093,13 +1084,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_Authenticate", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_Authenticate", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_Authenticate", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_Authenticate", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgStringCollection> roleCollection;
@@ -1106,17 +1097,17 @@
         Ptr<MgUserInformation> userInfo;
 
         //Try to use a nullptr argument
-        REQUIRE_THROWS_MG(pService->Authenticate(nullptr, nullptr, false), MgAuthenticationFailedException*);
+        REQUIRE_THROWS_MG(pService->Authenticate(nullptr, nullptr, false), MgAuthenticationFailedException);
 
         //Try to authenticate an anonymous user when admin role is needed
         userInfo = new MgUserInformation(anonymousName, L"");
         roleCollection = new MgStringCollection();
         roleCollection->Add(MgRole::Administrator);
-        REQUIRE_THROWS_MG(pService->Authenticate(userInfo, roleCollection, false), MgUnauthorizedAccessException*);
+        REQUIRE_THROWS_MG(pService->Authenticate(userInfo, roleCollection, false), MgUnauthorizedAccessException);
 
         //Try to authenticate when an incorrect password is given
         userInfo = new MgUserInformation(adminName, L"");
-        REQUIRE_THROWS_MG(pService->Authenticate(userInfo, nullptr, false), MgAuthenticationFailedException*);
+        REQUIRE_THROWS_MG(pService->Authenticate(userInfo, nullptr, false), MgAuthenticationFailedException);
 
         //Authenticate an anonymous user that has appropriate access
         userInfo = new MgUserInformation(anonymousName, L"");
@@ -1159,13 +1150,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_CreateSession", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_CreateSession", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_CreateSession", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_CreateSession", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1207,13 +1198,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_DestroySession", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_DestroySession", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_DestroySession", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_DestroySession", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgUserInformation> userInfo;
@@ -1229,7 +1220,7 @@
             // Destroy the session that should have been created earlier in the create session test case
             pService->DestroySession(session);
 
-            REQUIRE_THROWS_MG(pService->DestroySession(session), MgRepositoryNotFoundException*);
+            REQUIRE_THROWS_MG(pService->DestroySession(session), MgRepositoryNotFoundException);
         }
 
         MgUserInformation::SetCurrentUserInfo(nullptr);
@@ -1239,7 +1230,7 @@
             userInfo->SetLocale(userLocale);
             MgUserInformation::SetCurrentUserInfo(userInfo);
 
-            REQUIRE_THROWS_MG(pService->DestroySession(session), MgUnauthorizedAccessException*);
+            REQUIRE_THROWS_MG(pService->DestroySession(session), MgUnauthorizedAccessException);
         }
     }
     catch(MgException* e)
@@ -1266,13 +1257,13 @@
         MgServiceManager* serviceManager = MgServiceManager::GetInstance();
         if (serviceManager == nullptr)
         {
-            throw new MgNullReferenceException(L"TestSiteService.TestCase_GetSessionTimeout", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgNullReferenceException, L"TestSiteService.TestCase_GetSessionTimeout", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         Ptr<MgServerSiteService> pService = dynamic_cast<MgServerSiteService*>(serviceManager->RequestService(MgServiceType::SiteService));
         if (pService == nullptr)
         {
-            throw new MgServiceNotAvailableException(L"TestSiteService.TestCase_GetSessionTimeout", __LINE__, __WFILE__, nullptr, L"", nullptr);
+            throw new MgException(MgExceptionCodes::MgServiceNotAvailableException, L"TestSiteService.TestCase_GetSessionTimeout", __LINE__, __WFILE__, nullptr, L"", nullptr);
         }
 
         INT32 timeoutValue = pService->GetSessionTimeout();

Modified: trunk/MgDev/Server/src/UnitTesting/TestTileService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestTileService.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Server/src/UnitTesting/TestTileService.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -346,16 +346,19 @@
         // clear the user info to prevent leaks
         MgUserInformation::SetCurrentUserInfo(nullptr);
     }
-    catch (MgFileIoException* e)
-    {
-        // we sometimes get this due to a sharing error
-        SAFE_RELEASE(e);
-    }
     catch (MgException* e)
     {
-        STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
-        SAFE_RELEASE(e);
-        FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        if (e->GetExceptionCode() == MgExceptionCodes::MgFileIoException)
+        {
+            // we sometimes get this due to a sharing error
+            SAFE_RELEASE(e);
+        }
+        else
+        {
+            STRING message = e->GetDetails(TestServiceFactory::TEST_LOCALE);
+            SAFE_RELEASE(e);
+            FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+        }
     }
     catch (...)
     {
@@ -1041,7 +1044,7 @@
         Ptr<MgTileService> m_svcTile = TestServiceFactory::CreateTileService();
 
         // call the API with a nullptr argument
-        REQUIRE_THROWS_MG(m_svcTile->ClearCache((MgMap*)nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(m_svcTile->ClearCache((MgMap*)nullptr), MgNullArgumentException);
 
         // call the API with a map having a different name
         Ptr<MgMap> map = CreateMap(m_siteConnection, L"blah");
@@ -1201,7 +1204,7 @@
         Ptr<MgTileService> m_svcTile = TestServiceFactory::CreateTileService();
 
         // call the API with a nullptr argument
-        REQUIRE_THROWS_MG(m_svcTile->ClearCache((MgResourceIdentifier*)nullptr), MgNullArgumentException*);
+        REQUIRE_THROWS_MG(m_svcTile->ClearCache((MgResourceIdentifier*)nullptr), MgNullArgumentException);
 
         Ptr<MgResourceIdentifier> tsId = new MgResourceIdentifier(L"Library://UnitTests/TileSets/Sheboygan.TileSetDefinition");
         m_svcTile->ClearCache(tsId);

Modified: trunk/MgDev/UnitTest/Common/FoundationTest/DotNetUnmanagedApi/catchall.code
===================================================================
--- trunk/MgDev/UnitTest/Common/FoundationTest/DotNetUnmanagedApi/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/UnitTest/Common/FoundationTest/DotNetUnmanagedApi/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, NULL, L"", NULL);
     ThrowDotNetExceptionWrapper(e);
 }

Modified: trunk/MgDev/UnitTest/Common/FoundationTest/FoundationTest.cpp
===================================================================
--- trunk/MgDev/UnitTest/Common/FoundationTest/FoundationTest.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/UnitTest/Common/FoundationTest/FoundationTest.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,10 +63,17 @@
     {
         config->SetProperties(L"GeneralProperties", propCol);
     }
-    catch (MgConfigurationException* e)
+    catch (MgException* e)
     {
-        failed = true;
-        e->Release();
+        if (e->GetExceptionCodes() == MgExceptionCodes::MgConfigurationException)
+        {
+            failed = true;
+            e->Release();
+        }
+        else
+        {
+            e->Raise();
+        }
     }
 
     if (!failed)

Modified: trunk/MgDev/UnitTest/WebTier/DotNet/TestMapGuideApi/ExternalTests/MapTests.cs
===================================================================
--- trunk/MgDev/UnitTest/WebTier/DotNet/TestMapGuideApi/ExternalTests/MapTests.cs	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/UnitTest/WebTier/DotNet/TestMapGuideApi/ExternalTests/MapTests.cs	2022-10-10 09:40:18 UTC (rev 9971)
@@ -71,9 +71,9 @@
 
                 Assert.Fail("Expected MgUnsupportedTileProviderException to be thrown");
             }
-            catch (MgUnsupportedTileProviderException)
+            catch (MgException ex)
             {
-
+                Assert.AreEqual(MgException.MgUnsupportedTileProviderException, ex.GetExceptionCode());
             }
         }
     }

Modified: trunk/MgDev/Web/src/ApacheAgent/ApachePostParser.cpp
===================================================================
--- trunk/MgDev/Web/src/ApacheAgent/ApachePostParser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/ApacheAgent/ApachePostParser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -42,7 +42,7 @@
 
     if ( (rc = ap_setup_client_block(m_r, REQUEST_CHUNKED_ERROR)) != OK )
     {
-        throw new MgStreamIoException(L"ApachePostParser.Parse",
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -56,7 +56,7 @@
 
         if (totalBytes < 0 || totalBytes > (long)MAXPOSTSIZE)
         {
-            throw new MgStreamIoException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         m_pBuffer = (BYTE *)apr_pcalloc(m_r->pool, totalBytes + 1);
@@ -63,7 +63,7 @@
 
         if (NULL == m_pBuffer)
         {
-            throw new MgOutOfMemoryException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         while( (len_read = ap_get_client_block(m_r, argsbuffer, sizeof(argsbuffer))) > 0 )
@@ -166,7 +166,7 @@
     else
     {
         // Throw a better exception here?
-        throw new MgStreamIoException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"ApachePostParser.Parse");

Modified: trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp
===================================================================
--- trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/CgiAgent/CgiPostParser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
         nBytes = atoi(contentLength);
         if (nBytes < 0 || nBytes > MAXPOSTSIZE)
         {
-            throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Attempt to reuse the existing buffer if it's big enough.  If
@@ -90,7 +90,7 @@
 
             if (NULL == m_buf)
             {
-                throw new MgOutOfMemoryException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             m_bufSize = nBytes;
@@ -113,7 +113,7 @@
     if (readBytes != nBytes)
     {
         //TODO:  Better exception message?
-        throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     char* contentType = getenv(MapAgentStrings::ContentType);
@@ -289,7 +289,7 @@
         else
         {
             //TODO: throw a better exception here
-            throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -112,56 +112,7 @@
     <Header path="../../../../Common/Foundation/Data/StringProperty.h" />
 
     <Header path="../../../../Common/Foundation/Exception/Exception.h" />
-    <Header path="../../../../Common/Foundation/Exception/SystemException.h" />
-    <Header path="../../../../Common/Foundation/Exception/IoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/FileIoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/StreamIoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OutOfRangeException.h" />
 
-    <Header path="../../../../Common/Foundation/Exception/ApplicationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ArgumentOutOfRangeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ClassNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationLoadFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationSaveFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DateTimeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DecryptionException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DirectoryNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DivideByZeroException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DomainException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateDirectoryException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateFileException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateObjectException.h" />
-    <Header path="../../../../Common/Foundation/Exception/EncryptionException.h" />
-    <Header path="../../../../Common/Foundation/Exception/FileNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/IndexOutOfRangeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidArgumentException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidCastException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidOperationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidPropertyTypeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidStreamHeaderException.h" />
-    <Header path="../../../../Common/Foundation/Exception/LengthException.h" />
-    <Header path="../../../../Common/Foundation/Exception/LogicException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NotFiniteNumberException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NotImplementedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullArgumentException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullPropertyValueException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullReferenceException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ObjectNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OutOfMemoryException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OverflowException.h" />
-    <Header path="../../../../Common/Foundation/Exception/PlatformNotSupportedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourcesException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourcesLoadFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourceTagNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/RuntimeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/TemporaryFileNotAvailableException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ThirdPartyException.h" />
-    <Header path="../../../../Common/Foundation/Exception/UnclassifiedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/UnderflowException.h" />
-    <Header path="../../../../Common/Foundation/Exception/XmlException.h" />
-    <Header path="../../../../Common/Foundation/Exception/XmlParserException.h" />
-
 </Headers>
 
 </Parameters>

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -65,7 +65,7 @@
   <Class name="MgMimeType" />
   <Class name="MgPropertyType" />
   <Class name="MgFeaturePropertyType" />
-
+  <Class name="MgExceptionCodes" />
 </Classes>
 
 <!--
@@ -78,6 +78,7 @@
     <Header path="../../../../Common/Foundation/Data/FeaturePropertyType.h" />
     <Header path="../../../../Common/Foundation/Data/MimeType.h" />
     <Header path="../../../../Common/Foundation/Data/PropertyType.h" />
+    <Header path="../../../../Common/Foundation/Exception/ExceptionCodes.h" />
 </Headers>
 
 </Parameters>

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -174,17 +174,6 @@
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemTransform.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemUnitInformation.h" />
 
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemComputationFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemConversionFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemLoadFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemTransformFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/GeometryException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h" />
-
 </Headers>
 
 </Parameters>

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -90,56 +90,6 @@
 
     <!-- MapGuideCommon classes -->
 
-    <Header path="../../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DbException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/LicenseException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnknownTileProviderException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnsupportedTileProviderException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
-
     <Header path="../../../../Common/MapGuideCommon/Services/DrawingService.h" />
     <Header path="../../../../Common/MapGuideCommon/Services/DwfVersion.h" />
     <Header path="../../../../Common/MapGuideCommon/Services/FeatureInformation.h" />

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -104,29 +104,6 @@
     <Header path="../../../../Common/PlatformBase/Data/SingleProperty.h" />
     <Header path="../../../../Common/PlatformBase/Data/StringPropertyCollection.h" />
 
-    <Header path="../../../../Common/PlatformBase/Exception/ArrayTypeMismatchException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/DuplicateResourceDataException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/DuplicateResourceException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/EmptyFeatureSetException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/FdoException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/FeatureServiceException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidMapDefinitionException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidRepositoryNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidRepositoryTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceDataNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceDataTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourcePathException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourcePreProcessingTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/LayerNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceBusyException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceDataNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ServiceNotAvailableException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ServiceNotSupportedException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/UserNotFoundException.h" />
-
     <Header path="../../../../Common/PlatformBase/Services/FeatureCommand.h" />
     <Header path="../../../../Common/PlatformBase/Services/FeatureQueryOptions.h" />
     <Header path="../../../../Common/PlatformBase/Services/FeatureSourceParams.h" />

Modified: trunk/MgDev/Web/src/DotNetUnmanagedApi/catchall.code
===================================================================
--- trunk/MgDev/Web/src/DotNetUnmanagedApi/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/DotNetUnmanagedApi/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowDotNetExceptionWrapper(e);
 }

Modified: trunk/MgDev/Web/src/HttpHandler/HttpClearTileCache.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpClearTileCache.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpClearTileCache.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -62,7 +62,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpClearTileCache.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpClearTileCache.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -142,7 +142,7 @@
         version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpCreateRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -61,7 +61,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"MgHttpCreateSession.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpCreateSession.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(wkt);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(wkt);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(code);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(epsgCode);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -56,7 +56,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(library);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsIsValid.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsIsValid.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsIsValid.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(bResult);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -148,7 +148,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpCsTransformCoordinates.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -122,7 +122,7 @@
         version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpDescribeRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -54,7 +54,7 @@
         arguments.Add(MgHttpResourceStrings::reqRecursive);
         arguments.Add(recursive);
 
-        throw new MgInvalidArgumentException(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -73,7 +73,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoOperator);
         arguments.Add(m_operator);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBinaryOperation.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBinaryOperation.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
     }
 
@@ -123,7 +123,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBinaryOperation.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoBoundary.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoBoundary.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoBoundary.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBoundary.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBoundary.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
         INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBoundary.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoBuffer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoBuffer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoBuffer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -60,7 +60,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -70,7 +70,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoCoordinateSystem);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -80,7 +80,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoFormat);
         arguments.Add(m_format);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 
@@ -145,7 +145,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBuffer.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoConvexHull.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoConvexHull.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoConvexHull.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoConvexHull.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoConvexHull.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoConvexHull.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoDistance.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoDistance.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoDistance.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -44,7 +44,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoDistance.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoDistance.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -54,7 +54,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometryOther);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoDistance.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoDistance.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -117,7 +117,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoDistance.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoSimplify.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoSimplify.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoSimplify.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -59,7 +59,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSimplify.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSimplify.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -73,7 +73,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoAlgorithm);
         arguments.Add(arg);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSimplify.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSimplify.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 
@@ -127,7 +127,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoSimplify.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -67,7 +67,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoOperator);
         arguments.Add(m_operator);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSpatialPredicate.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSpatialPredicate.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
     }
 
@@ -85,7 +85,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoSpatialPredicate.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeoTessellate.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeoTessellate.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeoTessellate.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoTessellate.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoTessellate.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
         INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoTessellate.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGeometryInfo.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGeometryInfo.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGeometryInfo.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -42,7 +42,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeometryInfo.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeometryInfo.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -153,7 +153,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeometryInfo.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -74,7 +74,7 @@
         value = new MgHttpPrimitiveValue(size);
     }
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetDefaultTileSizeX.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 
@@ -95,7 +95,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDefaultTileSizeX.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -74,7 +74,7 @@
         value = new MgHttpPrimitiveValue(size);
     }
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 
@@ -95,7 +95,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDefaultTileSizeY.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -64,7 +64,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(result);
     if (!value)
-        throw new MgOutOfMemoryException(L"MgHttpGetDrawingCoordinateSpace.Exceute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetDrawingCoordinateSpace.Exceute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -54,7 +54,7 @@
     ValidateCommonParameters();
 
     // Run API command
-    throw new MgNotImplementedException(L"MgHttpGetDwfViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHttpGetDwfViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetDwfViewerPage.Execute")
 }

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -49,7 +49,7 @@
         arguments.Add(MgHttpResourceStrings::reqRenderingFormat);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetDynamicMapOverlayImage.MgHttpGetDynamicMapOverlayImage",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetDynamicMapOverlayImage.MgHttpGetDynamicMapOverlayImage",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -137,7 +137,7 @@
         version != MG_API_VERSION(2,0,0) &&
         version != MG_API_VERSION(2,1,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDynamicMapOverlayImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -54,7 +54,7 @@
     ValidateCommonParameters();
 
     // Run API command
-    throw new MgNotImplementedException(L"MgHttpGetHtmlViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHttpGetHtmlViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetHtmlViewerPage.Execute")
 }

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -63,7 +63,7 @@
     // Throw on empty class name
     if (className.empty())
     {
-        throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Create Proxy Feature Service instance
@@ -75,7 +75,7 @@
     Ptr<MgClassDefinitionCollection> idClasses = service->GetIdentityProperties(&resId, schema, classNames);
     if (idClasses.p == NULL || idClasses->GetCount() == 0)
     {
-        throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgClassDefinition> idClass = idClasses->GetItem(0);
     Ptr<MgPropertyDefinitionCollection> identityProps = idClass->GetIdentityProperties();

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetLongTransactions.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetLongTransactions.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetLongTransactions.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -52,7 +52,7 @@
         arguments.Add(L"0");
         arguments.Add(activeOnly);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetLongTransactions.MgHttpGetLongTransactions",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetLongTransactions.MgHttpGetLongTransactions",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -154,7 +154,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetMapImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetPlot.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetPlot.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetPlot.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -142,7 +142,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetPlot.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetPlot.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetSessionTimeout.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetSessionTimeout.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetSessionTimeout.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -61,7 +61,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"MgHttpGetSessionTimeout.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetSessionTimeout.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetSpatialContexts.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetSpatialContexts.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetSpatialContexts.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -50,7 +50,7 @@
         arguments.Add(L"0");
         arguments.Add(activeOnly);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetSpatialContexts.MgHttpGetSpatialContexts",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetSpatialContexts.MgHttpGetSpatialContexts",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -92,7 +92,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetTileImage.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetTileImage.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -146,7 +146,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(1,2,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetTileImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -83,7 +83,7 @@
     if (version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetTileProviders.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpKmlGetFeatures.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpKmlGetFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpKmlGetFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -110,7 +110,7 @@
         arguments.Add(L"BBOX");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpKmlGetFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpKmlGetFeatures.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpKmlGetLayer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpKmlGetLayer.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpKmlGetLayer.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -95,7 +95,7 @@
         arguments.Add(L"BBOX");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpKmlGetLayer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpKmlGetLayer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpPrimitiveValue.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpPrimitiveValue.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpPrimitiveValue.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -47,7 +47,7 @@
 MgHttpPrimitiveValue::MgHttpPrimitiveValue(CREFSTRING value)
 {
     if(!(m_value.pstr = new STRING(value)))
-        throw new MgOutOfMemoryException(L"MgHttpPrimitiveValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpPrimitiveValue", __LINE__, __WFILE__, NULL, L"", NULL);
     m_type = MgHttpPrimitiveValueTypes::HTTP_PRIMITIVE_TYPE_STRING;
 }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -128,7 +128,7 @@
             arguments.Add(L"0");
             arguments.Add(m_selectionVariant);
 
-            throw new MgInvalidArgumentException(L"MgHttpQueryMapFeatures.Execute",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpQueryMapFeatures.Execute",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
         }
     }
@@ -181,7 +181,7 @@
         version != MG_API_VERSION(2,6,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpQueryMapFeatures.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -325,7 +325,7 @@
     //find in the map the creator for the http mapping class
     MgHttpRequestResponseHandler* (*createFunc)(MgHttpRequest*) = httpClassCreators[OperationName];
     if(createFunc == NULL)
-        throw new MgInvalidOperationException(L"MgHttpRequest::CreateRequestResponseHandler", __LINE__, __WFILE__, NULL, L"", NULL);
+        new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgHttpRequest::CreateRequestResponseHandler", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //instantiate the http class
     returnHandler = (*createFunc)(this);

Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -69,7 +69,7 @@
         config->GetBoolValue(MgConfigProperties::AgentPropertiesSection, disableProperty, bDisable, false);
         if (bDisable)
         {
-            throw new MgInvalidOperationException(L"HttpRequestResponseHandler.InitializeCommonParamters", __LINE__, __WFILE__, NULL, L"", NULL);
+            new MgException(MgExceptionCodes::MgInvalidOperationException, L"HttpRequestResponseHandler.InitializeCommonParamters", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -198,7 +198,7 @@
     // will eat up one of the servers and give uneven load balancing.
     if (m_userInfo->GetUserName().empty() && m_userInfo->GetMgSessionId().empty())
     {
-        throw new MgAuthenticationFailedException(L"MgHttpRequestResponseHandler.InitializeCommonParameters", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, L"MgHttpRequestResponseHandler.InitializeCommonParameters", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // And create the site connection
@@ -221,7 +221,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpRequestResponseHandler.ValidateCommonParameters",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpRequestResponseHandler.ValidateCommonParameters",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -246,7 +246,7 @@
         version != MG_API_VERSION(2,2,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpRequestResponseHandler.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceExists.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceExists.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceExists.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -80,7 +80,7 @@
 
     if (NULL == value.p)
     {
-        throw new MgOutOfMemoryException(L"MgHttpResourceExists.Execute",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpResourceExists.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpTestConnection.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpTestConnection.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpTestConnection.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -76,7 +76,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -385,7 +385,7 @@
                         {
                             MgStringCollection args;
                             args.Add(sFeatureType);
-                            throw new MgInvalidArgumentException(L"MgHttpWfsGetFeature.AcquireResponseData", __LINE__, __WFILE__, NULL, L"MgCannotResolveFeatureSourceFromWfsTypeName", &args);
+                            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpWfsGetFeature.AcquireResponseData", __LINE__, __WFILE__, NULL, L"MgCannotResolveFeatureSourceFromWfsTypeName", &args);
                         }
                     }
                     else //Feature type name is malformed. We expected the form <namespace>:<class_name>

Modified: trunk/MgDev/Web/src/HttpHandler/HttpWmsGetMap.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWmsGetMap.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWmsGetMap.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -26,26 +26,25 @@
 
 // TODO: migrate these to a common Mg*.h header (not Ogc*.h) for use in other handlers.
 
+/////////////////////////////////////////////////////////////////////////////////////////
+//                                          The MgException* pointer var               //
+//                                          |           MgOgcWmsException::kpsz...     //
+//                                          |           |                  OgcServer&  //
+//                                          |           |                  |           //
+#define CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(exvar, ogc_exception_code,ogc_server) \
+    MgHttpUtil::LogException(exvar);                                              \
+    STRING sReport = exvar->GetExceptionMessage();                                \
+    sReport += _("<details>");                                                    \
+    sReport += exvar->GetDetails();                                               \
+    sReport += _("</details>");                                                   \
+    ogc_server.ServiceExceptionReportResponse(                                    \
+        MgOgcWmsException(MgOgcWmsException::ogc_exception_code,                  \
+                            sReport.c_str() ));                                   \
+    Ptr<MgByteReader> capabilities = responseStream.Stream().GetReader();         \
+    hResult->SetResultObject(capabilities, capabilities->GetMimeType());          \
+    SAFE_RELEASE(exvar);                                                          \
+
 ///////////////////////////////////////////////////////////////////////////////////////////////
-//                                          MgException* or derivative                       //
-//                                          |                 MgOgcWmsException::kpsz...     //
-//                                          |                 |                  OgcServer&  //
-//                                          |                 |                  |           //
-#define CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(mg_exception_type,ogc_exception_code,ogc_server)  \
-        catch (mg_exception_type* e) {                                                        \
-            MgHttpUtil::LogException(e);                                                      \
-            STRING sReport = e->GetExceptionMessage();                                        \
-            sReport += _("<details>");                                                        \
-            sReport += e->GetDetails();                                                       \
-            sReport += _("</details>");                                                       \
-            ogc_server.ServiceExceptionReportResponse(                                        \
-                MgOgcWmsException(MgOgcWmsException::ogc_exception_code,                      \
-                                  sReport.c_str() ));                                         \
-            Ptr<MgByteReader> capabilities = responseStream.Stream().GetReader();             \
-            hResult->SetResultObject(capabilities, capabilities->GetMimeType());              \
-            e->Release();                                                                     \
-        }                                                                                     \
-///////////////////////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 //                                                   MgOgcWmsException::kpsz...              //
@@ -53,7 +52,7 @@
 //                                                   |                  |                    //
 #define CATCH_ANYTHING_HANDLE_AS_OGC_WMS(methodName, ogc_exception_code,ogc_server)           \
         catch (...) {                                                                         \
-            Ptr<MgUnclassifiedException> mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+            Ptr<MgException> mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
             MgHttpUtil::LogException(mgException);                                            \
             ogc_server.ServiceExceptionReportResponse(                                        \
                 MgOgcWmsException(MgOgcWmsException::kpszInternalError,                       \
@@ -236,9 +235,21 @@
     //  Custom catch clauses.  In short, NO, we do NOT want to let MapGuide exceptions
     //  pass through.  The buck stops here, with an exception report that WE generate
     //  according to OGC specifications.
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgInvalidCoordinateSystemException,   kpszInvalidCRS,   wms)
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgCoordinateSystemLoadFailedException,kpszInvalidCRS,   wms)
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgException,                          kpszInternalError,wms)
+    catch (MgException* ex)
+    {
+        if (ex->GetExceptionCode() == MgExceptionCodes::MgInvalidCoordinateSystemException)
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInvalidCRS, wms)
+        }
+        else if (ex->GetExceptionCode() == MgExceptionCodes::MgCoordinateSystemLoadFailedException)
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInvalidCRS, wms)
+        }
+        else
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInternalError, wms)
+        }
+    }
     CATCH_ANYTHING_HANDLE_AS_OGC_WMS(L"MgHttpWmsGetMap.Execute",              kpszInternalError,wms)
 
     // Destroy the session now that we are done

Modified: trunk/MgDev/Web/src/HttpHandler/ReaderByteSourceImpl.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/ReaderByteSourceImpl.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/HttpHandler/ReaderByteSourceImpl.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -367,5 +367,5 @@
 ///
 void MgReaderByteSourceImpl::Rewind()
 {
-    throw new MgInvalidOperationException(L"MgReaderByteSourceImpl.Rewind", __LINE__, __WFILE__, NULL, L"", NULL);
+    new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgReaderByteSourceImpl.Rewind", __LINE__, __WFILE__, NULL, L"", NULL);
 }
\ No newline at end of file

Modified: trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp
===================================================================
--- trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/IsapiAgent/IsapiPostParser.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -52,7 +52,7 @@
 
     if (dwTotalBytes < 0 || dwTotalBytes > MAXPOSTSIZE)
     {
-        throw new MgStreamIoException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (dwTotalBytes > 0)
@@ -75,7 +75,7 @@
 
             if (NULL == m_pBuffer)
             {
-                throw new MgOutOfMemoryException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             m_bufSize = dwTotalBytes;
@@ -193,7 +193,7 @@
     else
     {
         // Throw a better exception here?
-        throw new MgStreamIoException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"IsapiPostParser.Parse");

Modified: trunk/MgDev/Web/src/JavaApi/catchall.code
===================================================================
--- trunk/MgDev/Web/src/JavaApi/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/JavaApi/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowJavaExceptionWrapper(jenv, e);
 }

Modified: trunk/MgDev/Web/src/JavaApiEx/catchall.code
===================================================================
--- trunk/MgDev/Web/src/JavaApiEx/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/JavaApiEx/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowJavaExceptionWrapper(jenv, e);
 }

Modified: trunk/MgDev/Web/src/MapGuideApi/Constants.xml
===================================================================
--- trunk/MgDev/Web/src/MapGuideApi/Constants.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/MapGuideApi/Constants.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -130,6 +130,7 @@
   <Class name="MgUnitType" />
   <Class name="MgPackageStatus" />
   <Class name="MgRasterDataModelType" />
+  <Class name="MgExceptionCodes" />
 </Classes>
 
 <!--
@@ -143,6 +144,7 @@
     <Header path="../../../Common/Foundation/Data/FeaturePropertyType.h" />
     <Header path="../../../Common/Foundation/Data/MimeType.h" />
     <Header path="../../../Common/Foundation/Data/PropertyType.h" />
+    <Header path="../../../Common/Foundation/Exception/ExceptionCodes.h" />
 
     <Header path="../../../Common/PlatformBase/MapLayer/LayerGroupType.h" />
     <Header path="../../../Common/PlatformBase/MapLayer/LayerType.h" />

Modified: trunk/MgDev/Web/src/MapGuideApi/MapGuideApiGen.xml
===================================================================
--- trunk/MgDev/Web/src/MapGuideApi/MapGuideApiGen.xml	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/MapGuideApi/MapGuideApiGen.xml	2022-10-10 09:40:18 UTC (rev 9971)
@@ -126,56 +126,7 @@
     <Header path="../../../Common/Foundation/Data/StringProperty.h" />
 
     <Header path="../../../Common/Foundation/Exception/Exception.h" />
-    <Header path="../../../Common/Foundation/Exception/SystemException.h" />
-    <Header path="../../../Common/Foundation/Exception/IoException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/StreamIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfRangeException.h" />
 
-    <Header path="../../../Common/Foundation/Exception/ApplicationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ArgumentOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/ClassNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationSaveFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/DateTimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/DecryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/DirectoryNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/DivideByZeroException.h" />
-    <Header path="../../../Common/Foundation/Exception/DomainException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateDirectoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateFileException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateObjectException.h" />
-    <Header path="../../../Common/Foundation/Exception/EncryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/IndexOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidCastException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidOperationException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidPropertyTypeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidStreamHeaderException.h" />
-    <Header path="../../../Common/Foundation/Exception/LengthException.h" />
-    <Header path="../../../Common/Foundation/Exception/LogicException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotFiniteNumberException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotImplementedException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullPropertyValueException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullReferenceException.h" />
-    <Header path="../../../Common/Foundation/Exception/ObjectNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfMemoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/OverflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/PlatformNotSupportedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourceTagNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/RuntimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/TemporaryFileNotAvailableException.h" />
-    <Header path="../../../Common/Foundation/Exception/ThirdPartyException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnclassifiedException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnderflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlParserException.h" />
-
     <!-- Geometry classes -->
 
     <Header path="../../../Common/Geometry/GeometricEntity.h" />
@@ -264,17 +215,6 @@
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemTransform.h" />
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemUnitInformation.h" />
 
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemComputationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemConversionFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemLoadFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemTransformFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/GeometryException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h" />
-
     <!-- PlatformBase classes -->
 
     <Header path="../../../Common/PlatformBase/Data/BlobProperty.h" />
@@ -292,29 +232,6 @@
     <Header path="../../../Common/PlatformBase/Data/SingleProperty.h" />
     <Header path="../../../Common/PlatformBase/Data/StringPropertyCollection.h" />
 
-    <Header path="../../../Common/PlatformBase/Exception/ArrayTypeMismatchException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceDataException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/EmptyFeatureSetException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FdoException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FeatureServiceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidMapDefinitionException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePathException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePreProcessingTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/LayerNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceBusyException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceDataNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotAvailableException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotSupportedException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/UserNotFoundException.h" />
-
     <Header path="../../../Common/PlatformBase/Services/FeatureCommand.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureQueryOptions.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureSourceParams.h" />
@@ -368,56 +285,6 @@
 
     <!-- MapGuideCommon classes -->
 
-    <Header path="../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DbException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/LicenseException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnknownTileProviderException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnsupportedTileProviderException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
-
     <Header path="../../../Common/MapGuideCommon/Services/DrawingService.h" />
     <Header path="../../../Common/MapGuideCommon/Services/DwfVersion.h" />
     <Header path="../../../Common/MapGuideCommon/Services/FeatureInformation.h" />

Modified: trunk/MgDev/Web/src/PhpApi/catchall.code
===================================================================
--- trunk/MgDev/Web/src/PhpApi/catchall.code	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/PhpApi/catchall.code	2022-10-10 09:40:18 UTC (rev 9971)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowPHPExceptionWrapper(e TSRMLS_CC);
 }

Modified: trunk/MgDev/Web/src/WebApp/WebCommand.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -201,7 +201,7 @@
 //
 void MgWebCommand::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgWebCommand.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgWebCommand.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -209,7 +209,7 @@
 //
 void MgWebCommand::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgWebCommand.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgWebCommand.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebApp/WebFlyoutWidget.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebFlyoutWidget.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebFlyoutWidget.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -81,7 +81,7 @@
     {
         m_subItems = new MgWebWidgetCollection();
         if (m_subItems == NULL)
-            throw new MgOutOfMemoryException(L"MgWebLayout.AddSubItems", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.AddSubItems", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_subItems->Add(item);
 }

Modified: trunk/MgDev/Web/src/WebApp/WebInvokeUrlCommand.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebInvokeUrlCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebInvokeUrlCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -28,7 +28,7 @@
     m_layers = new MgStringCollection();
 
     if(m_params == NULL || m_layers == NULL)
-        throw new MgOutOfMemoryException(L"MgWebInvokeUrlCommand.MgWebInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebInvokeUrlCommand.MgWebInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebApp/WebLayout.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebLayout.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebLayout.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -39,7 +39,7 @@
     m_informationPane = new MgWebInformationPane();
     m_contextMenu = new MgWebContextMenu();
     if (!m_commands || !m_toolBar || !m_statusBar || !m_taskPane || !m_informationPane || !m_contextMenu)
-        throw new MgOutOfMemoryException(L"MgWebLayout.MgWebLayout", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.MgWebLayout", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // get the resource service to query the web layout definition
     Ptr<MgByteReader> xmlWebLayout = resourceService->GetResourceContent(webLayoutId);
@@ -374,7 +374,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseWebLayoutDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWebLayoutDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -418,7 +418,7 @@
 
             if (!valid)
             {
-                throw new MgXmlParserException(L"MgWebLayout.GetBooleanFromElement", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.GetBooleanFromElement", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             return val;
@@ -580,11 +580,11 @@
     }
     else
     {
-        throw new MgXmlParserException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (cmd == NULL)
-        throw new MgOutOfMemoryException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 
     DOMNode* child = MgXmlUtil::GetFirstChild(elt);
     while (NULL != child)
@@ -629,7 +629,7 @@
 
     if (child == NULL)
     {
-        throw new MgXmlParserException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // continue parsing for element specifics to the various type of commands
@@ -694,7 +694,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseBuiltInCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseBuiltInCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -746,7 +746,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -755,7 +755,7 @@
                 {
                     Ptr<MgStringProperty> prop = new MgStringProperty(key, value);
                     if (prop == NULL)
-                        throw new MgOutOfMemoryException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                     params->Add(prop);
                 }
             }
@@ -777,7 +777,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -793,7 +793,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -872,7 +872,7 @@
                                     }
                                     else
                                     {
-                                        throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                                     }
                                 }
                                 lchild1 = MgXmlUtil::GetNextSibling(lchild1);
@@ -881,17 +881,17 @@
                             {
                                 Ptr<MgStringProperty> prop = new MgStringProperty(property, displayName);
                                 if (prop == NULL)
-                                    throw new MgOutOfMemoryException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                    throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                                 resultColumns->Add(prop);
                             }
                             else
                             {
-                                throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                             }
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -899,7 +899,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -939,7 +939,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseInvokeScriptCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeScriptCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -982,7 +982,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -990,7 +990,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1030,7 +1030,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseHelpCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseHelpCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1066,7 +1066,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseUiTargetCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseUiTargetCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1096,7 +1096,7 @@
         arguments.Add(L"1");
         arguments.Add(tt);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateTargetViewerType",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateTargetViewerType",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebTargetViewerType", NULL);
     }
 
@@ -1175,7 +1175,7 @@
         arguments.Add(L"1");
         arguments.Add(action);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateAction",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateAction",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebAction", NULL);
     }
 
@@ -1204,7 +1204,7 @@
         arguments.Add(L"1");
         arguments.Add(tt);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateTargetType",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateTargetType",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebTargetType", NULL);
     }
 
@@ -1261,7 +1261,7 @@
                             m_scale = GetDoubleFromElement(eltInner);
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     ichild = MgXmlUtil::GetNextSibling(ichild);
@@ -1273,7 +1273,7 @@
                 }
                 else if (centerXDefined != centerYDefined)
                 {
-                    throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
             }
             else if (strName == L"HyperlinkTarget") // NOXLATE
@@ -1286,7 +1286,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1330,7 +1330,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseInformationPane", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInformationPane", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1362,7 +1362,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseStatusBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseStatusBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1400,7 +1400,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1435,24 +1435,24 @@
                 {
                     case MgWebWidgetType::Separator:
                         if ((widget = new MgWebSeparatorWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         break;
 
                     case MgWebWidgetType::Command:
                         if ((widget = new MgWebCommandWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         ParseCommandWidget(MgXmlUtil::GetNextSibling(child), (MgWebCommandWidget*)widget.p);
                         break;
 
                     case MgWebWidgetType::Flyout:
                         if ((widget = new MgWebFlyoutWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         ParseFlyoutWidget(MgXmlUtil::GetNextSibling(child), (MgWebFlyoutWidget*)widget.p);
                         break;
 
                     default:
                     {
-                        throw new MgXmlParserException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 break;
@@ -1459,7 +1459,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1495,7 +1495,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseCommandWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommandWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1548,7 +1548,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseFlyoutWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseFlyoutWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1577,7 +1577,7 @@
         arguments.Add(L"1");
         arguments.Add(function);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateUiItemFunction",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateUiItemFunction",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebWidgetType", NULL);
     }
 
@@ -1614,7 +1614,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseContextMenu", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseContextMenu", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1658,7 +1658,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1719,7 +1719,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1765,7 +1765,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskBarButton", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskBarButton", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         ichild = MgXmlUtil::GetNextSibling(ichild);
@@ -1796,7 +1796,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseCommandSet", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommandSet", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1828,7 +1828,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseZoomControl", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseZoomControl", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);

Modified: trunk/MgDev/Web/src/WebApp/WebPrintCommand.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebPrintCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebPrintCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -25,7 +25,7 @@
     m_action = MgWebActions::PrintMap;
     m_printLayouts = new MgStringCollection();
     if(m_printLayouts == NULL)
-        throw new MgOutOfMemoryException(L"MgWebPrintCommand.MgWebPrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebPrintCommand.MgWebPrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebApp/WebSearchCommand.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebSearchCommand.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebSearchCommand.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -26,7 +26,7 @@
     m_action = MgWebActions::Search;
     m_resultColumns = new MgPropertyCollection();
     if(m_resultColumns == NULL)
-        throw new MgOutOfMemoryException(L"MgWebSearchCommand.MgWebSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebSearchCommand.MgWebSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebApp/WebTaskBar.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebTaskBar.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebTaskBar.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -23,13 +23,13 @@
 MgWebTaskBar::MgWebTaskBar()
 {
     if (!(m_taskList = new MgWebWidgetCollection()) || !(m_taskButtons = new MgWebWidgetCollection()))
-        throw new MgOutOfMemoryException(L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
 
     for (int i=0; i<4; ++i)
     {
         Ptr<MgWebTaskBarWidget> btn = new MgWebTaskBarWidget();
         if (btn == NULL)
-            throw new MgOutOfMemoryException(L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
         m_taskButtons->Add(btn);
     }
 }

Modified: trunk/MgDev/Web/src/WebApp/WebTaskPane.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebTaskPane.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebTaskPane.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -23,7 +23,7 @@
 MgWebTaskPane::MgWebTaskPane()
 {
     if (!(m_taskBar = new MgWebTaskBar()))
-        throw new MgOutOfMemoryException(L"MgWebTaskPane.MgWebTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskPane.MgWebTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebApp/WebToolbar.cpp
===================================================================
--- trunk/MgDev/Web/src/WebApp/WebToolbar.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebApp/WebToolbar.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -23,7 +23,7 @@
 MgWebToolBar::MgWebToolBar()
 {
     if (!(m_widgets = new MgWebWidgetCollection()))
-        throw new MgOutOfMemoryException(L"MgWebToolBar.MgWebToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebToolBar.MgWebToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp
===================================================================
--- trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -82,7 +82,7 @@
     //Check catalog
     if (NULL == csCatalog.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgInitializeWebTierInternal", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -102,7 +102,7 @@
     LibraryStatus status = csCatalog->GetLibraryStatus();
     if(lsInitialized != status)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgInitializeWebTierInternal", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp	2022-10-10 09:40:18 UTC (rev 9971)
@@ -549,26 +549,21 @@
     response.getWriter().write(templ);
     response.setContentLength(templ.length());
 }
-catch(MgUserNotFoundException e)
-{
-    RequestAuthentication(response);
-    return;
-}
-catch(MgUnauthorizedAccessException e)
-{
-    RequestAuthentication(response);
-    return;
-}
-catch(MgAuthenticationFailedException e)
-{
-    RequestAuthentication(response);
-    return;
-}
 catch(MgException e)
 {
-    String msg = EscapeForHtml(e.getExceptionMessage());
-    response.getWriter().write(msg);
-    response.setContentLength(msg.length());
+    if (e.GetExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException ||
+        e.GetExceptionCode() == MgExceptionCodes.MgUserNotFoundException ||
+        e.GetExceptionCode() == MgExceptionCodes.MgAuthenticationFailedException)
+    {
+        RequestAuthentication(response);
+        return;
+    }
+    else
+    {
+        String msg = EscapeForHtml(e.GetExceptionMessage());
+        response.getWriter().write(msg);
+        response.setContentLength(msg.length());
+    }
 }
 catch(Exception ne)
 {

Modified: trunk/MgDev/Web/src/mapviewernet/mainframe.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/mainframe.aspx	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/mapviewernet/mainframe.aspx	2022-10-10 09:40:18 UTC (rev 9971)
@@ -546,25 +546,20 @@
         String templ = Substitute(template, args);
         Response.Write(templ);
     }
-    catch (MgUnauthorizedAccessException)
-    {
-        RequestAuthentication();
-        return;
-    }
-    catch (MgUserNotFoundException)
-    {
-        RequestAuthentication();
-        return;
-    }
-    catch (MgAuthenticationFailedException e)
-    {
-        RequestAuthentication();
-        return;
-    }
     catch (MgException e)
     {
-        String errorMsg = EscapeForHtml(e.GetDetails());
-        Response.Write(errorMsg);
+        if (e.GetExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException ||
+            e.GetExceptionCode() == MgExceptionCodes.MgUserNotFoundException ||
+            e.GetExceptionCode() == MgExceptionCodes.MgAuthenticationFailedException)
+        {
+            RequestAuthentication();
+            return;
+        }
+        else
+        {
+            String errorMsg = EscapeForHtml(e.GetDetails());
+            Response.Write(errorMsg);
+        }
     }
     catch (Exception ne)
     {

Modified: trunk/MgDev/Web/src/mapviewerphp/mainframe.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/mainframe.php	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/mapviewerphp/mainframe.php	2022-10-10 09:40:18 UTC (rev 9971)
@@ -541,27 +541,28 @@
                     $vpath . "viewoptions.php",
                     $frameset);
     }
-    catch(MgUserNotFoundException $e)
-    {
-        requestAuthentication();
-    }
-    catch(MgAuthenticationFailedException $e)
-    {
-        requestAuthentication();
-    }
     catch(MgException $e)
     {
-        // This should be a 500 error of some sort, but
-        // in order to give a nice custom error message, it looks as
-        // if we shortcut things by using a 200 status.
-        $shortError = $e->GetExceptionMessage();
-        $longErrorMsg = EscapeForHtml($e->GetDetails());
-        header("HTTP/1.1 200 ");
-        header('Content-Type: text/html; charset=utf-8');
-        header("Status: 200 {$shortError}");
-        echo "<html>\n<body>\n";
-        echo $longErrorMsg;
-        echo "</body>\n</html>\n";
+        if ($e->GetExceptionCode() == MgExceptionCodes::MgUnauthorizedAccessException ||
+            $e->GetExceptionCode() == MgExceptionCodes::MgUserNotFoundException ||
+            $e->GetExceptionCode() == MgExceptionCodes::MgAuthenticationFailedException)
+        {
+            requestAuthentication();
+        }
+        else
+        {
+            // This should be a 500 error of some sort, but
+            // in order to give a nice custom error message, it looks as
+            // if we shortcut things by using a 200 status.
+            $shortError = $e->GetExceptionMessage();
+            $longErrorMsg = EscapeForHtml($e->GetDetails());
+            header("HTTP/1.1 200 ");
+            header('Content-Type: text/html; charset=utf-8');
+            header("Status: 200 {$shortError}");
+            echo "<html>\n<body>\n";
+            echo $longErrorMsg;
+            echo "</body>\n</html>\n";
+        }
     }
     catch(Exception $ne)
     {

Modified: trunk/MgDev/Web/src/schemareport/showclass.php
===================================================================
--- trunk/MgDev/Web/src/schemareport/showclass.php	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/schemareport/showclass.php	2022-10-10 09:40:18 UTC (rev 9971)
@@ -148,13 +148,12 @@
                 if($totalEntries>$maxEntries)
                     DisplayPaging($index, $resName, $schemaName, $className, $sessionId, $maxEntries, $currentPage, $maxPage, $lastEntry);
             }
-            catch (MgSessionExpiredException $s)
-            {
-                echo ErrorMessages::SessionExpired;
-            }
             catch (MgException $e)
             {
-                echo $e->GetExceptionMessage();
+                if ($e->GetExceptionCode() == MgExceptionCodes::MgSessionExpiredException)
+                    echo ErrorMessages::SessionExpired;
+                else
+                    echo $e->GetExceptionMessage();
             }
 
         ?>

Modified: trunk/MgDev/Web/src/schemareport/showgeom.php
===================================================================
--- trunk/MgDev/Web/src/schemareport/showgeom.php	2022-09-15 10:14:11 UTC (rev 9970)
+++ trunk/MgDev/Web/src/schemareport/showgeom.php	2022-10-10 09:40:18 UTC (rev 9971)
@@ -160,16 +160,19 @@
                 $resId = new MgResourceIdentifier($resName);
                 $resourceSrvc->SetResource($resId, $byteSource->GetReader(), null);
             }
-            catch (MgSessionExpiredException $s)
-            {
-                $validSession = 0;
-                echo ErrorMessages::SessionExpired;
-            }
             catch (MgException $mge)
             {
-                $validSession = 0;
-                echo $mge->GetExceptionMessage();
-                echo $mge->GetStackTrace();
+                if ($mge->GetExceptionCode() == MgExceptionCodes::MgSessionExpiredException)
+                {
+                    $validSession = 0;
+                    echo ErrorMessages::SessionExpired;
+                }
+                else
+                {
+                    $validSession = 0;
+                    echo $mge->GetExceptionMessage();
+                    echo $mge->GetStackTrace();
+                }
             }
             catch (Exception $e)
             {



More information about the mapguide-commits mailing list