Reads a string from an ‘STR#
‘ string list resource.
bool ACAPI_Resource_GetLocStr ( char* str, short resID, short index, GSResModule resModule = ACAPI_GetOwnResModule () );
Parameters
- str
- [out] The pointer of the string.
- resID
- [in] The resource ID of the ‘
STR#
‘ resource in the GRC file. - index
- [in] The index of the string in the resource.
- resModule
- [in] The resource module to load the resource from. The default value is the add-on’s own resource module.
Return Values
true
- The string was retrieved successfully.
false
- The string wasn’t retrieved.
Remarks
This function is used to load a string from a string list resource, which requires localization.
The GRC compiler uses the ‘STR#
‘ resource type for this purpose. The different lines in the resource will be the indices referenced by index
parameter. For more information about the structure of the GRC file please refer to the GRC documentation.
Example
/* This is the according part of the GRC file: */ 'STR#' 32510 "Fix strings" { /* [ 1] */ "Saving the file in abc format" /* [ 2] */ "You have canceled the operation!" } /* In the source of the add-on it can be referred like this */ char own_res_str[256]; bool succ; succ = ACAPI_Resource_GetLocStr (own_res_str, 32510, 1, ACAPI_GetOwnResModule ()); if (succ) { /* Writing the string in the Report Window */ ACAPI_WriteReport (own_res_str, false); }
Output in the report window is: “Saving the file in abc format”.
Requirements
- Version: API 2.1 or later
- Header: ACAPinc.h
See Also
ACAPI_Resource_GetLocUStr, ACAPI_Resource_GetFixStr, ACAPI_GetOwnResModule,
Resource Manager, API Functions