Remove ErrorOut function

- replace the ErrorOut function with a simple return E_FAIL
- there is non reason to call some MessageBox()
This commit is contained in:
Tino Reichardt
2018-10-31 10:44:47 +01:00
parent 089a2d7574
commit ed069bab9e
18 changed files with 10 additions and 112 deletions

View File

@@ -24,18 +24,6 @@ CEncoder::~CEncoder()
LZ5MT_freeCCtx(_ctx);
}
HRESULT CEncoder::ErrorOut(size_t code)
{
const char *strError = LZ5MT_getErrorString(code);
wchar_t wstrError[200+5]; /* no malloc here, /TR */
mbstowcs(wstrError, strError, 200);
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
MyFree(wstrError);
return S_FALSE;
}
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARIANT * coderProps, UInt32 numProps)
{
_props.clear();
@@ -121,7 +109,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
if (LZ5MT_isError(result)) {
if (result == (size_t)-LZ5MT_error_canceled)
return E_ABORT;
return ErrorOut(result);
return E_FAIL;
}
return res;