Decompressing a file using LZNV COM
8.2.1.3 Using the LZNV COM Object
8.2.1.3 Using the LZNV COM Object
This sample source code is available in LZNV_COM_Obj_Client_Tester.cpp [Project VC++CmdLineClient_for_LZNV_COM Client Project files]
#import <LZNV_COM_x64.tlb>
int _process_decode_file(LZNV_COM_Obj::ILZNV_COM_ObjPtr pLZNV_COM_Object_obj, const wchar_t* _wchr_file_in, const wchar_t* _wchr_file_out)
{
HRESULT _hres = 0;
ASSERT(pLZNV_COM_Object_obj);
if (pLZNV_COM_Object_obj == nullptr) {
return 0;
}
LZNV_FILE_COMMAND_PARAMS _com_obj_file_cmd_struct = {0};
{
_com_obj_file_cmd_struct._command_to_execute = _LZNV_COMMAND_DECODE;
_com_obj_file_cmd_struct._cpu_priority_level = _LZNV_BELOW_NORMAL_PRIORITY_CLASS;
_com_obj_file_cmd_struct._internal_verification = _LZNV_SET_INTERNAL_VERIFICATION_ON;
wcsncpy_s(_com_obj_file_cmd_struct._source_file_path, _LZNV_MAXPATH_, _wchr_file_in, _LZNV_MAXPATH_);
wcsncpy_s(_com_obj_file_cmd_struct._target_file_path, _LZNV_MAXPATH_, _wchr_file_out, _LZNV_MAXPATH_);
if (pLZNV_COM_Object_obj)
{
_hres = pLZNV_COM_Object_obj->LZNV_Main_((LZNV_COM_Obj::_LZNV_FILE_PARAM_TYPE*)&_com_obj_file_cmd_struct); //"->" overloading in action
}
}
// print stats
}