87 The parameter is incorrect.  ERROR_INVALID_PARAMETER
查看MSDN,该函数的参数说明吧 

解决方案 »

  1.   

    buffer 大小为 8 字节你读取 10 字节即时成功也会有问题吧
      

  2.   

    看过MSDN该函数说明,函数类型,使用应该没错。从网上看到的其他人的样例也都是这样的。
      

  3.   

    这地方可能会出问题,但是之前buffer设置100个字节也不行呀
      

  4.   

    看过MSDN该函数说明,函数类型,使用应该没错。从网上看到的其他人的样例也都是这样的。
    提示是参数错误,肯定是有问题的
    lpOverlapped 
    Pointer to an OVERLAPPED structure. This structure is required if hFile was created with FILE_FLAG_OVERLAPPED. If hFile was not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the read operation starts at the current file position and ReadFile does not return until the operation has been completed. If hFile is not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not NULL, the read operation starts at the offset specified in the OVERLAPPED structure. ReadFile does not return until the read operation has been completed. 
      

  5.   

    看过MSDN该函数说明,函数类型,使用应该没错。从网上看到的其他人的样例也都是这样的。
    提示是参数错误,肯定是有问题的
    lpOverlapped 
    Pointer to an OVERLAPPED structure. This structure is required if hFile was created with FILE_FLAG_OVERLAPPED. If hFile was not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the read operation starts at the current file position and ReadFile does not return until the operation has been completed. If hFile is not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not NULL, the read operation starts at the offset specified in the OVERLAPPED structure. ReadFile does not return until the read operation has been completed. 
    那我该怎么改程序呢?本人新手,怎么能确定lpOverlapped is or is not NULL呢?
      

  6.   

    看过MSDN该函数说明,函数类型,使用应该没错。从网上看到的其他人的样例也都是这样的。
    提示是参数错误,肯定是有问题的
    lpOverlapped 
    Pointer to an OVERLAPPED structure. This structure is required if hFile was created with FILE_FLAG_OVERLAPPED. If hFile was not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the read operation starts at the current file position and ReadFile does not return until the operation has been completed. If hFile is not opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not NULL, the read operation starts at the offset specified in the OVERLAPPED structure. ReadFile does not return until the read operation has been completed. 
    那我该怎么改程序呢?本人新手,怎么能确定lpOverlapped is or is not NULL呢?Create的时候加上FILE_FLAG_OVERLAPPED标记
      

  7.   

    试试这个吧:TCHAR devName[256] = { 0 };
    GetVolumeNameForVolumeMountPoint(TEXT("I:\"), devName, 256);
    HANDLE hFile = CreateFile(devName, GENERIC_READ, FILE_SHARE_READ , NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);