473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

XmlSerializer instantiation error

Hello,
I hope this is the right group to post this to. I'm trying to serialize a
class I've written and I'd like to be able to serialze to both binary and
xml formats. Binary serialization is working fine but when I try to
instantiate an XmlSerializer object with:

Dim xmls As New XmlSerializer(GetType(CLayerDefinition))

I get the following error:

An unhandled exception of type 'System.InvalidOperationException' occurred
in system.xml.dll

Additional information: There was an error reflecting type
'xmlSerializeTest.CLayerDefinition'.

Can anybody give me some pointer as to why this might be happening since the
error message is not too helpful?

Thanks Steve

The class CLayerDefinition is laid out as:

<Serializable()> _
Public Class CLayerDefinition
Implements IDisposable, IComparable

#Region "Private simple objects"
Private mThemeID As Integer
Private mLayerName As String
Private mThemeName As String
Private mLocation As String
Private mDraw As Boolean
Private mMinScale As Integer
Private mMaxScale As Integer
Private mUserDefined As Boolean
Private mSaved As Boolean
Private mDrawOrder As Integer
Private mLegendType As Integer
Private mSymbolType As Integer
Private mLabelField As String
Private mHasImages As Boolean
Private mRelateTable As String
Private mTableLocation As String
Private mRelateField As String
Private mFileNameField As String
Private mClassItemField As String
Private mNumberOfBreaks As Integer
#End Region

#Region "Private complex objects"
<XmlArray()> _
Private mSymbols() As CLayerSymbol
#End Region

#Region "Public properties"
Public Property NumberOfBreaks() As Integer
Get
Return mNumberOfBreaks
End Get
Set(ByVal Value As Integer)
mNumberOfBreaks = Value
End Set
End Property

Public Property ClassItemField() As String
Get
Return mClassItemField
End Get
Set(ByVal Value As String)
mClassItemField = Value
End Set
End Property

Public Property HasImages() As Boolean
Get
Return mHasImages
End Get
Set(ByVal Value As Boolean)
mHasImages = Value
End Set
End Property

Public Property FileNameField() As String
Get
Return mFileNameField
End Get
Set(ByVal Value As String)
mFileNameField = Value
End Set
End Property

Public Property RelateField() As String
Get
Return mRelateField
End Get
Set(ByVal Value As String)
mRelateField = Value
End Set
End Property

Public Property TableLocation() As String
Get
Return mTableLocation
End Get
Set(ByVal Value As String)
mTableLocation = Value
End Set
End Property

Public Property RelateTable() As String
Get
Return mRelateTable
End Get
Set(ByVal Value As String)
mRelateTable = Value
End Set
End Property

Public Property LabelField() As String
Get
Return mLabelField
End Get
Set(ByVal Value As String)
mLabelField = Value
End Set
End Property

Public Property SymbolType() As Integer
Get
Return mSymbolType
End Get
Set(ByVal Value As Integer)
mSymbolType = Value
End Set
End Property

Public Property LegendType() As Integer
Get
Return mLegendType
End Get
Set(ByVal Value As Integer)
mLegendType = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property LayerName() As String
Get
Return mLayerName
End Get
Set(ByVal Value As String)
mLayerName = Value
End Set
End Property

Public Property ThemeName() As String
Get
Return mThemeName
End Get
Set(ByVal Value As String)
mThemeName = Value
End Set
End Property

Public Property Location() As String
Get
Return mLocation
End Get
Set(ByVal Value As String)
mLocation = Value
End Set
End Property

Public Property DrawOrder() As Integer
Get
Return mDrawOrder
End Get
Set(ByVal Value As Integer)
mDrawOrder = Value
End Set
End Property

Public Property Draw() As Boolean
Get
Return mDraw
End Get
Set(ByVal Value As Boolean)
mDraw = Value
End Set
End Property

Public Property MinScale() As Integer
Get
Return mMinScale
End Get
Set(ByVal Value As Integer)
mMinScale = Value
End Set
End Property

Public Property MaxScale() As Integer
Get
Return mMaxScale
End Get
Set(ByVal Value As Integer)
mMaxScale = Value
End Set
End Property

Public ReadOnly Property UserDefined() As Boolean
Get
Return mUserDefined
End Get
End Property

Public Property Saved() As Boolean
Get
Return mSaved
End Get
Set(ByVal Value As Boolean)
mSaved = Value
End Set
End Property

Public Property Symbols() As CLayerSymbol()
Get
Return mSymbols
End Get
Set(ByVal Value As CLayerSymbol())
mSymbols = Value
End Set
End Property
#End Region

#Region "Public member methods"
Public Sub Dispose() Implements System.IDisposable.Dispose
CleanUp()
GC.SuppressFinalize(Me)
End Sub

Public Function CompareTo(ByVal obj As Object) As Integer Implements
System.IComparable.CompareTo
If TypeOf obj Is CLayerDefinition Then
Dim cld As CLayerDefinition = DirectCast(obj, CLayerDefinition)

mDrawOrder.CompareTo(cld.mDrawOrder)
End If

Throw New ArgumentException("obj is not a CLayerDefintion type")
End Function

#End Region

#Region "Private member methods"
Private Sub CleanUp()
If Not mSymbols Is Nothing Then
If mSymbols.GetUpperBound(0) >= 0 Then
Erase mSymbols
End If
mSymbols = Nothing
End If
End Sub
#End Region

#Region "Constructors"
Public Sub New()
mUserDefined = False
End Sub

Public Sub New(ByVal usrDefined As Boolean)
mUserDefined = usrDefined
End Sub
#End Region
End Class
Nov 12 '05 #1
4 1960

Steve,

Did you read through [0]?

It explains a number of scenarios that can cause this error.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

