A
al jones
I picked a good project to try to learn to use VS - and up till now
everything has worked the way I expect. The code is from a VS.net class,
which I picked up on the web, from which I've extracted portions to fulfill
my immediate needs.
I hsve the following:
Structure OFFSETTABLE ' (page 32: "The Table Directory")
Friend Version As Long ' signed floating point number
' 2.14 (0x00010000 for TTF version 1.0)
Friend NumberOfTables As Integer ' number of tables
Friend SearchRange As Integer ' maximum power of 2 <= numTables)
x 16
Friend EntrySelector As Integer ' Log2: maximum power of 2 <=
numTables)
Friend RangeShift As Integer ' NumTables * (16 - searchRange)
End Structure
Private Function RefreshFontInfo(ByVal FileNameTTF As String) As
Boolean
Dim TableOffsets As OFFSETTABLE
hFile = FreeFile()
FileOpen(hFile, FileNameTTF, OpenMode.Binary, OpenAccess.Read,
OpenShare.LockReadWrite)
'Open FileNameTTF For Binary Access Read Lock Write As #hFile
' Get the offset table
FileGet(hFile, TableOffsets, Len(TableOffsets)) <<----
Two questions here:
1) the marked line appear to *NOT* read anything, I know what the values
from the file should be - the resulting structure contains zero's. What am
I doing wrong?
2) What's the easiest way to throw up a generica error handler - giving
error number and message if this isn't doing what I think it is?
The broken lines are a resuilt of the newreader message box, all logical
<?> lines are contiguous.
Thanks for any assistance //al
everything has worked the way I expect. The code is from a VS.net class,
which I picked up on the web, from which I've extracted portions to fulfill
my immediate needs.
I hsve the following:
Structure OFFSETTABLE ' (page 32: "The Table Directory")
Friend Version As Long ' signed floating point number
' 2.14 (0x00010000 for TTF version 1.0)
Friend NumberOfTables As Integer ' number of tables
Friend SearchRange As Integer ' maximum power of 2 <= numTables)
x 16
Friend EntrySelector As Integer ' Log2: maximum power of 2 <=
numTables)
Friend RangeShift As Integer ' NumTables * (16 - searchRange)
End Structure
Private Function RefreshFontInfo(ByVal FileNameTTF As String) As
Boolean
Dim TableOffsets As OFFSETTABLE
hFile = FreeFile()
FileOpen(hFile, FileNameTTF, OpenMode.Binary, OpenAccess.Read,
OpenShare.LockReadWrite)
'Open FileNameTTF For Binary Access Read Lock Write As #hFile
' Get the offset table
FileGet(hFile, TableOffsets, Len(TableOffsets)) <<----
Two questions here:
1) the marked line appear to *NOT* read anything, I know what the values
from the file should be - the resulting structure contains zero's. What am
I doing wrong?
2) What's the easiest way to throw up a generica error handler - giving
error number and message if this isn't doing what I think it is?
The broken lines are a resuilt of the newreader message box, all logical
<?> lines are contiguous.
Thanks for any assistance //al