DTWAIN_GetResourceString

DTWAIN_GetResourceStringA

DTWAIN_GetResourceStringW

Top  Previous  Next

The DTWAIN_GetResourceString function returns a string from one of twain resource files

 

LONG DTWAIN_GetResourceString (

LONG

ResourceID,

LPTSTR

szBuffer,

LONG

Maxlen );

 

Parameters

ResourceID

Specifies the ID number of the resource.

 

szBuffer

Specifies the address of the character buffer to store the resource string. To ignore this value, this should be NULL.

 

MaxLen

Specifies the maximum number of characters to copy to szBuffer. This argument is ignored if szBuffer is NULL.

 

 

Return Values

If the function succeeds, the length of the string stored in szBuffer, or if szBuffer is NULL, the length of the string required to store the entire error message.  If the function fails, DTWAIN_FAILURE1 is returned.

 

Character specific version

ANSI version:

DTWAIN_GetResourceStringA

Unicode version:

DTWAIN_GetResourceStringW

 

Comments

The DTWAIN_GetResourceString function fills in szBuffer with the resource associated with the identifier ResourceID.  The Maxlen is the number of characters of the string that will be copied to szBuffer, including the terminating null character.  

 

If szBuffer is NULL, then the MaxLen argument is ignored, and the return value is the number of characters required to store the entire string, including the terminating NULL character.  No characters are copied to szBuffer if szBuffer is NULL.


The ResourceID to use can be found in the relevant text language resource file.  Note that the resource ID number will never be obsolete, i.e. removed from the original resource files.  Thus, unless you changed the resource file in some way, the ResourceID will always point to a valid string, as long as the ID exists in the resource file.


If the ID does not exist in the resource file, the default is an English resource, or blank if there is no ID associated with the English resources.

 

To load a language's resource, see DTWAIN_LoadCustomStringResources.


TWAIN State Transitions

None

 

Prerequisite Calls

None.

 

See Also

DTWAIN_GetLastError