Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function returns a handle to a specified resource located in a dynamic-link library (DLL) or executable.
Syntax
HGLOBAL LoadResource( HMODULE hModule, HRSRC hResInfo ); |
Parameters
- hModule
-
Handle to the module whose executable file contains the resource. If hModuleis NULL, the system loads the resource from the module that was used to create the current process. In Windows CE 1.0 and 1.01, setting this parameter to NULL is not supported.
- hResInfo
-
Handle to the resource to be loaded. This handle must be created by using the FindResourcefunction.
Return Value
A handle to the data associated with the resource indicates success. NULL indicates failure. To get extended error information, call GetLastError.
Remarks
The return type of LoadResourceis HGLOBALfor backward compatibility, not because the function returns a handle to a global memory block. Always use LockResourceto convert the handle returned by LoadResourceinto a pointer.
The resources in an application, whether from an executable or a DLL, are always mapped to the address space of a process. LoadResourcesimply retrieves the address of the resource that is already in memory. LoadResourcedoes not allocate any additional memory. The pointer returned by LockResourceidentifies the address of the block of memory, in the executable or in the DLL, containing the specified resource. The system automatically deletes these resources when the process that loaded them terminates, or when FreeLibraryis used to unload a DLL that was loaded with LoadLibrary.
Requirements
Header | winbase.h |
Library | coredll.lib, Nk.lib |
Windows Embedded CE | Windows CE 1.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.