Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. i am unable to understand tis function,plz help

i am unable to understand tis function,plz help

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jitenderbansal
    wrote on last edited by
    #1

    BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped ); BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped );

    S H 2 Replies Last reply
    0
    • J jitenderbansal

      BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped ); BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped );

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      It's understandable from Parameter names check MSDN CHeck MSDN[^] SaRath.
      _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


      My Blog | Understanding State Patte_

      1 Reply Last reply
      0
      • J jitenderbansal

        BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped ); BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped );

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        WriteFile is for write to file and ReadFile is for read from file see CString WriteToFile; HANDLE hFile; DWORD dwRead; WriteToFile="This is a test"; hFile=CreateFile((LPCTSTR)"c:\\test.txt",GENERIC_WRITE,FILE_SHARE_WRITE,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL); DWORD m_dwSize=WriteToFile.GetLength(); BOOL bResult=WriteFile(hFile,(LPCTSTR)WriteToFile,m_dwSize,&dwRead,NULL); CloseHandle(hFile); CString strRead=""; DWORD dwReads=0; hFile=CreateFile((LPCTSTR)"c:\\test.txt",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); DWORD dwBufferSize=GetFileSize(hFile,NULL); bResult=ReadFile(hFile,strRead.GetBuffer(dwBufferSize),dwBufferSize,&dwReads,NULL); MessageBox(strRead); CloseHandle(hFile); /*LPTSTR lpt33; lpt33=(LPTSTR)LocalAlloc(LPTR,dwBufferSize); LocalFree(lpt33);*/ And see MSDN_**


        **_

        whitesky


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups