Click here to Skip to main content
15,914,066 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Get record info from a datagrid Pin
New_Coder16-Feb-06 11:48
New_Coder16-Feb-06 11:48 
GeneralRe: Get record info from a datagrid Pin
KreativeKai17-Feb-06 2:10
professionalKreativeKai17-Feb-06 2:10 
Questionhow to use EOF or BOF in vb.net Pin
haripaddu15-Feb-06 11:21
haripaddu15-Feb-06 11:21 
AnswerRe: how to use EOF or BOF in vb.net Pin
KaptinKrunch15-Feb-06 11:29
KaptinKrunch15-Feb-06 11:29 
GeneralRe: how to use EOF or BOF in vb.net Pin
haripaddu15-Feb-06 11:38
haripaddu15-Feb-06 11:38 
GeneralRe: how to use EOF or BOF in vb.net Pin
haripaddu15-Feb-06 11:43
haripaddu15-Feb-06 11:43 
GeneralRe: how to use EOF or BOF in vb.net Pin
mayhem_rules15-Feb-06 17:21
mayhem_rules15-Feb-06 17:21 
QuestionUsing setFilePointer API Pin
IH8Microsoft15-Feb-06 10:18
IH8Microsoft15-Feb-06 10:18 
Visual Basic, Windows XP, reading an NTFS drive.

I'm trying to read in x number of bytes from a drive starting at y position. No matter what I do, readFile is always reading from the first byte.

Example:

If I want to read in the first 512 bytes of data I use:
' -----------------------------------------------------------------------
tempPosition = SetFilePointer(lDevice, 512, 0, FILE_BEGIN)
ReDim Buffer(512)
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
' -----------------------------------------------------------------------

And this works just fine. Now if I want to read 512 bytes, STARTING from the 53248th position I am using:
' -----------------------------------------------------------------------
tempPosition = SetFilePointer(lDevice, 53248, 0, FILE_BEGIN) ' Moving to the new position
tempPosition = SetFilePointer(lDevice, 512, 0, FILE_CURRENT) ' Should move FROM the current position (53248)?
ReDim Buffer(512)
bReturn = (ReadFile(lDevice, Buffer(0), UBound(Buffer), BytesRead, tempNull))
' -----------------------------------------------------------------------

The result? I get the exact same thing. It reads from Byte 1 to 512. It's totally ignoring the fact that I already set the file pointer to 53248.

I'm obviously doing something wrong and/or my logic is fuzzy. Can someone please help me.

Thanks
AnswerRe: Using setFilePointer API Pin
Dave Kreskowiak15-Feb-06 10:57
mveDave Kreskowiak15-Feb-06 10:57 
GeneralRe: Using setFilePointer API Pin
IH8Microsoft15-Feb-06 11:32
IH8Microsoft15-Feb-06 11:32 
GeneralRe: Using setFilePointer API Pin
Dave Kreskowiak15-Feb-06 13:03
mveDave Kreskowiak15-Feb-06 13:03 
AnswerRe: Using setFilePointer API Pin
progload15-Feb-06 11:49
progload15-Feb-06 11:49 
GeneralRe: Using setFilePointer API Pin
IH8Microsoft15-Feb-06 11:58
IH8Microsoft15-Feb-06 11:58 
GeneralRe: Using setFilePointer API Pin
IH8Microsoft15-Feb-06 12:13
IH8Microsoft15-Feb-06 12:13 
GeneralRe: Using setFilePointer API Pin
progload15-Feb-06 12:37
progload15-Feb-06 12:37 
GeneralRe: Using setFilePointer API Pin
IH8Microsoft15-Feb-06 12:51
IH8Microsoft15-Feb-06 12:51 
QuestionCombobox Items Pin
kostasdiktia215-Feb-06 10:02
kostasdiktia215-Feb-06 10:02 
AnswerRe: Combobox Items Pin
Dave Kreskowiak15-Feb-06 10:45
mveDave Kreskowiak15-Feb-06 10:45 
GeneralRe: Combobox Items Pin
kostasdiktia215-Feb-06 13:35
kostasdiktia215-Feb-06 13:35 
AnswerRe: Combobox Items Pin
Steve Pullan15-Feb-06 11:50
Steve Pullan15-Feb-06 11:50 
GeneralRe: Combobox Items Pin
Dave Kreskowiak15-Feb-06 13:01
mveDave Kreskowiak15-Feb-06 13:01 
QuestionRegistry keys Pin
kostasdiktia215-Feb-06 9:50
kostasdiktia215-Feb-06 9:50 
AnswerRe: Registry keys Pin
Dave Kreskowiak15-Feb-06 10:43
mveDave Kreskowiak15-Feb-06 10:43 
GeneralRe: Registry keys Pin
kostasdiktia215-Feb-06 13:39
kostasdiktia215-Feb-06 13:39 
GeneralRe: Registry keys Pin
Dave Kreskowiak15-Feb-06 14:28
mveDave Kreskowiak15-Feb-06 14:28 

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.