Defining an Enum within a Structure...

  • Thread starter Thread starter imme929
  • Start date Start date
I

imme929

I got things working until I tried adding this
enum to a structure...

Public Enum Keyboard
EnglishUS
EnglishUK
Spanish
German
Italian
French
End Enum

Public Structure TUserStats
Public language As Keyboard <----------
Public User As String
Public BestPercentage As String
Public BestCompleted As Integer
Public BestAverage As Single
End Structure

The arrow above points to the problem. I'm stopped at
this line below:
FileGet(1, Globals.RecStats)

An error window pops up and says....
"An unhandled exception of type 'System.ArgumentException'
occurred in microsoft.visualbasic.dll"
"Additional information: Object type cannot be converted
to target type."

'..
 
Ken said:
Hi,

Why dont you use a class instead. Here is a simple example.
http://www.onteorasoftware.com/downloads/serializeclass.zip

The example works, but when I transfer to my
program I get this error message and it stops
at the line: bf.Serialize(fs, t)

"An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: The type letterchase6.Globals+TUserStats in
Assembly letterchase6, Version=1.0.1576.35765, Culture=neutral,
PublicKeyToken=null is not marked as serializable."
 
Back
Top