Function : OS Strings

OSLoadString - Load a string from a resource file.
----------------------------------------------------------------------------------------------------------

#include <osmisc.h>

WORD LNPUBLIC OSLoadString(
HMODULE hModule,
STATUS StringCode,
char far *retBuffer,
WORD BufferLength);

Description :

OSLoadString loads a string into a buffer, given the resource ID of the string and a handle to the module containing the string table.

Use OSLoadString to interpret STATUS error codes returned from C API functions. First use the ERR macro to mask off the high order bits of the STATUS code returned by the C API function. Then pass the result as the StringCode input to OSLoadString. Specify NULLHANDLE as the hModule parameter.

Under operating systems such as Unix that do not support string tables, specify NULLHANDLE as the hModule parameter. OSLoadString will search the string tables internal to Domino and Notes for a string matching the resource ID specified by StringCode.

Under Windows, you may use the hModule parameter to specify a non-Domino or non-Notes module, and the StringCode parameter to specify a non-Domino string. OSLoadString will search for the string specified by StringCode in the string table associated with the specified module first. If the string is not found, it goes on to search the string tables internal to Domino and Notes.

Parameters :

Sample Usage :

nError = NSFDbOpen (szDBFileNameString, &hNotesDB);

if (nError != NOERROR)
{
   OSLoadString(hModule, ERR(nError),
           szErrorString, LINEOTEXT-1);
   MessageBox (GetFocus(), szErrorString,
          "Notes Error", MB_OK);
   goto RETURN;
}


See Also :

OSTranslate
----------------------------------------------------------------------------------------------------------