8.2.4 Implementation of Callback Functions


   Implementation of CallBack Functions:


Here is a Callback function from command line sample:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//
// Implements the callback function.
//
// event: The event param is structure of type _SD_SDK_SECURE_ENCODE_CALLBACK_EVENT
// p_delta_encode_user_data: The parameter type is void. You may pass extra context information down
//                           into the callback function with the use of this userdata argument.
//
// Return type is SD_SDK_SECURE_ENCODE_RETURN_ID. Defined also in SecureEncodeSDK.h
//
const SD_SDK_SECURE_ENCODE_RETURN_ID  __stdcall  _cmd_line_secure_callback(_SD_SDK_SECURE_ENCODE_CALLBACK_EVENT _sd_sdk_event, void *p_delta_encode_user_data)
{
        if (nullptr != lpfnSecureENCODE_Dll_Main_getString_Fnct)
        {
                const wchar_t* _operation_name = (*lpfnSecureENCODE_Dll_Main_getString_Fnct)(_sd_sdk_event.even_param_ID);
                wprintf(L"\r SecureENCODING, please wait: %-60s %3.03f%% [ Overall: %3d%% ]    ", _operation_name, _sd_sdk_event.dbl_operation_progress_indicator, _sd_sdk_event.uint_main_progress_indicator);
        }
        else
        {
                // Operation description text not available...
                wprintf(L"\r SecureENCODING, please wait: %3.03f%% [ Overall: %3d%% ]    ", _sd_sdk_event.dbl_operation_progress_indicator, _sd_sdk_event.uint_main_progress_indicator);
        }
        return SD_SDK_ENCODE_NO_ERROR_;
}