PA_GetResourceName

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetResourceName (resFile; kind; resID; name)

ParameterTypeDescription
resFileshortFile reference number of the file to access
kindunsigned longKind (4 Bytes type) of resource to access
resIDshortUnique resource ID
namechar*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.


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next