[0]
http://msdn.microsoft.com/XML/Buildi...k/default.aspx
?pull=/library/en-us/dnxmlnet/html/trblshtxsd.asp
-----Original Message-----
From: Steve Long [mailto:St**********@NoSpam.com]
Posted At: Tuesday, February 01, 2005 3:20 PM
Posted To: microsoft.public.dotnet.xml
Conversation: XmlSerializer instantiation error
Subject: XmlSerializer instantiation error

Hello,
I hope this is the right group to post this to. I'm trying to serialize a class I've written and I'd like to be able to serialze to both binary and xml formats. Binary serialization is working fine but when I try to
instantiate an XmlSerializer object with:

Dim xmls As New XmlSerializer(GetType(CLayerDefinition))

I get the following error:

An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll

Additional information: There was an error reflecting type
'xmlSerializeTest.CLayerDefinition'.

Can anybody give me some pointer as to why this might be happening since the
error message is not too helpful?

Thanks Steve

The class CLayerDefinition is laid out as:

<Serializable()> _
Public Class CLayerDefinition
Implements IDisposable, IComparable

#Region "Private simple objects"
Private mThemeID As Integer
Private mLayerName As String
Private mThemeName As String
Private mLocation As String
Private mDraw As Boolean
Private mMinScale As Integer
Private mMaxScale As Integer
Private mUserDefined As Boolean
Private mSaved As Boolean
Private mDrawOrder As Integer
Private mLegendType As Integer
Private mSymbolType As Integer
Private mLabelField As String
Private mHasImages As Boolean
Private mRelateTable As String
Private mTableLocation As String
Private mRelateField As String
Private mFileNameField As String
Private mClassItemField As String
Private mNumberOfBreaks As Integer
#End Region

#Region "Private complex objects"
<XmlArray()> _
Private mSymbols() As CLayerSymbol
#End Region

#Region "Public properties"
Public Property NumberOfBreaks() As Integer
Get
Return mNumberOfBreaks
End Get
Set(ByVal Value As Integer)
mNumberOfBreaks = Value
End Set
End Property

Public Property ClassItemField() As String
Get
Return mClassItemField
End Get
Set(ByVal Value As String)
mClassItemField = Value
End Set
End Property

Public Property HasImages() As Boolean
Get
Return mHasImages
End Get
Set(ByVal Value As Boolean)
mHasImages = Value
End Set
End Property

Public Property FileNameField() As String
Get
Return mFileNameField
End Get
Set(ByVal Value As String)
mFileNameField = Value
End Set
End Property

Public Property RelateField() As String
Get
Return mRelateField
End Get
Set(ByVal Value As String)
mRelateField = Value
End Set
End Property

Public Property TableLocation() As String
Get
Return mTableLocation
End Get
Set(ByVal Value As String)
mTableLocation = Value
End Set
End Property

Public Property RelateTable() As String
Get
Return mRelateTable
End Get
Set(ByVal Value As String)
mRelateTable = Value
End Set
End Property

Public Property LabelField() As String
Get
Return mLabelField
End Get
Set(ByVal Value As String)
mLabelField = Value
End Set
End Property

Public Property SymbolType() As Integer
Get
Return mSymbolType
End Get
Set(ByVal Value As Integer)
mSymbolType = Value
End Set
End Property

Public Property LegendType() As Integer
Get
Return mLegendType
End Get
Set(ByVal Value As Integer)
mLegendType = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property LayerName() As String
Get
Return mLayerName
End Get
Set(ByVal Value As String)
mLayerName = Value
End Set
End Property

Public Property ThemeName() As String
Get
Return mThemeName
End Get
Set(ByVal Value As String)
mThemeName = Value
End Set
End Property

Public Property Location() As String
Get
Return mLocation
End Get
Set(ByVal Value As String)
mLocation = Value
End Set
End Property

Public Property DrawOrder() As Integer
Get
Return mDrawOrder
End Get
Set(ByVal Value As Integer)
mDrawOrder = Value
End Set
End Property

Public Property Draw() As Boolean
Get
Return mDraw
End Get
Set(ByVal Value As Boolean)
mDraw = Value
End Set
End Property

Public Property MinScale() As Integer
Get
Return mMinScale
End Get
Set(ByVal Value As Integer)
mMinScale = Value
End Set
End Property

Public Property MaxScale() As Integer
Get
Return mMaxScale
End Get
Set(ByVal Value As Integer)
mMaxScale = Value
End Set
End Property

Public ReadOnly Property UserDefined() As Boolean
Get
Return mUserDefined
End Get
End Property

Public Property Saved() As Boolean
Get
Return mSaved
End Get
Set(ByVal Value As Boolean)
mSaved = Value
End Set
End Property

Public Property Symbols() As CLayerSymbol()
Get
Return mSymbols
End Get
Set(ByVal Value As CLayerSymbol())
mSymbols = Value
End Set
End Property
#End Region

#Region "Public member methods"
Public Sub Dispose() Implements System.IDisposable.Dispose
CleanUp()
GC.SuppressFinalize(Me)
End Sub

Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
If TypeOf obj Is CLayerDefinition Then
Dim cld As CLayerDefinition = DirectCast(obj, CLayerDefinition)
mDrawOrder.CompareTo(cld.mDrawOrder)
End If

Throw New ArgumentException("obj is not a CLayerDefintion type")
End Function

#End Region

#Region "Private member methods"
Private Sub CleanUp()
If Not mSymbols Is Nothing Then
If mSymbols.GetUpperBound(0) >= 0 Then
Erase mSymbols
End If
mSymbols = Nothing
End If
End Sub
#End Region

#Region "Constructors"
Public Sub New()
mUserDefined = False
End Sub

Public Sub New(ByVal usrDefined As Boolean)
mUserDefined = usrDefined
End Sub
#End Region
End Class

