rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
602 stars 110 forks source link

[Bug]: can not uncompress .iso and .doc file #156

Closed ShiverZm closed 11 months ago

ShiverZm commented 11 months ago

bit7z version

4.0.x RC

Compilation options

BIT7Z_AUTO_FORMAT

7-zip version

v22.01

7-zip shared library used

7za.dll / 7za.so

Compilers

MSVC

Compiler versions

vs2019

Architecture

x86_64

Operating system

Windows

Operating system versions

win10

Bug description

can not uncompress .iso and .doc file

Steps to reproduce

int main(int argc, char* argv[]) {
    try { // bit7z classes can throw BitException objects
        using namespace bit7z;

        Bit7zLibrary lib{ "D:\\workspace\\github\\bit7z\\bin\\x64\\Debug\\7za.dll" };
        //BitArchiveReader arc{ lib, "D:\\workspace\\github\\test_bit7z\\test_office.7z", BitFormat::SevenZip };
        //BitArchiveReader arc{ lib, "D:\\test_office.doc", BitFormat::Compound };
        BitArchiveReader arc{ lib, "D:\\Download\\cn_visual_studio_professional_2013_with_update_5_x86_dvd_6815749.iso", BitFormat::Iso };

        // Printing archive metadata
        std::cout << "Archive properties" << std::endl;
        std::cout << "  Items count: " << arc.itemsCount() << std::endl;
        std::cout << "  Folders count: " << arc.foldersCount() << std::endl;
        std::cout << "  Files count: " << arc.filesCount() << std::endl;
        std::cout << "  Size: " << arc.size() << std::endl;
        std::cout << "  Packed size: " << arc.packSize() << std::endl;
        std::cout << std::endl;

        // Printing the metadata of the archived items
        std::cout << "Archived items";
        auto arc_items = arc.items();
        for (auto& item : arc_items) {
            std::cout << std::endl;
            std::cout << "  Item index: " << item.index() << std::endl;
            std::cout << "    Name: " << item.name() << std::endl;
            std::cout << "    Extension: " << item.extension() << std::endl;
            std::cout << "    Path: " << item.path() << std::endl;
            std::cout << "    IsDir: " << item.isDir() << std::endl;
            std::cout << "    Size: " << item.size() << std::endl;
            std::cout << "    Packed size: " << item.packSize() << std::endl;
            std::cout << "    CRC: " << item.crc() << std::endl;
        }
    }
    catch (const bit7z::BitException& ex) { /* Do something with ex.what()...*/ 
        printf(ex.what());
    }
    return 0;
}

Expected behavior

can uncompress .iso and .doc successfully!

Relevant compilation output

No response

Code of Conduct

ShiverZm commented 11 months ago

Failed to get class object: ClassFactory The requested class could not be supplied

ShiverZm commented 11 months ago

i know it ,it need use 7z.dll!!!!!