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:
Locking and unlocking file of a VFP table
LockFile
..msdn    Add comment     W32 Constants      Translate this page
Locks a region in an open file. Locking a region prevents other processes from accessing the region.
Code examples:
Locking and unlocking file of a VFP table
Declaration:
BOOL LockFile(
  HANDLE hFile,                   // handle to file
  DWORD dwFileOffsetLow,          // low-order word of offset
  DWORD dwFileOffsetHigh,         // high-order word of offset
  DWORD nNumberOfBytesToLockLow,  // low-order word of length
  DWORD nNumberOfBytesToLockHigh  // high-order word of length
);
FoxPro declaration:
DECLARE INTEGER LockFile IN kernel32;
    INTEGER hFile,;
    INTEGER dwFileOffsetLow,;
    INTEGER dwFileOffsetHigh,;
    INTEGER nNumberOfBytesToLockLow,;
    INTEGER nNumberOfBytesToLockHigh
Parameters:
hFile
[in] Handle to the file with a region to be locked. The file handle must have been created with GENERIC_READ or GENERIC_WRITE access to the file (or both).

dwFileOffsetLow
[in] Specifies the low-order word of the starting byte offset in the file where the lock should begin.

dwFileOffsetHigh
[in] Specifies the high-order word of the starting byte offset in the file where the lock should begin.

nNumberOfBytesToLockLow
[in] Specifies the low-order word of the length of the byte range to be locked.

nNumberOfBytesToLockHigh
[in] Specifies the high-order word of the length of the byte range to be locked.
Return value:
If the function succeeds, the return value is nonzero.
My comment:
MSDN: If LockFile cannot lock a region of a file, it returns zero immediately. It does not block. To issue a file lock request that will block until the lock is acquired, use LockFileEx without LOCKFILE_FAIL_IMMEDIATELY.
Word Index links for the LockFile :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-09-18 12:00:00
Modified: 2001-11-26 16:03:42
Visited in last 7 days: 10
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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.232.243)
11 sec.Function: 'waveInPrepareHeader'
21 sec.Function: 'GetOldestEventLogRecord'
32 sec.Function: 'GetTcp6Table'
43 sec.Function: 'EnumProcesses'
56 sec.Function: 'LCIDToLocaleName'
1.12 min.
Function group: 'Virtual Hard Disk (Win7)'
1.3 min.Function: 'PaintDesktop'
1.48 min.Function: 'InternetGoOnline'
1.68 min.Function: 'PathGetShortPath'
1.88 min.Function: 'GetPrinterDriverDirectory'
Google
Advertise here!