terb
New Member
Posts: 4
|
Post by terb on Mar 31, 2004 17:07:55 GMT -5
Hi I'm testing this great lib, but I have run into trouble. I cant name Zipname anything else than the original filename !? I wanna create zipfile using mmBlock. Lets say its called TEST.EXE. Then before doing anything else, I code: VCLZip->ZipName="C:\ZZZZZZ.zip"; then I do the rest of the code. BUT its wont create anything else that than a file called "ZZZZZZ.zip", size 1kb. If I give ZipName the exact same name as the original file it works fine (ZipName="TEST.exe"). Is this a bug or am I doing something wrong ?? Can anybody tell ?? I'm using BC++6.0 Hope you can help
|
|
|
Post by Kevin on Mar 31, 2004 18:04:11 GMT -5
I'm not really sure what you are trying to do. Are you saying that TEST.EXE is the file you are trying to zip into a new archive called ZZZZZZ.zip? And you want to make it a blocked zip file, right?
How big is the TEST.EXE file and how big are you making the blocks? If you try opening up the resulting ZZZZZZ.zip, what is there?
Maybe if you show the rest of your code too it might help.
|
|
terb
New Member
Posts: 4
|
Post by terb on Apr 1, 2004 8:24:45 GMT -5
Hi Kevin yes I'm trying to zip TEST.EXE into ZZZZZZ.zip I figured out the problem packing it incorrectly. Now I can get it to pack the file, but it still can't set the ZipName !?!? Here is my actual code: SaveDialog->Execute(); s=SaveDialog->FileName; VCLZip->ZipName=s; // Using "?" dont help if (!compress) VCLZip->PackLevel=0; else VCLZip->PackLevel=(CompressRatio->ItemIndex)+1 ; // from dropbox if (encrypt){ s=Password->Text; if (s.Length()>0) VCLZip->Password=s; } VCLZip->MultiZipInfo->MultiMode=mmBlocks; // size VCLZip->MultiZipInfo->FirstBlockSize=size; // also tried size/2, no go VCLZip->MultiZipInfo->BlockSize=size; VCLZip->FilesList->Add(TargetE->Text); VCLZip->Zip(); Everytime is create files called C.zip and C.zip.z01 etc etc. I can't name it what I want !?! Hope this makes it a little more clear Also, do I have to close the zipfile. Like the CloseHandle in WINAPI ?? If so, how ?
|
|
|
Post by Kevin on Apr 1, 2004 9:30:54 GMT -5
I'm curious, if you create your zip file somewhere besides the root directory, does it work?
|
|
terb
New Member
Posts: 4
|
Post by terb on Apr 1, 2004 10:08:07 GMT -5
Hmm... This gets more and more strange !!! If I try to create the zipfile in the root dir VCLZip calls it C.zip, C.zip.z01 etc etc. If I try to create it in another dir than the root it's called Tem.zip, Tem.zip.z01. I still can't name it what I want !! Very strange... I can't see that I'm doing anything wrong !? Also I just noticed I'm using VCLZip 3.04 Pro Evaluation. So maybe this thread is more appropriate in the Pro forum !?! Maybe you can move it ?
|
|
terb
New Member
Posts: 4
|
Post by terb on Apr 1, 2004 11:20:48 GMT -5
Hi again Kevin I found the bug I did a dumb mistake If you look at my code above, I forgot one thing... this is how its should have looked: char* buffer; /// some code SaveDialog->Execute(); s=SaveDialog->FileName; buffer=s.c_str(); strcat(buffer, ".zip"); s=buffer; VCLZip->ZipName=s; Now it seems to work wonders Thanks for your effort
|
|
|
Post by Kevin on Apr 1, 2004 11:25:32 GMT -5
Ahh, good. Sorry, I am so used to looking at Delphi code that I didn't catch that. Glad to see that it is working now!
|
|