Nov 12 '05 #2
Christoph,
Thanks for the link. I'm reading the document now and after looking at the
error message in more detail, it appears that my CLayerDefinition contains
another type CLayerSymbol, which contains a public property called Font
which is of type System.Font. The XmlSerializer is throwing an exception
when it tries to create this type because it does not have a default, public
constructor. Is there a way to help it do this without changing my
underlying class structure to some other type that has a default
constructor. Here's the class that it's having trouble with:

<Serializable()> _
Public Class CLayerSymbol

#Region "Private member simple objects"
Private mThemeID As Integer
Private mDescription As String
Private mFieldValue As Object
Private mStyle As String
Private mGlyphIndex As String
Private mColor As Integer
Private mSize As Integer
Private mOutlineColor As Integer
Private mOutline As Boolean
Private mFromColor As Integer
Private mToColor As Integer
Private mRotation As Integer
Private mDuplicateLabel As Boolean
Private mBold As Boolean
Private mItalic As Boolean
Private mUnderline As Boolean
Private mSpline As Boolean
Private mVerticalAlignment As Integer
Private mHorizontalAlignment As Integer
Private mFont As Font
#End Region

#Region "Properties"
Public Property font() As font
Get
Return mFont
End Get
Set(ByVal Value As font)
mFont = Value
End Set
End Property

Public Property VerticalAlignment() As Integer
Get
Return mVerticalAlignment
End Get
Set(ByVal Value As Integer)
mVerticalAlignment = Value
End Set
End Property

Public Property HorizontalAlignment() As Integer
Get
Return mHorizontalAlignment
End Get
Set(ByVal Value As Integer)
mHorizontalAlignment = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property Description() As String
Get
Return mDescription
End Get
Set(ByVal Value As String)
mDescription = Value
End Set
End Property

<System.Xml.Serialization.XmlAnyElement("FieldValu e")> _
Public Property FieldValue() As Object
Get
Return mFieldValue
End Get
Set(ByVal Value As Object)
mFieldValue = Value
End Set
End Property

Public Property Style() As Integer
Get
Return mStyle
End Get
Set(ByVal Value As Integer)
mStyle = Value
End Set
End Property

Public Property GlyphIndex() As Integer
Get
Return mGlyphIndex
End Get
Set(ByVal Value As Integer)
mGlyphIndex = Value
End Set
End Property

Public Property Color() As Integer
Get
Return mColor
End Get
Set(ByVal Value As Integer)
mColor = Value
End Set
End Property

Public Property Size() As Integer
Get
Return mSize
End Get
Set(ByVal Value As Integer)
mSize = Value
End Set
End Property

Public Property OutlineColor() As Integer
Get
Return mOutlineColor
End Get
Set(ByVal Value As Integer)
mOutlineColor = Value
End Set
End Property

Public Property Outline() As Boolean
Get
Return mOutline
End Get
Set(ByVal Value As Boolean)
mOutline = Value
End Set
End Property

Public Property FromColor() As Integer
Get
Return mFromColor
End Get
Set(ByVal Value As Integer)
mFromColor = Value
End Set
End Property

Public Property ToColor() As Integer
Get
Return mToColor
End Get
Set(ByVal Value As Integer)
mToColor = Value
End Set
End Property

Public Property Rotation() As Integer
Get
Return mRotation
End Get
Set(ByVal Value As Integer)
mRotation = Value
End Set
End Property

Public Property DuplicateLabel() As Boolean
Get
Return mDuplicateLabel
End Get
Set(ByVal Value As Boolean)
mDuplicateLabel = Value
End Set
End Property

Public Property Bold() As Boolean
Get
Return mBold
End Get
Set(ByVal Value As Boolean)
mBold = Value
End Set
End Property

Public Property Italic() As Boolean
Get
Return mItalic
End Get
Set(ByVal Value As Boolean)
mItalic = Value
End Set
End Property

Public Property Underline() As Boolean
Get
Return mUnderline
End Get
Set(ByVal Value As Boolean)
mUnderline = Value
End Set
End Property

Public Property Spline() As Boolean
Get
Return mSpline
End Get
Set(ByVal Value As Boolean)
mSpline = Value
End Set
End Property
#End Region
End Class
"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message
news:uE**************@TK2MSFTNGP14.phx.gbl...

Steve,

Did you read through [0]?

It explains a number of scenarios that can cause this error.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

[0]
http://msdn.microsoft.com/XML/Buildi...k/default.aspx
?pull=/library/en-us/dnxmlnet/html/trblshtxsd.asp
-----Original Message-----
From: Steve Long [mailto:St**********@NoSpam.com]
Posted At: Tuesday, February 01, 2005 3:20 PM
Posted To: microsoft.public.dotnet.xml
Conversation: XmlSerializer instantiation error
Subject: XmlSerializer instantiation error

Hello,
I hope this is the right group to post this to. I'm trying to

serialize a
class I've written and I'd like to be able to serialze to both binary

and
xml formats. Binary serialization is working fine but when I try to
instantiate an XmlSerializer object with:

Dim xmls As New XmlSerializer(GetType(CLayerDefinition))

I get the following error:

An unhandled exception of type 'System.InvalidOperationException'

occurred
in system.xml.dll

Additional information: There was an error reflecting type
'xmlSerializeTest.CLayerDefinition'.

Can anybody give me some pointer as to why this might be happening

since
the
error message is not too helpful?

Thanks Steve

The class CLayerDefinition is laid out as:

<Serializable()> _
Public Class CLayerDefinition
Implements IDisposable, IComparable

#Region "Private simple objects"
Private mThemeID As Integer
Private mLayerName As String
Private mThemeName As String
Private mLocation As String
Private mDraw As Boolean
Private mMinScale As Integer
Private mMaxScale As Integer
Private mUserDefined As Boolean
Private mSaved As Boolean
Private mDrawOrder As Integer
Private mLegendType As Integer
Private mSymbolType As Integer
Private mLabelField As String
Private mHasImages As Boolean
Private mRelateTable As String
Private mTableLocation As String
Private mRelateField As String
Private mFileNameField As String
Private mClassItemField As String
Private mNumberOfBreaks As Integer
#End Region

