This call returns the segment selector of the specified resource segment.
DosGetResource
ModHandle (HMODULE) - input
Value
Resource segments are read-only data segments that can be accessed dynamically at run time. The access key consists of two 16-bit numbers, the first of which is a type ID and the second, a name ID. These numbers are similar in concept to the file extension and file name portions of a file name.
The advantage of resource segments is that they can be bundled into an application's executable file, so a single file contains all of the code and data for an application.
It is recommended that resource segments obtained through DosGetResource only be freed using DosFreeSeg.
OS/2 Version 1.2 added two new functions, DosGetResource2 and DosFreeResource, to load and free an application specific resource. DosGetResource2 returns a far pointer to a resource rather than the selector returned via DosGetResource. It is recommended that applications targeted for OS/2 1.2 use DosGetResource2 and DosFreeResource. Applications that wish to execute on OS/2 1.1 and 1.2 should use the OS/2 run-time dynamic link capabilities, DosLoadModule and DosGetProcAddr, to get the address of DosGetResource2 and DosFreeResource when executing on OS/2 1.2. If the DosGetProcAddr call to obtain the address of DosGetResource2 and DosFreeResource fails, the application can call DosGetResource and DosFreeSeg. Applications that use DosGetResource2 and DosFreeResource allow OS/2 to optimize memory allocation associated with the applications resource.