Hello to all.
I use Client7z example with dynamic dll linking. Is there any possibility to automatically detect proper archive format or GUID for opening file? As I see now, I need to set abviously GUID for file in CreateObject function:
createObjectFunc(&uid, &IID_IInArchive, (void **)&archive)
Is it possible to open any supported archive format using dll?
Thanks in advance.
7z.dll doesn't contain such code.
7-Zip uses complex code (OpenArchive.cpp) to open any type archive.
You can try to use that OpenArchive.h interface.
Thanks for the answer Igor!
I apologize for probably a stupid question, but is it possible to use OpenArchive source code together with 7z.dll?
and one more question: does it make sense to use the technique of determining proper GUID by file extension? This option is suitable for me, but maybe there are some pitfalls.
find answer on my second question by myself: it's cannot be done for iso archive format at least.
1) Yes, for example, 7z.exe uses 7z.dll via OpenArchive.
2) guid by ext is OK for 80-90% cases.
And some examples for another cases:
ISO / UDF with iso etension,
SFX archives (exe extension),
renamed archives (like RAR archive with ZIP extension).
Trying to use code from Client7z and 7z922\CPP\7zip\UI\Console with OpenArchive, but so far without success.
g_NumArcs variable in HRESULT CCodecs::Load() function equals to zero and program stops at if (codecs->Formats.Size() == 0) check. It's hard to understand completely how it works, especially if you trying to use it on Qt and C++ is not your primary language...
My goal is to simply - get list of contents of any supported archive, that's it.
I think about solution with iteration through each guid and try to open file using it, because it seems most simple way. The only question is: does this not strongly affect the performance?
2) You need to define
CCodecs *codecs = new CCodecs;
> compressCodecsInfo = codecs;
HRESULT result = codecs->Load();
Thank you very much for help, Igor! All works now like a charm.
Thanks again for a great library!
Log in to post a comment.