Private Function drawlinesX() As Boolean
Dim mapLines() As mapLineType
Dim fileNum As Long
Dim strFile As String
Dim numRecords As Long
Dim i As Long
fileNum = FreeFile
strFile = "StCat6.dfl"
'Open the data file
Open strFile For Binary As #fileNum
'Determine the # of lines to be drawn
numRecords = LOF(fileNum) / Len(mapLine) - 1
ReDim mapLines(numRecords)
'Get the lines from the file
Get #fileNum, 1, mapLines
For i = 0 To numRecords
With mapLines(i)
'The way I've set the data file up, if the .lineType
'property is equal to 1 then this means this is the 'header'
'for a group of related lines. This way the colour only
'has to be set once rather than for every single line. With
'the world space idea this might not be the best way to do this
If .LineType = 1 Then
picMap.ForeColor = .Colour
Else
picMap.Line (.XPosStart, .YPosStart)-(.XPosEnd, .YPosEnd)
End If
'Keep track of the number of lines drawn
curObjCount = curObjCount + 1
'Refresh the map only every 10000 lines, to speed things up
If curObjCount Mod 10000 = 0 Then
'Update progress bar
PB1.Value = Int(curObjCount / gObjectCount * 1000)
picMap.Refresh
DoEvents
End If
End With
Next i
picMap.Refresh
Close #fileNum
End Function