Click here to Skip to main content
15,918,617 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert a string to expresion Pin
Christian Graus9-Feb-05 10:04
protectorChristian Graus9-Feb-05 10:04 
GeneralRe: Convert a string to expresion Pin
zaxos11-Feb-05 3:45
zaxos11-Feb-05 3:45 
GeneralSerialize help Pin
MrBean9-Feb-05 3:27
MrBean9-Feb-05 3:27 
GeneralRe: Serialize help Pin
Dave Kreskowiak9-Feb-05 16:51
mveDave Kreskowiak9-Feb-05 16:51 
GeneralRe: Serialize help Pin
Anonymous9-Feb-05 21:38
Anonymous9-Feb-05 21:38 
GeneralRe: Serialize help Pin
MrBean9-Feb-05 21:41
MrBean9-Feb-05 21:41 
GeneralRe: Serialize help Pin
Dave Kreskowiak10-Feb-05 5:45
mveDave Kreskowiak10-Feb-05 5:45 
GeneralRe: Serialize help Pin
MrBean10-Feb-05 20:54
MrBean10-Feb-05 20:54 
Here's the current and complete test source including the test function :


<code>

Imports System.Xml.Serialization

<Serializable()> Public Class MyReport

Public m_Title As String
Public m_BackColor As Color
Public m_Objects As New ArrayList ' Contains several MyReportObject objects

End Class

<Serializable()> Public Class MyReportObject

Public m_Text As String
Public m_X As Integer
Public m_Y As Integer

End Class


Module TestFunctions

Public Sub Test()

' Making test data...

Dim oRep As New MyReport
oRep.m_Title = "Some new report..."
oRep.m_BackColor = oRep.m_BackColor.WhiteSmoke

Dim oObj As New MyReportObject
oObj.m_Text = "A text..."
oObj.m_X = 10
oObj.m_Y = 10

oRep.m_Objects.Add(oObj) ' Leave this line out, and serializeing below will succeed !


Try

' Serialize to XML file...
Dim file As New System.io.FileStream("c:\MyReport.xml", IO.FileMode.Create)
Dim ser As New System.Xml.Serialization.XmlSerializer(oRep.GetType)
ser.Serialize(file, oRep)
ser = Nothing
file.Close()
file = Nothing

MsgBox("Done!")

Catch ex As Exception
MsgBox(ex.Message & vbCr & vbCr & ex.InnerException.Message)
End Try

End Sub

End Module

</code>

GeneralRe: Serialize help Pin
Dave Kreskowiak12-Feb-05 3:03
mveDave Kreskowiak12-Feb-05 3:03 
GeneralHelp Recording Audio Pin
GeneArnold9-Feb-05 3:12
GeneArnold9-Feb-05 3:12 
GeneralRe: App.Path (vb.net) Pin
Just Greeky Creek9-Feb-05 0:16
Just Greeky Creek9-Feb-05 0:16 
GeneralRe: App.Path (vb.net) Pin
Ritesh12349-Feb-05 0:23
Ritesh12349-Feb-05 0:23 
GeneralCustom Shaped Window (form) Pin
Member 86210338-Feb-05 22:49
Member 86210338-Feb-05 22:49 
GeneralRe: Custom Shaped Window (form) Pin
Just Greeky Creek9-Feb-05 0:18
Just Greeky Creek9-Feb-05 0:18 
GeneralRe: Custom Shaped Window (form) Pin
Kumar saurabh9-Feb-05 20:16
Kumar saurabh9-Feb-05 20:16 
GeneralRe: Custom Shaped Window (form) Pin
Just Greeky Creek9-Feb-05 20:44
Just Greeky Creek9-Feb-05 20:44 
QuestionCan someone help with this one Pin
Delo8-Feb-05 19:58
Delo8-Feb-05 19:58 
AnswerRe: Can someone help with this one Pin
Dave Kreskowiak9-Feb-05 2:36
mveDave Kreskowiak9-Feb-05 2:36 
QuestionHow To Search in Database in Access Using Adodc Pin
Max's8-Feb-05 19:56
sussMax's8-Feb-05 19:56 
Generalget_URL Pin
students552 university8-Feb-05 19:44
students552 university8-Feb-05 19:44 
QuestionHow can I corrupt a folder or restrict the access to it? (VB 6) Pin
AngryC8-Feb-05 17:55
AngryC8-Feb-05 17:55 
AnswerRe: How can I corrupt a folder or restrict the access to it? (VB 6) Pin
Christian Graus9-Feb-05 10:05
protectorChristian Graus9-Feb-05 10:05 
AnswerRe: How can I corrupt a folder or restrict the access to it? (VB 6) Pin
Dave Kreskowiak9-Feb-05 10:14
mveDave Kreskowiak9-Feb-05 10:14 
QuestionHow can I change the file/folder index? (VB 6) Pin
AngryC8-Feb-05 17:54
AngryC8-Feb-05 17:54 
AnswerRe: How can I change the file/folder index? (VB 6) Pin
Dave Kreskowiak9-Feb-05 16:43
mveDave Kreskowiak9-Feb-05 16:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.