#Region "Private complex objects"
<XmlArray()> _
Private mSymbols() As CLayerSymbol
#End Region

#Region "Public properties"
Public Property NumberOfBreaks() As Integer
Get
Return mNumberOfBreaks
End Get
Set(ByVal Value As Integer)
mNumberOfBreaks = Value
End Set
End Property

Public Property ClassItemField() As String
Get
Return mClassItemField
End Get
Set(ByVal Value As String)
mClassItemField = Value
End Set
End Property

Public Property HasImages() As Boolean
Get
Return mHasImages
End Get
Set(ByVal Value As Boolean)
mHasImages = Value
End Set
End Property

Public Property FileNameField() As String
Get
Return mFileNameField
End Get
Set(ByVal Value As String)
mFileNameField = Value
End Set
End Property

Public Property RelateField() As String
Get
Return mRelateField
End Get
Set(ByVal Value As String)
mRelateField = Value
End Set
End Property

Public Property TableLocation() As String
Get
Return mTableLocation
End Get
Set(ByVal Value As String)
mTableLocation = Value
End Set
End Property

Public Property RelateTable() As String
Get
Return mRelateTable
End Get
Set(ByVal Value As String)
mRelateTable = Value
End Set
End Property

Public Property LabelField() As String
Get
Return mLabelField
End Get
Set(ByVal Value As String)
mLabelField = Value
End Set
End Property

Public Property SymbolType() As Integer
Get
Return mSymbolType
End Get
Set(ByVal Value As Integer)
mSymbolType = Value
End Set
End Property

Public Property LegendType() As Integer
Get
Return mLegendType
End Get
Set(ByVal Value As Integer)
mLegendType = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property LayerName() As String
Get
Return mLayerName
End Get
Set(ByVal Value As String)
mLayerName = Value
End Set
End Property

Public Property ThemeName() As String
Get
Return mThemeName
End Get
Set(ByVal Value As String)
mThemeName = Value
End Set
End Property

Public Property Location() As String
Get
Return mLocation
End Get
Set(ByVal Value As String)
mLocation = Value
End Set
End Property

Public Property DrawOrder() As Integer
Get
Return mDrawOrder
End Get
Set(ByVal Value As Integer)
mDrawOrder = Value
End Set
End Property

Public Property Draw() As Boolean
Get
Return mDraw
End Get
Set(ByVal Value As Boolean)
mDraw = Value
End Set
End Property

Public Property MinScale() As Integer
Get
Return mMinScale
End Get
Set(ByVal Value As Integer)
mMinScale = Value
End Set
End Property

Public Property MaxScale() As Integer
Get
Return mMaxScale
End Get
Set(ByVal Value As Integer)
mMaxScale = Value
End Set
End Property

Public ReadOnly Property UserDefined() As Boolean
Get
Return mUserDefined
End Get
End Property

Public Property Saved() As Boolean
Get
Return mSaved
End Get
Set(ByVal Value As Boolean)
mSaved = Value
End Set
End Property

Public Property Symbols() As CLayerSymbol()
Get
Return mSymbols
End Get
Set(ByVal Value As CLayerSymbol())
mSymbols = Value
End Set
End Property
#End Region

#Region "Public member methods"
Public Sub Dispose() Implements System.IDisposable.Dispose
CleanUp()
GC.SuppressFinalize(Me)
End Sub

Public Function CompareTo(ByVal obj As Object) As Integer

Implements
System.IComparable.CompareTo
If TypeOf obj Is CLayerDefinition Then
Dim cld As CLayerDefinition = DirectCast(obj,

CLayerDefinition)

mDrawOrder.CompareTo(cld.mDrawOrder)
End If

Throw New ArgumentException("obj is not a CLayerDefintion type")
End Function

#End Region

#Region "Private member methods"
Private Sub CleanUp()
If Not mSymbols Is Nothing Then
If mSymbols.GetUpperBound(0) >= 0 Then
Erase mSymbols
End If
mSymbols = Nothing
End If
End Sub
#End Region

#Region "Constructors"
Public Sub New()
mUserDefined = False
End Sub

Public Sub New(ByVal usrDefined As Boolean)
mUserDefined = usrDefined
End Sub
#End Region
End Class


Nov 12 '05 #3
Steve,

What you're describing is pretty much the best option. Wrap the Font
class in another class that has a default constructor and exposes
properties for the data you need to serialize plus a read/write property
to store the Font object. Then decorate that Font property with the
XmlIgnore attribute to tell the XmlSerializer to skip it.

Unfortunately, there isn't anything more sophisticated. The runtime
formatters (BinaryFormatter, SoapFormatter) provide much better hooks
into serialization and deserialization than the XmlSerializer.
HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Steve Long [mailto:St**********@NoSpam.com]
Posted At: Wednesday, February 02, 2005 10:36 AM
Posted To: microsoft.public.dotnet.xml
Conversation: XmlSerializer instantiation error
Subject: Re: XmlSerializer instantiation error

Christoph,
Thanks for the link. I'm reading the document now and after looking at the error message in more detail, it appears that my CLayerDefinition contains another type CLayerSymbol, which contains a public property called Font which is of type System.Font. The XmlSerializer is throwing an exception when it tries to create this type because it does not have a default,
public
constructor. Is there a way to help it do this without changing my
underlying class structure to some other type that has a default
constructor. Here's the class that it's having trouble with:

<Serializable()> _
Public Class CLayerSymbol

#Region "Private member simple objects"
Private mThemeID As Integer
Private mDescription As String
Private mFieldValue As Object
Private mStyle As String
Private mGlyphIndex As String
Private mColor As Integer
Private mSize As Integer
Private mOutlineColor As Integer
Private mOutline As Boolean
Private mFromColor As Integer
Private mToColor As Integer
Private mRotation As Integer
Private mDuplicateLabel As Boolean
Private mBold As Boolean
Private mItalic As Boolean
Private mUnderline As Boolean
Private mSpline As Boolean
Private mVerticalAlignment As Integer
Private mHorizontalAlignment As Integer
Private mFont As Font
#End Region

#Region "Properties"
Public Property font() As font
Get
Return mFont
End Get
Set(ByVal Value As font)
mFont = Value
End Set
End Property

Public Property VerticalAlignment() As Integer
Get
Return mVerticalAlignment
End Get
Set(ByVal Value As Integer)
mVerticalAlignment = Value
End Set
End Property

Public Property HorizontalAlignment() As Integer
Get
Return mHorizontalAlignment
End Get
Set(ByVal Value As Integer)
mHorizontalAlignment = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property Description() As String
Get
Return mDescription
End Get
Set(ByVal Value As String)
mDescription = Value
End Set
End Property

<System.Xml.Serialization.XmlAnyElement("FieldValu e")> _
Public Property FieldValue() As Object
Get
Return mFieldValue
End Get
Set(ByVal Value As Object)
mFieldValue = Value
End Set
End Property

Public Property Style() As Integer
Get
Return mStyle
End Get
Set(ByVal Value As Integer)
mStyle = Value
End Set
End Property

Public Property GlyphIndex() As Integer
Get
Return mGlyphIndex
End Get
Set(ByVal Value As Integer)
mGlyphIndex = Value
End Set
End Property

Public Property Color() As Integer
Get
Return mColor
End Get
Set(ByVal Value As Integer)
mColor = Value
End Set
End Property

Public Property Size() As Integer
Get
Return mSize
End Get
Set(ByVal Value As Integer)
mSize = Value
End Set
End Property

Public Property OutlineColor() As Integer
Get
Return mOutlineColor
End Get
Set(ByVal Value As Integer)
mOutlineColor = Value
End Set
End Property

Public Property Outline() As Boolean
Get
Return mOutline
End Get
Set(ByVal Value As Boolean)
mOutline = Value
End Set
End Property

Public Property FromColor() As Integer
Get
Return mFromColor
End Get
Set(ByVal Value As Integer)
mFromColor = Value
End Set
End Property

Public Property ToColor() As Integer
Get
Return mToColor
End Get
Set(ByVal Value As Integer)
mToColor = Value
End Set
End Property

Public Property Rotation() As Integer
Get
Return mRotation
End Get
Set(ByVal Value As Integer)
mRotation = Value
End Set
End Property

Public Property DuplicateLabel() As Boolean
Get
Return mDuplicateLabel
End Get
Set(ByVal Value As Boolean)
mDuplicateLabel = Value
End Set
End Property

Public Property Bold() As Boolean
Get
Return mBold
End Get
Set(ByVal Value As Boolean)
mBold = Value
End Set
End Property

Public Property Italic() As Boolean
Get
Return mItalic
End Get
Set(ByVal Value As Boolean)
mItalic = Value
End Set
End Property

Public Property Underline() As Boolean
Get
Return mUnderline
End Get
Set(ByVal Value As Boolean)
mUnderline = Value
End Set
End Property

Public Property Spline() As Boolean
Get
Return mSpline
End Get
Set(ByVal Value As Boolean)
mSpline = Value
End Set
End Property
#End Region
End Class
"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message news:uE**************@TK2MSFTNGP14.phx.gbl...

Steve,

Did you read through [0]?

It explains a number of scenarios that can cause this error.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

[0]
http://msdn.microsoft.com/XML/Buildi...k/default.aspx ?pull=/library/en-us/dnxmlnet/html/trblshtxsd.asp
-----Original Message-----
From: Steve Long [mailto:St**********@NoSpam.com]
Posted At: Tuesday, February 01, 2005 3:20 PM
Posted To: microsoft.public.dotnet.xml
Conversation: XmlSerializer instantiation error
Subject: XmlSerializer instantiation error

Hello,
I hope this is the right group to post this to. I'm trying to

serialize a
class I've written and I'd like to be able to serialze to both binary
and
xml formats. Binary serialization is working fine but when I try

to instantiate an XmlSerializer object with:

Dim xmls As New XmlSerializer(GetType(CLayerDefinition))

I get the following error:

An unhandled exception of type 'System.InvalidOperationException'

occurred
in system.xml.dll

Additional information: There was an error reflecting type
'xmlSerializeTest.CLayerDefinition'.

Can anybody give me some pointer as to why this might be happening

since
the
error message is not too helpful?

Thanks Steve

The class CLayerDefinition is laid out as:

<Serializable()> _
Public Class CLayerDefinition
Implements IDisposable, IComparable

#Region "Private simple objects"
Private mThemeID As Integer
Private mLayerName As String
Private mThemeName As String
Private mLocation As String
Private mDraw As Boolean
Private mMinScale As Integer
Private mMaxScale As Integer
Private mUserDefined As Boolean
Private mSaved As Boolean
Private mDrawOrder As Integer
Private mLegendType As Integer
Private mSymbolType As Integer
Private mLabelField As String
Private mHasImages As Boolean
Private mRelateTable As String
Private mTableLocation As String
Private mRelateField As String
Private mFileNameField As String
Private mClassItemField As String
Private mNumberOfBreaks As Integer
#End Region

#Region "Private complex objects"
<XmlArray()> _
Private mSymbols() As CLayerSymbol
#End Region

#Region "Public properties"
Public Property NumberOfBreaks() As Integer
Get
Return mNumberOfBreaks
End Get
Set(ByVal Value As Integer)
mNumberOfBreaks = Value
End Set
End Property

Public Property ClassItemField() As String
Get
Return mClassItemField
End Get
Set(ByVal Value As String)
mClassItemField = Value
End Set
End Property

Public Property HasImages() As Boolean
Get
Return mHasImages
End Get
Set(ByVal Value As Boolean)
mHasImages = Value
End Set
End Property

