|
Dear Franky Braem,
I am using SawZip.dll and I want add whole directory and subdirectory into a zip file but version 2.0 is not supported. I visit your website but I don't see any where to download version 2.6. Could you send it to me by email or give me a directly link to get it.My email is nttrungyb@gmail.com. Thanks a lot.
|
|
|
|
|
Add a whole directory to zipfile -- much like what you can do with winzip.
Maybe I missed something, but I cannot do this with AddFileByName.
Here's my working directory structure
c:\Files\
a.gif
b.gif
Sub_dir
c.gif
d.gif
If I use
AddFileByName(A2BSTR("c:\\Files\\*"), 9, TRUE, TRUE);
only a.gif and b.gif is added to the zip file.
BTW, there's no path info attached to a.gif, b.gif.
Any help will be appreciated.
(PS, I always encounter runtime errors if I use smarter pointer with the import directive, anyone also get that error?)
---------------------------------------------
#import "SAWZip.tlb" no_namespace named_guid
main() {
USES_CONVERSION;
CoInitialize(NULL);
IClassFactory *pCF;
HRESULT hr;
hr = CoGetClassObject(__uuidof(Archive), CLSCTX_ALL, NULL, IID_IClassFactory, (void **)&pCF);
IArchive *archive;
hr = pCF->CreateInstance(NULL, __uuidof(IArchive), (void **)&archive);
archive->Create(A2BSTR("C:\\test.zip"));
IFiles *files = archive->Files;
files->AddFileByName(A2BSTR("c:\\Files\\*"), 9, TRUE, TRUE);
archive->Close();
archive->Release();
pCF->Release();
CoUninitialize();
}
|
|
|
|
|
OK. After studying the source, I have concluded that indeed this is not supported. However, I have found a easy way to add the whole directory by using another module provided by CP
IFiles *files = archive->Files;
CFileInfoArray cfia;
cfia.AddDir(workdir.c_str(), "*.*", TRUE,
CFileInfoArray::AP_SORTBYNAME | CFileInfoArray::AP_SORTASCENDING, FALSE);
for (int i=0; i< cfia.GetSize(); i++) {
files->AddFileByName(A2BSTR((LPCTSTR)(cfia[i].GetFilePath())), 9, VARIANT_TRUE, VARIANT_TRUE);
}
BTW, I'm not sure if the author aware that "relative path" info is more likely to be what the user wanted instead of the "full path" info.
Will this be included in the next release??
Anyway, nice work !!!
|
|
|
|
|
ufff. this relative-path problem makes me crying.
|
|
|
|
|
The new version (2.6) which you can download from my website contains a new method to add directories and subdirectories. Relative paths are still not possible while adding the files, but you can rename the files after they are added. Relative paths is a functionality for release 3.0.
|
|
|
|
|
Hey!
Thanx a lot!
I choosed the renameing way soon.
It's cool! I like your Zipping!
|
|
|
|
|
I like the SawZip dll, it does a damn good job, but I MAY have found a bug. Adding files to an existing zip doesn't overwrite files with the same name IF fullpaths is true, but it works Ok if paths aren't stored. Is this correct ?
Regards, Nick
|
|
|
|
|
It's possible todo a Self-extracing file (exe) instead on zip file ?
|
|
|
|
|
Hi all,
I am using sawzip.dll in our project,its really a great job,but IFile.Extract() gives abnormal program termination win windows 2000.
is the latest version 2.4 compatible with windows 2000 and windows NT.
Do we need to have necessarily have atl.dll now for windows 95.
regards
Randheer
|
|
|
|
|
When trying this:
//JScript On:
var objzip = new ActiveXObject("SawZip.Archive");
objzip.Open("d:\\temp\\test.zip");
var objFiles = objzip.Files;
var lCount = objFiles.Count;
var i = 1;
for (i = 0; i < lCount; i++)
{
var objFile = objFiles.Item(i);
var objfilename = objFile.Extract("d:\\Buffer\\");
}
objzip.Close();
//JScript Off:
An exception occurs with the builded sources provided in this arcticle. (Win 2000, VC6.0 SP5)
I think API-Function CreateFile(...) don't like to have a complete path, when creating files.
So my modification in STDMETHODIMP CFile::Extract(BSTR aPath, BSTR *pFileName):
target += fname; ----> target = fname;
And it works on my Workstation
|
|
|
|
|
I supose the error isn't in path but some zip archives have the FILE_FLAG_POSIX_SEMANTICS inside, when I compiled the VB sample, I've got an exception in Extract and following the error I've found the extraction path at 'c:\Temp' and the directory is named 'c:\temp' the upper case on 'T' and the FILE_FLAG_POSIX_SEMANTICS make the exception.
To resolve this, in File.cpp at CFile::Read I've added the following line and it works fine:
memcpy(&m_offset,buffer + 42, 4);
//new line comes here
m_externalAttr&=~FILE_FLAG_POSIX_SEMANTICS;
//end
if (memcmp(m_signature, m_gszSignature, 4) != 0)
Salutacions,
Hzi
|
|
|
|
|
I found a small oversight bug (but isn't it the small ones that cause us to go crazy??) which prevented me from being able to perform RemoveDirectory().
In File.cpp there is a FindFirstFile() call. The call returns a handle which needs to be closed or a handle to the directory gets left open. My solution is as follows:
// Code written by Frederic St-Laurent
// Get the file attributes
m_internalAttr = GetFileAttributes( fullFileName.c_str() );
// Get the file last write time
WIN32_FIND_DATA FindData;
HANDLE hFind = FindFirstFile( fullFileName.c_str(), &FindData );
FileTimeToDosDateTime(&FindData.ftLastWriteTime, &m_modDate, &m_modTime);
FindClose(hFind); //~~ Free handle opened by FindFirstFile -- Paul Wolfensberger
...
...
...
Paul
|
|
|
|
|
hi,
I just used the component in VB and it worked , but when i'am trying to use the same in VC++ it is
giving me an error when i try to invoke the Open method.The error i get is -:
First-chance exception in mfc1.exe: 0xC0000005: Access Violation.
Any idea....?
|
|
|
|
|
I use regsvr32.exe to register the SAWzip.dll (Windows NT / Version 1.6.01)
regsvr32 SAWzip.dll => Error 0x80040154
The zlib.dll and SAWzip.dll are installed
The error occurs only under Windows NT !
(Windows 98 is ok !)
What should i do ? .....
|
|
|
|
|
I've tried to register SAWZip(version 2.0) on my PC at work (Windows NT) and had no problems. Are you sure that zlib.dll is in a directory that regsrv32 can find? Another problem can be that you don't have or have an invalid version of ATL.DLL .
|
|
|
|
|
I have checked the SAWzip.dll with depend.exe - the zlib.ddl has been found also in \\winnt\system32
The ata.dll was not on the computer - After install this library - the same eror occurs !
(Its installed vom from a windows 98 computer in the folder \\winnt\system32 ??? )
(On my windows 98 PC the depend.exe founds an error with the msvcp60.dll - after install this library sawzip runs there !)
|
|
|
|
|
Hi,
I have the same error while trying to register SAWZIP (error 80040145)
This is happening on Win98, after a clean install (nothing on it but only video driver)
I copied also ATL.DLL and MSVCL60.DLL, adn the same error.
If I install VS6, the control can be registered.
I'll deeply appreciate any quick help. I'm in the position of deploying an application who use it, and I just discovered this problem (usually it worked on several computers, but on one it fail to register, and this made me to make this clean install test).
If you can give me a quick sollutiuon on e-mail, I'll deeply appreciate this.
Regards,
Bogdan
|
|
|
|
|
I have the same problems. But after i have copied the atl.dll to the system32 - Directory the same error occured. After registered the atl.dll with regsvr32 I registered sawzip.dll !
I hope it will help you.
Wolwer
|
|
|
|
|
I had a similar problem on Windows XP where when I tried to do:
regsvr32 SAWZip.dll
I would get a Microsoft error message saying "Module SAWZip.dll could not be found" or something similar.
This only happend on the SAWZip.dll that I compiled on my system, and not with the version I downloaded in SAWZip98.zip
Reading the above posts gave me the idea to open up SAWZip.dll with the Dependency Viewer that's part of MSVS tools, and it turns out there was a problem with zlib.dll.
So I put the zlib.dll that came in SAWZip98.zip in the same directory with the SAWZip.dll that I just compiled, and then regsvr32 worked perfectly.
Try to have zlib.dll in the same directory with SAWZip.dll when you try to regsvr32
|
|
|
|
|
I had a very similar problem registering the Win98 version of SawZip on a clean Windows 98 machine.
I found that the MSVCP60.DLL (Visual C++ 6.0 runtime) was not on that machine yet, and I didn't have that MSM selected for inclusion in my InstallShield release. I added the MSVCP60.MSM to the release, and all is well!
|
|
|
|
|
I am using the NT/Unicode control [version 1.6.0.1] from within ASP on a Win2000 Server. I am able to open archives and read various properties, but when it comes to extracting them there are problems. The ASP page comes back with the following error:
"SAWZip.File.1 error '80020009'
Unable to create the file: C:\Test\Data\Documents\Upload\name\documents1\multipleUploadDOC1.doc"
I don't know if this is related to the comment marked "Trouble with the FileSystemObject" as I am also using scripting.filesystemobject but within the ASP. I suspected it might be a permissions issue, but the dll is able to create the directory paths to the file if FullPath is True. The only problem is that is can't write the actual file, even after creating the directories. I have ensured that the user that created those folders also has write access to those folders, but no luck with getting it to work.
|
|
|
|
|
zip.Files(i).Extract aPath
aPath parameter is case sensitive. For example when I use
zip.Files(i).Extract "c:"
it would give me an error message like Yours
Unable to create the file: ......
and if I used
zip.Files(i).Extract "C:"
the operation would be completed properly.
Check it may be it would resolve your problem.
I use also FileSystemObject within my VB code and I have no problems with it.
|
|
|
|
|
I try compile the dll with VC5 and Win95, but this message is show:
SAWZip.cpp
C:\Apl\ActiveX\Controls\Zip\v2\SAWZip.h(29) : fatal error C1189: #error : this stub requires an updated version of <rpcndr.h>
Cunha
mcunha98@terra.com.br
|
|
|
|
|
I'm sorry, the message is:
fatal error C1189: #error : this stub requires an updated version of "rpcndr.h"
Cunha
mcunha98@terra.com.br
|
|
|
|
|
SAWZip is developed using Visual C++ 6.0 on a Win98 OS. I think that some ATL-features are not compatible with VC 5.
|
|
|
|