②FILE_CURRENT:从当前的位置,向后(正lDistanceToMove),或向前(负lDistanceToMove)移动; ③FILE_END:距离文件结尾lDistanceToMove个字节。 函数返回值为文件指针相对于文件开头的位置。如果函数调用失败,则返回0xFFFFFFFF,可以通过GetLastError函数获取错误码。 3. SetFilePointer函数的使用方法 下面简单介绍一下如何使...
SetFilePointer a, 0, 0&, FILE_END 就可以了。 _如若我爱你 啥也不懂 1 谁说C不支持64位整形啊 寰神结 数据库 10 - -解释一下2F:SetFilePointer支持大文件(4GB以上),显而易见一个Long是不够用的,因为它只是32位占4字节的变量,最大取值&HFFFFFFFF == 4GB。所以要用到64位占8字节的变量,就是...
- FILE_END:以文件结尾为基准进行偏移。 三、函数使用步骤 步骤一:引入头文件和库文件 使用InternetSetFilePointer函数需要在代码中引入相应的头文件和链接库。在C/C++代码中,需要引入wininet.h头文件,并将wininet.lib链接到工程中。 步骤二:打开一个Internet连接或URL 在使用InternetSetFilePointer函数之前,需要先打开...
InternetReadFile 到达文件末尾后,不能使用此函数。对于由 HttpOpenRequest 创建并由 HttpSendRequestEx 发送的 HINTERNET 句柄,在使用 InternetSetFilePointer 之前,必须在句柄上调用 HttpEndRequest。如果内容长度未知,则无法可靠地使用 InternetSetFilePointer。
FILE_CURRENT 1 起點是檔案指標的目前值。 FILE_END 2 起點是目前的檔案結束位置。 傳回值 如果函式成功且lpDistanceToMoveHigh為NULL,則傳回值會是新檔案指標的低序DWORD。注意如果函式傳回INVALID_SET_FILE_POINTER以外的值,則 SetFilePointer的呼叫已成功。 您不需要呼叫GetLastError。
dwPtr = SetFilePointer (hFile, lDistance, NULL, FILE_BEGIN); if (dwPtr == 0xFFFFFFFF) // Test for failure. { // Obtain the error code. dwError = GetLastError(); // Resolve the failure. } // End of error handler. Requirements...
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...
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 failing to save the current file pointer so that the application can return to that location. It is...
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...