Public Property FileNameField() As String
Get
Return mFileNameField
End Get
Set(ByVal Value As String)
mFileNameField = Value
End Set
End Property

Public Property RelateField() As String
Get
Return mRelateField
End Get
Set(ByVal Value As String)
mRelateField = Value
End Set
End Property

Public Property TableLocation() As String
Get
Return mTableLocation
End Get
Set(ByVal Value As String)
mTableLocation = Value
End Set
End Property

Public Property RelateTable() As String
Get
Return mRelateTable
End Get
Set(ByVal Value As String)
mRelateTable = Value
End Set
End Property

Public Property LabelField() As String
Get
Return mLabelField
End Get
Set(ByVal Value As String)
mLabelField = Value
End Set
End Property

Public Property SymbolType() As Integer
Get
Return mSymbolType
End Get
Set(ByVal Value As Integer)
mSymbolType = Value
End Set
End Property

Public Property LegendType() As Integer
Get
Return mLegendType
End Get
Set(ByVal Value As Integer)
mLegendType = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property LayerName() As String
Get
Return mLayerName
End Get
Set(ByVal Value As String)
mLayerName = Value
End Set
End Property

Public Property ThemeName() As String
Get
Return mThemeName
End Get
Set(ByVal Value As String)
mThemeName = Value
End Set
End Property

Public Property Location() As String
Get
Return mLocation
End Get
Set(ByVal Value As String)
mLocation = Value
End Set
End Property

Public Property DrawOrder() As Integer
Get
Return mDrawOrder
End Get
Set(ByVal Value As Integer)
mDrawOrder = Value
End Set
End Property

Public Property Draw() As Boolean
Get
Return mDraw
End Get
Set(ByVal Value As Boolean)
mDraw = Value
End Set
End Property

Public Property MinScale() As Integer
Get
Return mMinScale
End Get
Set(ByVal Value As Integer)
mMinScale = Value
End Set
End Property

Public Property MaxScale() As Integer
Get
Return mMaxScale
End Get
Set(ByVal Value As Integer)
mMaxScale = Value
End Set
End Property

Public ReadOnly Property UserDefined() As Boolean
Get
Return mUserDefined
End Get
End Property

Public Property Saved() As Boolean
Get
Return mSaved
End Get
Set(ByVal Value As Boolean)
mSaved = Value
End Set
End Property

Public Property Symbols() As CLayerSymbol()
Get
Return mSymbols
End Get
Set(ByVal Value As CLayerSymbol())
mSymbols = Value
End Set
End Property
#End Region

#Region "Public member methods"
Public Sub Dispose() Implements System.IDisposable.Dispose
CleanUp()
GC.SuppressFinalize(Me)
End Sub

Public Function CompareTo(ByVal obj As Object) As Integer

Implements
System.IComparable.CompareTo
If TypeOf obj Is CLayerDefinition Then
Dim cld As CLayerDefinition = DirectCast(obj,

CLayerDefinition)

mDrawOrder.CompareTo(cld.mDrawOrder)
End If

Throw New ArgumentException("obj is not a CLayerDefintion type") End Function

#End Region

#Region "Private member methods"
Private Sub CleanUp()
If Not mSymbols Is Nothing Then
If mSymbols.GetUpperBound(0) >= 0 Then
Erase mSymbols
End If
mSymbols = Nothing
End If
End Sub
#End Region

#Region "Constructors"
Public Sub New()
mUserDefined = False
End Sub

Public Sub New(ByVal usrDefined As Boolean)
mUserDefined = usrDefined
End Sub
#End Region
End Class


Nov 12 '05 #4
Thanks Christoph. What I decided to do was to create my own CFont class that
exposes the properties that I need that includes a default constructor.

Steve
"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Steve,

What you're describing is pretty much the best option. Wrap the Font
class in another class that has a default constructor and exposes
properties for the data you need to serialize plus a read/write property
to store the Font object. Then decorate that Font property with the
XmlIgnore attribute to tell the XmlSerializer to skip it.

Unfortunately, there isn't anything more sophisticated. The runtime
formatters (BinaryFormatter, SoapFormatter) provide much better hooks
into serialization and deserialization than the XmlSerializer.
HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Steve Long [mailto:St**********@NoSpam.com]
Posted At: Wednesday, February 02, 2005 10:36 AM
Posted To: microsoft.public.dotnet.xml
Conversation: XmlSerializer instantiation error
Subject: Re: XmlSerializer instantiation error

Christoph,
Thanks for the link. I'm reading the document now and after looking at

the
error message in more detail, it appears that my CLayerDefinition

contains
another type CLayerSymbol, which contains a public property called

Font
which is of type System.Font. The XmlSerializer is throwing an

exception
when it tries to create this type because it does not have a default,
public
constructor. Is there a way to help it do this without changing my
underlying class structure to some other type that has a default
constructor. Here's the class that it's having trouble with:

<Serializable()> _
Public Class CLayerSymbol

#Region "Private member simple objects"
Private mThemeID As Integer
Private mDescription As String
Private mFieldValue As Object
Private mStyle As String
Private mGlyphIndex As String
Private mColor As Integer
Private mSize As Integer
Private mOutlineColor As Integer
Private mOutline As Boolean
Private mFromColor As Integer
Private mToColor As Integer
Private mRotation As Integer
Private mDuplicateLabel As Boolean
Private mBold As Boolean
Private mItalic As Boolean
Private mUnderline As Boolean
Private mSpline As Boolean
Private mVerticalAlignment As Integer
Private mHorizontalAlignment As Integer
Private mFont As Font
#End Region

#Region "Properties"
Public Property font() As font
Get
Return mFont
End Get
Set(ByVal Value As font)
mFont = Value
End Set
End Property

Public Property VerticalAlignment() As Integer
Get
Return mVerticalAlignment
End Get
Set(ByVal Value As Integer)
mVerticalAlignment = Value
End Set
End Property

Public Property HorizontalAlignment() As Integer
Get
Return mHorizontalAlignment
End Get
Set(ByVal Value As Integer)
mHorizontalAlignment = Value
End Set
End Property

Public Property ThemeID() As Integer
Get
Return mThemeID
End Get
Set(ByVal Value As Integer)
mThemeID = Value
End Set
End Property

Public Property Description() As String
Get
Return mDescription
End Get
Set(ByVal Value As String)
mDescription = Value
End Set
End Property

<System.Xml.Serialization.XmlAnyElement("FieldValu e")> _
Public Property FieldValue() As Object
Get
Return mFieldValue
End Get
Set(ByVal Value As Object)
mFieldValue = Value
End Set
End Property

Public Property Style() As Integer
Get
Return mStyle
End Get
Set(ByVal Value As Integer)
mStyle = Value
End Set
End Property

Public Property GlyphIndex() As Integer
Get
Return mGlyphIndex
End Get
Set(ByVal Value As Integer)
mGlyphIndex = Value
End Set
End Property

Public Property Color() As Integer
Get
Return mColor
End Get
Set(ByVal Value As Integer)
mColor = Value
End Set
End Property

Public Property Size() As Integer
Get
Return mSize
End Get
Set(ByVal Value As Integer)
mSize = Value
End Set
End Property

Public Property OutlineColor() As Integer
Get
Return mOutlineColor
End Get
Set(ByVal Value As Integer)
mOutlineColor = Value
End Set
End Property

Public Property Outline() As Boolean
Get
Return mOutline
End Get
Set(ByVal Value As Boolean)
mOutline = Value
End Set
End Property

Public Property FromColor() As Integer
Get
Return mFromColor
End Get
Set(ByVal Value As Integer)
mFromColor = Value
End Set
End Property

Public Property ToColor() As Integer
Get
Return mToColor
End Get
Set(ByVal Value As Integer)
mToColor = Value
End Set
End Property

Public Property Rotation() As Integer
Get
Return mRotation
End Get
Set(ByVal Value As Integer)
mRotation = Value
End Set
End Property

Public Property DuplicateLabel() As Boolean
Get
Return mDuplicateLabel
End Get
Set(ByVal Value As Boolean)
mDuplicateLabel = Value
End Set
End Property

Public Property Bold() As Boolean
Get
Return mBold
End Get
Set(ByVal Value As Boolean)
mBold = Value
End Set
End Property

Public Property Italic() As Boolean
Get
Return mItalic
End Get
Set(ByVal Value As Boolean)
mItalic = Value
End Set
End Property

Public Property Underline() As Boolean
Get
Return mUnderline
End Get
Set(ByVal Value As Boolean)
mUnderline = Value
End Set
End Property

Public Property Spline() As Boolean
Get
Return mSpline
End Get
Set(ByVal Value As Boolean)
mSpline = Value
End Set
End Property
#End Region
End Class
"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in

message
news:uE**************@TK2MSFTNGP14.phx.gbl...

Steve,

Did you read through [0]?

It explains a number of scenarios that can cause this error.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

[0]
http://msdn.microsoft.com/XML/Buildi...k/default.aspx ?pull=/library/en-us/dnxmlnet/html/trblshtxsd.asp

> -----Original Message-----
> From: Steve Long [mailto:St**********@NoSpam.com]
> Posted At: Tuesday, February 01, 2005 3:20 PM
> Posted To: microsoft.public.dotnet.xml
> Conversation: XmlSerializer instantiation error
> Subject: XmlSerializer instantiation error
>
> Hello,
> I hope this is the right group to post this to. I'm trying to
serialize a
> class I've written and I'd like to be able to serialze to both binary and
> xml formats. Binary serialization is working fine but when I try to > instantiate an XmlSerializer object with:
>
> Dim xmls As New XmlSerializer(GetType(CLayerDefinition))
>
> I get the following error:
>
> An unhandled exception of type 'System.InvalidOperationException'
occurred
> in system.xml.dll
>
> Additional information: There was an error reflecting type
> 'xmlSerializeTest.CLayerDefinition'.
>
> Can anybody give me some pointer as to why this might be happening
since
> the
> error message is not too helpful?
>
> Thanks Steve
>
> The class CLayerDefinition is laid out as:
>
> <Serializable()> _
> Public Class CLayerDefinition
> Implements IDisposable, IComparable
>
> #Region "Private simple objects"
> Private mThemeID As Integer
> Private mLayerName As String
> Private mThemeName As String
> Private mLocation As String
> Private mDraw As Boolean
> Private mMinScale As Integer
> Private mMaxScale As Integer
> Private mUserDefined As Boolean
> Private mSaved As Boolean
> Private mDrawOrder As Integer
> Private mLegendType As Integer
> Private mSymbolType As Integer
> Private mLabelField As String
> Private mHasImages As Boolean
> Private mRelateTable As String
> Private mTableLocation As String
> Private mRelateField As String
> Private mFileNameField As String
> Private mClassItemField As String
> Private mNumberOfBreaks As Integer
> #End Region
>
> #Region "Private complex objects"
> <XmlArray()> _
> Private mSymbols() As CLayerSymbol
> #End Region
>
> #Region "Public properties"
> Public Property NumberOfBreaks() As Integer
> Get
> Return mNumberOfBreaks
> End Get
> Set(ByVal Value As Integer)
> mNumberOfBreaks = Value
> End Set
> End Property
>
> Public Property ClassItemField() As String
> Get
> Return mClassItemField
> End Get
> Set(ByVal Value As String)
> mClassItemField = Value
> End Set
> End Property
>
> Public Property HasImages() As Boolean
> Get
> Return mHasImages
> End Get
> Set(ByVal Value As Boolean)
> mHasImages = Value
> End Set
> End Property
>
> Public Property FileNameField() As String
> Get
> Return mFileNameField
> End Get
> Set(ByVal Value As String)
> mFileNameField = Value
> End Set
> End Property
>
> Public Property RelateField() As String
> Get
> Return mRelateField
> End Get
> Set(ByVal Value As String)
> mRelateField = Value
> End Set
> End Property
>
> Public Property TableLocation() As String
> Get
> Return mTableLocation
> End Get
> Set(ByVal Value As String)
> mTableLocation = Value
> End Set
> End Property
>
> Public Property RelateTable() As String
> Get
> Return mRelateTable
> End Get
> Set(ByVal Value As String)
> mRelateTable = Value
> End Set
> End Property
>
> Public Property LabelField() As String
> Get
> Return mLabelField
> End Get
> Set(ByVal Value As String)
> mLabelField = Value
> End Set
> End Property
>
> Public Property SymbolType() As Integer
> Get
> Return mSymbolType
> End Get
> Set(ByVal Value As Integer)
> mSymbolType = Value
> End Set
> End Property
>
> Public Property LegendType() As Integer
> Get
> Return mLegendType
> End Get
> Set(ByVal Value As Integer)
> mLegendType = Value
> End Set
> End Property
>
> Public Property ThemeID() As Integer
> Get
> Return mThemeID
> End Get
> Set(ByVal Value As Integer)
> mThemeID = Value
> End Set
> End Property
>
> Public Property LayerName() As String
> Get
> Return mLayerName
> End Get
> Set(ByVal Value As String)
> mLayerName = Value
> End Set
> End Property
>
> Public Property ThemeName() As String
> Get
> Return mThemeName
> End Get
> Set(ByVal Value As String)
> mThemeName = Value
> End Set
> End Property
>
> Public Property Location() As String
> Get
> Return mLocation
> End Get
> Set(ByVal Value As String)
> mLocation = Value
> End Set
> End Property
>
> Public Property DrawOrder() As Integer
> Get
> Return mDrawOrder
> End Get
> Set(ByVal Value As Integer)
> mDrawOrder = Value
> End Set
> End Property
>
> Public Property Draw() As Boolean
> Get
> Return mDraw
> End Get
> Set(ByVal Value As Boolean)
> mDraw = Value
> End Set
> End Property
>
> Public Property MinScale() As Integer
> Get
> Return mMinScale
> End Get
> Set(ByVal Value As Integer)
> mMinScale = Value
> End Set
> End Property
>
> Public Property MaxScale() As Integer
> Get
> Return mMaxScale
> End Get
> Set(ByVal Value As Integer)
> mMaxScale = Value
> End Set
> End Property
>
> Public ReadOnly Property UserDefined() As Boolean
> Get
> Return mUserDefined
> End Get
> End Property
>
> Public Property Saved() As Boolean
> Get
> Return mSaved
> End Get
> Set(ByVal Value As Boolean)
> mSaved = Value
> End Set
> End Property
>
> Public Property Symbols() As CLayerSymbol()
> Get
> Return mSymbols
> End Get
> Set(ByVal Value As CLayerSymbol())
> mSymbols = Value
> End Set
> End Property
> #End Region
>
> #Region "Public member methods"
> Public Sub Dispose() Implements System.IDisposable.Dispose
> CleanUp()
> GC.SuppressFinalize(Me)
> End Sub
>
> Public Function CompareTo(ByVal obj As Object) As Integer
Implements
> System.IComparable.CompareTo
> If TypeOf obj Is CLayerDefinition Then
> Dim cld As CLayerDefinition = DirectCast(obj,
CLayerDefinition)
>
> mDrawOrder.CompareTo(cld.mDrawOrder)
> End If
>
> Throw New ArgumentException("obj is not a CLayerDefintion type") > End Function
>
> #End Region
>
> #Region "Private member methods"
> Private Sub CleanUp()
> If Not mSymbols Is Nothing Then
> If mSymbols.GetUpperBound(0) >= 0 Then
> Erase mSymbols
> End If
> mSymbols = Nothing
> End If
> End Sub
> #End Region
>
> #Region "Constructors"
> Public Sub New()
> mUserDefined = False
> End Sub
>
> Public Sub New(ByVal usrDefined As Boolean)
> mUserDefined = usrDefined
> End Sub
> #End Region
> End Class


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stuart Robertson | last post by:
I am trying to find a solution that will allow me to use XmlSerializer to serialize/deserialize a collection of objects where a given object is shared between two or more other objects, and not...
8
by: Harris Boyce | last post by:
Hello, I'm trying to use the FOR XML EXPLICIT clause with SQL Server to deserialize data from my database into a strongly-typed collection object that I will use throughout my application. I...
2
by: Chris Aitchison | last post by:
Hello, I am attempting to have a class that I have written serialize so that it can be both passed as a parameter or return value for a webservice, and also be serialized to disk using the...
2
by: Gary Brewer | last post by:
Below are my classes generated using XSD.EXE from XML/XSLT When I do XmlSerializer xmls=new XmlSerializer(typeof(events)); I get
11
by: Rangi Keen | last post by:
I am instantiating an XmlSerializer using the XmlSerializer(Type) constructor. This works most of the time, but sometimes I get a timeout during the process. I'm using the same type in all cases...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
3
by: Don McNamara | last post by:
Hi, I've hit quite a strange problem with XmlSerializer on my W2K3 server. When I serialize/deserialize using an exe on my local computer (XP), everything works fine. When I put the code out on...
0
by: William Stacey [MVP] | last post by:
Had a method that got some string info from mp3 tags in N files and serializes this class and deserializes at other side. Works ok except sometimes get chars that choke the XmlSerializer. After...
0
by: awood45 | last post by:
I ran into a bizarre crashing of one of my programs earlier today, and noticed my IE 6 was messed up (maybe this is important, maybe it isn't, but it coincided with this not working). After fixing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.