ImageGear for C and C++ on Windows v20.0 - Updated
IG_ISIS_tag_restore_file_ex
API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Tag Functions > IG_ISIS_tag_restore_file_ex

Restore tag values from a function pointer.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_restore_file_ex(
        HISISDRV hDriver,
        LPFNIG_ISIS_RESTOREEX lpfnCallback,
        LPSTR lpszFileName
);

Arguments:

Name Type Description
hDriver HISISDRV The handle to the driver.
lpfnCallback LPFNIG_ISIS_RESTOREEX Points to a callback function defined by the application.
lpszFileName LPSTR Specifies the name of the file or data object from which to restore the tag values. Passed directly to the callback.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

The IG_ISIS_tag_restore_file_ex function retrieves the stored values of all tags from a function pointer that can be used by a callback procedure. This allows an application to restore the values of all tags from an application-defined data object that was created by IG_ISIS_tag_save_file_ex.

Use IG_ISIS_tag_restore_file_ex to restore the values of all tags from a data object of the application's choice. This function accomplishes the same functionality as IG_ISIS_tag_restore_file except that rather than reading the tag values from a specified file, it sends a message to a callback function each time a value would otherwise be read from a file. Use this function together with a callback function to give the application the capability to restore the current scanner settings, after having used IG_ISIS_tag_save_file_ex to save the settings.

Example:

The following code fragment defines a callback function:

 
Copy Code
LPFNIG_ISIS_RESTOREEX SampleRestoreCallback;
int PUBLIC_FUNC SampleRestoreCallback(char FAR *lpszSection,
        char FAR *lpszEntry, char FAR *lpszDefault, char FAR
        *lpszReturnBuffer, int cbReturnBuffer, char FAR *lpszFileName);
{
        return GetPrivateProfileString(lpszSection, lpszEntry,
                   lpszDefault, lpszReturnBuffer, cbReturnBuffer,
                   lpszFileName);
}

The following code fragment defines a function that uses the callback:

 
Copy Code
int RestoreScanTags(hDriver, HWND hWnd, char FAR *lpszFileName)
{
        AT_ERRCOUNT nErrCount;
        nErrCount = IG_ISIS_tag_restore_file_ex(hDriver, SampleRestoreCallback,
                                                           lpszFileName);
        return nErrCount
};

Structures:

The callback's prototype looks like this:

 
Copy Code
typedef INT (LPACCUAPI LPFNIG_ISIS_RESTOREEX)(
        LPSTR lpszSection,
        LPSTR lpszEntry,
        LPSTR lpszDefault,
        LPSTR lpszReturnBuffer,
        INT   nReturnBuffer,
        LPSTR lpszFileName
        );

See Also

IG_ISIS_tag_save_file_ex

Is this page helpful?
Yes No
Thanks for your feedback.