OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Steve Johnson (sjohnson_at_3TSYSTEMS.COM)
Date: Wed Feb 19 2003 - 08:47:15 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    > I want to read single character from .txt File by Passing position...
    > can you please help about this...

    char ReadSingleChar(LPSTR Filename, DWORD Offset)
    { //Error handling omitted for brevity
    char c;
    DWORD BytesRead;

      HANDLE hFile = CreateFile(Filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);

      SetFilePointer(hFile, Offset, NULL, FILE_BEGIN);

      ReadFile(hFile, (LPBYTE)&c, 1, &BytesRead, NULL);

      CloseHandle(hFile);

      return c;
    }

    --
    Steve Johnson
    3t Systems
    

    ---------------------------------------------------------------- Users Guide http://discuss.microsoft.com/archives/mailfaq.asp contains important info. Save time, search the archives at http://discuss.microsoft.com/archives/index.html . To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM