I'm a developer trying to make a small archive program using 7zip dll, but I can't figure out how to use it. I don't know where the CLSID and IID are defined, what IID to use in order to be able to compress multimple files into an archive.
My code looks something like this:
I am trying to use your powerful library in vs 2015, i have built it using nmake, and now testing 7zClient sample, as I prompted in CMD
"Client7z.exe l test.7z"
the execution failed with error ("can't create archive file")
or by CMD "Client7z.exe a test.7z test1.txt"
the execution failed with error ("Can not open file as archive")
would you tell me what happened? or how to use 7Zip in vs 2015 c++?
Yours Sincerely
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
finally i could use clinet7.exe to list zip file contents, the example works fine for zip files with extension .7z. but for .rar extension files, the line
archive->Open(file, &scanSize, openCallback) != S_OK
retruns true and then
PrintError("Can not open file as archive", archiveName);
how i fix this to open *.rar files?
and how i bulid your libraray as c++ static lib?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We are looking for the C++ DLL or static lib version of Cleint7z which we can reference and use it for compressing. Did you manage to build it? If YES, can you please guide/share bit more details of how you managed it?
Regards
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
Please tell me how you can use the ready library 7z.dll? How is this, for example, done in third-party applications like: PeaZip or WindowsRar ... ? The fact is that I cannot run the project Cleint7z in debug mode under my Visual Studio MFC project .....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cannot run the project Cleint7z in debug mode under my Visual Studio MFC project .....
If you can't run it, try to find the reason.
Simplify situation:
- use release mode instead of debug mode.
- compile Cleint7z without MFC.
- write here what version of Visual Studio.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
With the help of Client7z.cpp it was possible to successfully unpack all archives of the format 7z.
However, formats other than 7z are not decompressed.
Can you please tell me whether it is possible to unpack other archive formats using the components included in the source https://7-zip.org/sdk.html ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
lzma sdk supports only 7z format.
You need full 7-zip source code instead for all format types.
Then you must use full 7z.dll from 7-zip, and just change clsid in Client7z.cpp.
Thank you. Tried...
All zip files were successfully unpacked.
But, .rar format is not all. Those that were created in WinRar with a higher compression ratio were not unpacked.
Archives .rar created in WindowsRar were successfully unpacked.
Can you please tell me what can be done about it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Archives .rar in my program I tried to unpack with the value DEFINE_GUID_ARC (CLSID_Format, kId_Zip).
In the list of 6 values, I did not see a format similar to Rar.
Maybe you need to set another value CLSID_Format that matches the rar format?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you. Tried.
If the value is - CLSID_Format {23170F69-40C1-278A-1000-000110030000} it still doesn't open the archive.
Failed function HRESULT hrzlt = archive->Open(file, &scanSize, openCallback); hrzlt == 1
Other types of popular archives open successfully.
What else can you advise?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In Client7z.cpp If the library function IInaArchive::Extract is busy extracting a very large archive, is it possible
to get the number of bytes extracted at the same time ??
For the purpose of obtaining percentages.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm a developer trying to make a small archive program using 7zip dll, but I can't figure out how to use it. I don't know where the CLSID and IID are defined, what IID to use in order to be able to compress multimple files into an archive.
My code looks something like this:
typedef int (_CreateObject)(const GUID clsid, const GUID iid, void *outObject);
HMODULE hMod = LoadLibrary("7zra.dll");
_CreateObject pfnCreate = (_CreateObject)GetProcAddress(hMod, "CreateObject");
GUID CLSID_CFormat7z = {0x23170F69, 0x40C1, 0x2790, {0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00}};
GUID IID_Coder = {0x23170F69, 0x40C1, 0x278A, {0x00, 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00}};
ICompressCoder2 pCoder = NULL;
int i = pfnCreate(&CLSID_CFormat7z, &IID_Coder, (void*)&pCoder);
I always get a NULL pointer. Can anyone help me with a simple example please?
Try CPP\7zip\UI\Client7z example.
Thank you very much Igor.
Dear Igor
I am trying to use your powerful library in vs 2015, i have built it using nmake, and now testing 7zClient sample, as I prompted in CMD
"Client7z.exe l test.7z"
the execution failed with error ("can't create archive file")
or by CMD "Client7z.exe a test.7z test1.txt"
the execution failed with error ("Can not open file as archive")
would you tell me what happened? or how to use 7Zip in vs 2015 c++?
Yours Sincerely
probably some problem with CMD.
try another commands:
or Update Error
CMD has no error
if 7z.exe downloaded from sourceforge is used, compresed-file content are listed properly with no error!
I want to build from source files then use them in vs2015.
Show the log:
finally i could use clinet7.exe to list zip file contents, the example works fine for zip files with extension .7z. but for .rar extension files, the line
archive->Open(file, &scanSize, openCallback) != S_OK
retruns true and then
PrintError("Can not open file as archive", archiveName);
how i fix this to open *.rar files?
and how i bulid your libraray as c++ static lib?
i found how to solve last problem,
Hi Ali,
We are looking for the C++ DLL or static lib version of Cleint7z which we can reference and use it for compressing. Did you manage to build it? If YES, can you please guide/share bit more details of how you managed it?
Regards
John
Hi all!
Please tell me how you can use the ready library 7z.dll? How is this, for example, done in third-party applications like: PeaZip or WindowsRar ... ? The fact is that I cannot run the project Cleint7z in debug mode under my Visual Studio MFC project .....
If you can't run it, try to find the reason.
Simplify situation:
- use release mode instead of debug mode.
- compile Cleint7z without MFC.
- write here what version of Visual Studio.
just open
CPP\7zip\UI\Client7z\Client7z.dsp
project and compile/run it.
Hi all!
With the help of Client7z.cpp it was possible to successfully unpack all archives of the format 7z.
However, formats other than 7z are not decompressed.
Can you please tell me whether it is possible to unpack other archive formats using the components included in the source https://7-zip.org/sdk.html ?
lzma sdk supports only 7z format.
You need full 7-zip source code instead for all format types.
Then you must use full
7z.dll
from 7-zip, and just changeclsid
in Client7z.cpp.Thank you. Tried...
All zip files were successfully unpacked.
But, .rar format is not all. Those that were created in WinRar with a higher compression ratio were not unpacked.
Archives .rar created in WindowsRar were successfully unpacked.
Can you please tell me what can be done about it?
Try to unpack same "bad" rar with 7-Zip program.
This bad" rar with 7-Zip program unpacks successfully
Archives .rar in my program I tried to unpack with the value DEFINE_GUID_ARC (CLSID_Format, kId_Zip).
In the list of 6 values, I did not see a format similar to Rar.
Maybe you need to set another value CLSID_Format that matches the rar format?
Thank you. Tried.
If the value is - CLSID_Format {23170F69-40C1-278A-1000-000110030000} it still doesn't open the archive.
Failed function HRESULT hrzlt = archive->Open(file, &scanSize, openCallback); hrzlt == 1
Other types of popular archives open successfully.
What else can you advise?
Substituted the value Rar5(0xCC) and everything turned out. Thank you
In Client7z.cpp If the library function IInaArchive::Extract is busy extracting a very large archive, is it possible
to get the number of bytes extracted at the same time ??
For the purpose of obtaining percentages.