|
-
Feb 2nd, 2002, 05:39 PM
#1
LockFile etc.
I was looking through the API Viewer and I found these:
Public Declare Function LockFile Lib "kernel32" Alias "LockFile" (ByVal hFile As Long, ByVal dwFileOffsetLow As Long, ByVal dwFileOffsetHigh As Long, ByVal nNumberOfBytesToLockLow As Long, ByVal nNumberOfBytesToLockHigh As Long) As Long
Public Declare Function LockResource Lib "kernel32" Alias "LockResource" (ByVal hResData As Long) As Long
I am assuming the first one locks a file, and the second one locks a resource (ie: drive or folder, etc.) Am I right? How would I use them? (A practical example is worth a thousand words)
-
Feb 3rd, 2002, 06:05 PM
#2
A resource lock is a lock on a resource (graphic, text, etc. ) - like the resources you store in a resource file that VB compiles into part of an .exe file. It is NOT a folder or a drive. It's found only in an .exe file.
Lockfile locks a section (defined region) of a file. You have to call
Createfile to use it.
Neither one of these is of any use in VB unless you are writing virtually everything in api, in which case you should use C++.
Lockfile is implemented in the open statment in VB, for example.
Resource locking is handled automatically by VB as needed.
Since you don't seem to have encountered resource files, open up MSDN Library and start reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|