DTWAIN_LoadCustomStringResource

Top  Previous  Next

The DTWAIN_LoadCustomStringResource loads one of the DTWAIN text resource files for use by DTWAIN.

 

DTWAIN_BOOL DTWAIN_LoadCustomStringResource ( LPCTSTR File );

 

 

Parameters

 

File

Specifies the file that contains the language strings used by DTWAIN.  This name can be the full path name of the file.

 

Return Values

If the function succeeds, TRUE is returned.  If the function fails FALSE is returned.

 

Character specific version

ANSI version:

DTWAIN_LoadCustomStringResourceA

Unicode version:

DTWAIN_LoadCustomStringResourceW

 

Comments

The DTWAIN_LoadCustomStringResource function allows an application to load a file that contains the language strings used by DTWAIN for error messages (when DTWAIN_GetErrorString is called), when logging messages using DTWAIN_SetTwainLog, and for the custom strings used by the TWAIN Select Source dialog whenever DTWAIN_SelectSource2 is called.

 

Calling DTWAIN_LoadCustomStringResource will use the strings defined in a text file to override the equivalent strings used for DTWAIN messages (see DTWAIN_LoadLanguageResource).  This allows you to customize any error or informational string that DTWAIN uses.

 

In the DTWAIN installation directory, the StringResource folder contains text files that represents all the English, German, Italian, Spanish, French, and Dutch DTWAIN strings.  It is advised that you base your custom string text file on these files.

 

The text files must follow this format:

 

resource-number    resource-name    resource-string

 

For example, these lines are contained in StringResource\dtweng.txt:

 

1001     DTWAIN_ERR_BAD_HANDLE                  Invalid DTWAIN_HANDLE                          

1002     DTWAIN_ERR_BAD_SOURCE                  Invalid DTWAIN_SOURCE

1003     DTWAIN_ERR_BAD_ARRAY                   Invalid DTWAIN_ARRAY      

                                                                                                                                                                                   

The first column represents the DTWAIN resource number.  For most resource numbers, the numbers represent the DTWAIN error message number.  For example 1001, 1002, and 1003 represent DTWAIN errors -1001, -1002, and -1003.

 

The second column is the mnemonic name associated with the resource number.  For most of these names, they coincide with the names found in DTWAINC.H.  For example, for error -1001, the name associated with this error is DTWAIN_ERR_BAD_HANDLE.

 

The third column is the actual string that is displayed to the user whenever the resource-number is used.  For example, when DTWAIN_GetErrorString is called with an error number of -1001, the string returned is "Invalid DTWAIN_HANDLE".

 

Note that the important columns are the resource-number and resource-string.  The resource-name column must be present, but it isn't used internally by DTWAIN.  The resource-name column is there just for informational purposes.

 

 

TWAIN State Transitions

None

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize