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)
archive->Open(file, 0, openCallback)
Where and how should I load Rar29.so in order to get this code working fine?
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.
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.
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.
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.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.