 |
LockResource Add comment W32 Constants Translate this page |
 |
 |
|
The LockResource function locks the specified resource in memory. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
LPVOID LockResource(
HGLOBAL hResData
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER LockResource IN kernel32;
INTEGER hResData
|
 |
 |
 |
| Parameters: |
 |
hResData
[in] Handle to the resource to be locked. The LoadResource function returns this handle. |
 |
 |
| Return value: |
 |
| If the loaded resource is locked, the return value is a pointer to the first byte of the resource; otherwise, it is NULL. |
 |
 |
| My comment: |
 |
MSDN:
Note that hResData parameter is listed as an HGLOBAL variable only for backwards compatibility. Do not pass any value as a parameter other than a successful return value from the LoadResource function.
The pointer returned by LockResource is valid until the module containing the resource is unloaded. It is not necessary to unlock resources because the system automatically deletes them when the process that created them terminates.
Do not try to lock a resource by using the handle returned by the FindResource or FindResourceEx function. Such a handle points to random data.
|
 |
 |
| Word Index links for the LockResource : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2003-05-16 10:14:13 | | Modified: | 2003-05-16 10:17:24 | Visited in last 7 days: 12 |