Function Bit7zLibrary

Summary

#include <include/bit7zlibrary.hpp>

(1) explicit Bit7zLibrary(const std::wstring &dll_path=DEFAULT_DLL)

(2) Bit7zLibrary(const Bit7zLibrary &)

Function overload

Synopsis

#include <include/bit7zlibrary.hpp>

explicit Bit7zLibrary(const std::wstring &dll_path=DEFAULT_DLL)

Description

Constructs a Bit7zLibrary object using the path of the wanted 7zip DLL.

By default, it searches a 7z.dll in the same path of the application.

Parameters

dll_path - the path to the dll wanted

Source

Lines 28-39 in src/bit7zlibrary.cpp. Line 49 in include/bit7zlibrary.hpp.

Bit7zLibrary::Bit7zLibrary( const std::wstring& dll_path ) : mLibrary( LoadLibrary( dll_path.c_str() ) ) {
    if ( !mLibrary ) {
        throw BitException( L"Cannot load 7-zip library (error " + std::to_wstring( GetLastError() ) + L")", GetLastError() );
    }

    mCreateObjectFunc = reinterpret_cast< CreateObjectFunc >( GetProcAddress( mLibrary, "CreateObject" ) );

    if ( !mCreateObjectFunc ) {
        FreeLibrary( mLibrary );
        throw BitException( L"Cannot get CreateObject (error " + std::to_wstring( GetLastError() ) + L")", GetLastError() );
    }
}

Synopsis

#include <include/bit7zlibrary.hpp>

Bit7zLibrary(const Bit7zLibrary &)

Description

No description yet.

Source

Line 79 in include/bit7zlibrary.hpp.






Add Discussion as Guest

Log in