Usin Rar29.so

Help
estux
2013-12-11
2013-12-11
  • estux

    estux - 2013-12-11

    I am loading 7z.so for descompresing files in c++ (Qt). I load it using QLibrary. Everything is working fine but Rar support (using 7z.dll in windows is fine because it has the rar codec embebed).

    My code for opening a file using 7z.so (7z.dll) is:

    ...
    createObjectFunc(&CLSID_CFormatRar, &IID_IInArchive, (void **)&archive)
    ...
    fileSpec->Open(archiveName)
    ...
    archive->Open(file, 0, openCallback)
    ...

    Where and how should I load Rar29.so in order to get this code working fine?

     
  • Igor Pavlov

    Igor Pavlov - 2013-12-11

    Look LoadCodecs.cpp and LoadCodecs.h

    Create object that implements ICompressCodecsInfo like in LoadCodecs.cpp.
    Load both .so files.
    Create RARHandler object.
    Request ISetCompressCodecsInfo interface from created RARHandler object.
    Call ISetCompressCodecsInfo->SetCompressCodecsInfo

     
  • estux

    estux - 2013-12-11

    Thank you very much for your help Igor, and for all your work in 7z.

    About RARHandler, is CHandler the right class? Now I am using CMyComPtr< IInArchive > archive, so I should use CMyComPtr< CHandler > rarArchive instead?

    Thank you again.

     
    Last edit: estux 2013-12-11
  • Igor Pavlov

    Igor Pavlov - 2013-12-11

    RARHandler is CMyComPtr< IInArchive > object.
    RARHandler will ask (via ICompressCodecsInfo) your client app to create rar29's ICoder object.
    And your app must create that ICoder object via rar29.so.
    LoadCodecs.cpp does it.
    You can simplify LoadCodecs.cpp code, if you need only things for RAR's.

     
  • estux

    estux - 2013-12-11

    Thanks!

    Yes, I am simplifying the class a lot, I only need a few lines of code.

    My last issue is a compiler error: "undefined reference to 'IID_ISetCompressCodecsInfo' ". What is the GUID for this interface?

    EDIT: Sorry, I have found it in the guid.txt

    You really have help me a lot.

     
    Last edit: estux 2013-12-11

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks