SetFilePointer a, 0, 0&, FILE_END 就可以了。 _如若我爱你 啥也不懂 1 谁说C不支持64位整形啊 寰神结 数据库 10 - -解释一下2F:SetFilePointer支持大文件(4GB以上),显而易见一个Long是不够用的,因为它只是32位占4字节的变量,最大取值&HFFFFFFFF == 4GB。所以要用到64位占8字节的变量,就是...
②FILE_CURRENT:从当前的位置,向后(正lDistanceToMove),或向前(负lDistanceToMove)移动; ③FILE_END:距离文件结尾lDistanceToMove个字节。 函数返回值为文件指针相对于文件开头的位置。如果函数调用失败,则返回0xFFFFFFFF,可以通过GetLastError函数获取错误码。 3. SetFilePointer函数的使用方法 下面简单介绍一下如何使...
FILE_CURRENT 1 起点是文件指针的当前值。 FILE_END 2 起点是当前文件结束位置。 返回值 如果函数成功且lpDistanceToMoveHigh为NULL,则返回值为新文件指针的低序DWORD。注意如果函数返回除 INVALID_SET_FILE_POINTER以外的值,则对SetFilePointer的调用已成功。 无需调用GetLastError。
- FILE_END:以文件结尾为基准进行偏移。 三、函数使用步骤 步骤一:引入头文件和库文件 使用InternetSetFilePointer函数需要在代码中引入相应的头文件和链接库。在C/C++代码中,需要引入wininet.h头文件,并将wininet.lib链接到工程中。 步骤二:打开一个Internet连接或URL 在使用InternetSetFilePointer函数之前,需要先打开...
InternetReadFile 到达文件末尾后,不能使用此函数。对于由 HttpOpenRequest 创建并由 HttpSendRequestEx 发送的 HINTERNET 句柄,在使用 InternetSetFilePointer 之前,必须在句柄上调用 HttpEndRequest。如果内容长度未知,则无法可靠地使用 InternetSetFilePointer。
To do this, use FILE_END for dwMoveMethod and seek to location zero. The file offset returned is the length of the file. However, this practice can have unintended side effects, such as failure to save the current file pointer so that the program can return to that location. It is ...
SetFilePointer (hFile, lDistance, NULL, FILE_BEGIN) ; if (dwPtr == 0xFFFFFFFF) // Test for failure { // Obtain the error code dwError = GetLastError() ; // Deal with failure // . . . } // End of error handler // // Case Two: calling the function with lpDistanceToMoveHigh...
FILE_END Indicates that the starting point is the current end-of-file position.Return ValueThe new file pointer indicates success. A value of 0xFFFFFFFF indicates failure. To get extended error information, call GetLastError. However, because 0xFFFFFFFF is a valid value for the new file pointer...
FILE_CURRENT 1 The starting point is the current value of the file pointer. FILE_END 2 The starting point is the current end-of-file position.Return ValueIf the function succeeds and lpDistanceToMoveHigh is NULL, the return value is the low-order DWORD of the new file pointer.Note If...
FILE_END Indicates that the starting point is the current end-of-file position. Return Value The new file pointer indicates success. A value of 0xFFFFFFFF indicates failure. To get extended error information, callGetLastError. However, because 0xFFFFFFFF is a valid value for the new file point...