VB Code:
Private Sub btnRead_Click() Dim x As PP2File Open "temp.pp2" For Binary As #1 Get #1, , x Close #1 Dim i As Long Dim nd As Node Set nd = tvDisplay.Nodes.Add(, , , x.sOwnerName) For i = LBound(x.PP2Entries) To UBound(x.PP2Entries) Dim ndb As Node Set ndb = tvDisplay.Nodes.Add(nd, tvwChild, , x.PP2Entries(i).sName) tvDisplay.Nodes.Add ndb, tvwChild, , x.PP2Entries(i).Data Next i End Sub Private Sub btnWrite_Click() Dim x As PP2File x.sOwnerName = "Mike Parks" ReDim x.PP2Entries(0 To 1) x.PP2Entries(0).sName = "Hi there" x.PP2Entries(0).Data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" x.PP2Entries(1).sName = "Different" x.PP2Entries(1).Data = "BLAH BLAH BLAH" Open "temp.pp2" For Binary As #1 Put #1, , x Close #1 End Sub![]()




Reply With Quote