Di seguito il programma completo

Declare Function ReadFile Lib "kernel32" _
(ByVal hFile As Long, _
lpBuffer As Any, _
ByVal nNumberOfBytesToRead As Long, _
lpNumberOfBytesRead As Long, _
ByVal lpOverlapped As Long) As Long
Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Declare Function CreateFile Lib "kernel32" _
Alias "CreateFileA" (ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Declare Function SetFilePointer Lib "kernel32" _
(ByVal hFile As Long, _
ByVal lDistanceToMove As Long, _
lpDistanceToMoveHigh As Long, _
ByVal dwMoveMethod As Long) As Long
Global hFile As Long
Global Const FILE_BEGIN = 0, FILE_CURRENT = 1, FILE_END = 2



Const GENERIC_READ = &H80000000
Const FILE_SHARE_READ As Long = &H1&
Const OPEN_EXISTING As Long = 3&

Dim sBuffer As String
Dim iBytesRead As Long
Const kCharToRead = 10
Const kStartPos = 10

hFile = CreateFile("c:\a\a.txt", GENERIC_READ, FILE_SHARE_READ, 0&, OPEN_EXISTING, 0&, 0)
Call SetFilePointer(hFile, kStartPos, 0, FILE_BEGIN) ' low, high
'
sBuffer = Space(kCharToRead) ' buffer in cui vanno i bytes letti
Call ReadFile(hFile, ByVal sBuffer, kCharToRead, iBytesRead, ByVal CLng(0))
'
CloseHandle hFile

In sBuffer dovrei avere la stringa, ma in realtà mi ritrovo una sequela di "?".