Using Win32 functions in Visual FoxPro Image Gallery
File Management
..msdn
CopyFile
CopyFileTransacted
CreateDirectory
CreateFile
CreateFileTransacted
CreateHardLink
CreateSymbolicLink
DeleteFile
DeleteFileTransacted
FindClose
FindCloseChangeNotification
FindFirstChangeNotification
FindFirstFile
FindNextChangeNotification
FindNextFile
FlushFileBuffers
GetBinaryType
GetCurrentDirectory
GetDriveType
GetFileAttributes
GetFileAttributesEx
GetFileInformationByHandle
GetFileType
GetFullPathName
GetLongPathName
GetShortPathName
GetTempFileName
GetTempPath
LockFile
MoveFile
MoveFileTransacted
OpenFile
QueryDosDevice
ReadDirectoryChangesW
ReadFile
RemoveDirectory
RemoveDirectoryTransacted
ReplaceFile
SearchPath
SetCurrentDirectory
SetEndOfFile
SetFileAttributes
SetFilePointer
SetFilePointerEx
SetSearchPathMode
UnlockFile
WriteFile
_lclose
_lopen
Code examples:
Using InternetSetFilePointer when resuming interrupted download from the Internet
SetFilePointer
..msdn    Add comment     W32 Constants      Translate this page
The SetFilePointer function moves the file pointer of an open file.
Code examples:
Using InternetSetFilePointer when resuming interrupted download from the Internet
Declaration:
DWORD SetFilePointer(
  HANDLE hFile,                // handle to file
  LONG lDistanceToMove,        // bytes to move pointer
  PLONG lpDistanceToMoveHigh,  // bytes to move pointer
  DWORD dwMoveMethod           // starting point
);
FoxPro declaration:
DECLARE INTEGER SetFilePointer IN kernel32;
    INTEGER hFile,;
    INTEGER lDistanceToMove,;
    INTEGER lpDistanceToMoveHigh,;
    INTEGER dwMoveMethod
Parameters:
hFile
[in] Handle to the file whose file pointer is to be moved.

lDistanceToMove
[in] Low-order 32 bits of a signed value that specifies the number of bytes to move the file pointer.

lpDistanceToMoveHigh
[in] Pointer to the high-order 32 bits of the signed 64-bit distance to move.

dwMoveMethod
[in] Starting point for the file pointer move -- a predefined value.
Return value:
If the SetFilePointer function succeeds and lpDistanceToMoveHigh is NULL, the return value is the low-order DWORD of the new file pointer. If lpDistanceToMoveHigh is not NULL, the function returns the low order DWORD of the new file pointer, and puts the high-order DWORD of the new file pointer into the LONG pointed to by that parameter.
Usage:
#DEFINE OF_WRITE 1
#DEFINE FILE_BEGIN 0

STORE 0 TO lnSizeLo, lnSizeHi
lcOpenBuffer = Repli(Chr(0), 250)

phLocal = OpenFile(lcTargetFile, @lcOpenBuffer, OF_WRITE)
lnSizeLo = GetFileSize(phLocal, @lnSizeHi)
= SetFilePointer(phLocal, lnSizeLo, lnSizeHi, FILE_BEGIN)

* ...

= WriteFile(phLocal, @lcBuffer,;
    lnBytesRead, @lnBytesWritten, 0)

* ...
= CloseHandle(phLocal)
My comment:
This function stores the file pointer in two LONG values. To work with file pointers that are larger than a single LONG value, it is easier to use the SetFilePointerEx function.
Word Index links for the SetFilePointer :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-11-13 19:43:05
Modified: 2007-08-20 16:36:20
Visited in last 7 days: 18
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.36), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.81.69.159)
2.92 min.Function: 'RasGetCountryInfo'
4 min.Function: 'waveInGetNumDevs'
5.35 min.Function: 'StrFromTimeInterval'
5.47 min.Function: 'SetForegroundWindow'
5.62 min.Function: 'RealDriveType'
9 min.Function: 'StrToIntEx'
Google
Advertise here!