Results 1 to 3 of 3

Thread: Readfile

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Posts
    66

    Readfile

    i used ReadFile and it returned ok and the number of bytes read is the size of the file but when i debug and look at what the buffer is it is only the first 3 bytes of the file and the length is 3. does anyone know why. the buffer is being allocated enough memory so that's not the problem.

  2. #2
    jim mcnamara
    Guest
    IF you did something like this:

    [code]
    unsigned char bBytes[100];
    z=ReadFile( hOrgFile, &bBytes[1], sizeof(bBytes), Ret, 0L)
    [/code

    compare ret and sizeof(bBytes) after the call. If they are not the same then an error condition exists - like EOF encountered.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Code:
    &bBytes[1]
    Just out of interest, why are you ignoring the first byte in the buffer? Surely just bBytes would be more logical?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width