Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosGetResource (1.2)
◄Changes► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSRESOURCES
USHORT DosGetResource(hmod, idType, idName, psel)
HMODULE hmod; /* module handle */
USHORT idType; /* resource-type identifier */
USHORT idName; /* resource-name identifier */
PSEL psel; /* pointer to variable for resource selector */
The DosGetResource function retrieves the specified resource from a
specified executable file. The function allocates a segment, copies the
resource into the segment, and returns the segment selector. A process can
use this segment selector to access the resource directly.
This function is included in MS OS/2 version 1.2 for compatibility purposes
only. All new applications should use the DosGetResource2 function, which
returns a far pointer to the resource, rather than a selector.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hmod Identifies the module that contains the resource. This parameter
can be either the module handle returned by the DosLoadModule
function or NULL for the application's module.
idType Specifies the type of resource to retrieve. For a list of
predefined types, see the ◄Resource types► topic.
idName Specifies the name of the resource to retrieve.
psel Points to the variable that receives the selector of the segment
containing the resource.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
ERROR_CANT_FIND_RESOURCE
ERROR_INVALID_HANDLE
ERROR_INVALID_MODULE
ERROR_INVALID_SELECTOR
See Also
DosGetResource2, DosLoadModule, Resource Compiler
♦