PA_GetResourceName


version 2003


PA_GetResourceName (resFile; kind; resID; name)

Parameter Type Description
resFile short → File reference number of the file to access
kind unsigned long → Kind (4 Bytes type) of resource to access
resID short → Unique resource ID
name char* ← Resource name

Description

The routine PA_GetResourceName returns in the string buffer name the name of the resource of type kind and the unique ID resID in the file referenced by resFile .

Depending on default settings or on previous calls to PA_UsePStrings or PA_UseCStrings , name will be a Pascal or an ANSI C string.

If the resource does not exist or if resFile is an invalid file reference number, the routine sets name to an empty string and PA_GetLastError returns -5 ("Resource not found").

Example

Getting information on a resource:

   short GetSomeResInfo(short resFile, unsigned long kind, short ID, long *size, char *name)
   {
      if(size)
         *size = PA_getresourceSize(resFile, kind, ID);
      if(name)
         PA_GetResourceName(resFile, kind, ID, name);
      return PA_GetLastError();
   }

See Also

PA_GetResourceIDList , PA_GetResourceNameList , PA_SetResourceName .

Error Handling

Use PA_GetLastError to see if an error occurred.