Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zip plug-in for Visual Basic 4

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone know of a 3rd party plug-in that allows you to create Zip files, prefferably self-extracting Zip files, from VB? There was one in the book that came with the VB package I received a few years ago but the doesn't appear to exist any longer.
 
Ken,<br><br>I just did something close to this.&nbsp;&nbsp;I found a class that works with ZIP files.&nbsp;&nbsp;However I don't think it will make a self extracting exe.&nbsp;&nbsp;If you want the information send me an email letting me know what you're interested in. <p>Steve<br><a href=mailto:tribesaddict@swbell.net>tribesaddict@swbell.net</a><br><a href= > </a><br>
 
Source code & Dll's for Zip/UnZip available from <A HREF=" TARGET="_new"> use InfoZip Dll's which are free. Add, list, extract, fix, overwrite warning, password query, and other options. Sample programs and full source code. You don't need source for Dll's but you can get that&nbsp;&nbsp;from InfoZip.
 
Excellent link, dgs! I've been looking for &quot;better&quot; way to solve KenTNT's problem for some time now and it looks like you just pointed me in the right direction.<br><br>Regarding Steve's note on self extracting zips...<br>I frequently use a old trick to store large amounts of data in the EXE. You determine the size of the EXE file and hard-code that value in the source, recompile and make sure the size hasn't changed and then use the EXE as a header for whatever data will follow. In this case you might try appending a zip file to the end of the &quot;header&quot; exe. When you run the program it could uncompress itself, starting with the byte following the original size of the EXE.<br><br>It's just a thought. I haven't tried it with a compressed file yet but it works quite well with ordinary data. I hope you see where I am going with this.<br> <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>
 
If there any sample code or better explantions of the methods for InfoLib Unzip? I can't follow the sample project very well, in following the simple example on the website:

' Set the zip file:
m_cUnzip.ZipFile = sFIle
' Set the base folder to unzip to:
'sFolder = &quot;D:\DATA&quot;
m_cUnzip.UnzipFolder = sFolder
' Unzip the file!
m_cUnzip.Unzip

I've tried to set sFIle as a string with the filename, but I get an error &quot;Oject Variable or With Block Variable Not Set&quot;
 
Did you instantiate the object before using it?

You need a line like this:

Set m_cUnzip = New <class name>

Where Class name is the name of the class that you want to create a new object of. You have to set a reference to the object first using the reference option on the menu in Visual BASIC. If you don't know the name of the objec that you need to create, then press F2 in Visual BASIC and bring up the Object Explorer. Select the InfoLib library and the browse the objects in the library. Look for the object has the properties that you're using in the above code.

Place the line I gave you in your code before you make any calls to methods or access any properties of the object.

Be sure to set the object = Nothing after you're done with it.

Set m_cUnzip = Nothing

Hope that helps, Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
Thanks Snaggs your suggestion worked great.

Private WithEvents m_cUnzip As cUnzip

Set m_cUnzip = New cUnzip
Dim sFIle as String

' Set the zip file:
sFIle = &quot;D:\Data\021024.zip&quot;
m_cUnzip.ZipFile = sFIle
' Set the base folder to unzip to:
'sFolder = &quot;D:\DATA&quot;
m_cUnzip.UnzipFolder = sFolder
' Unzip the file!
m_cUnzip.Unzip

This site continues to rock!
 
I have a question regarding using zip within VB...

I want to store about 500 files within a zip file that is password protected. Can I extract one file when needed?

Obviously, I should just download said dll's and try it, which I will, but I'm hoping someone can tell me this before I waste my time and effort.

Thanks,
Tuna
 
hmmmmmmmmmmmmm ... that implies that you value your 'time and effort' a LOT more than ours?

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Oh man... now don't go thinking that... it was a compliment that I assumed someone already KNEW the answer... not that their time was worth less than mine. Now I'm pretty sure you were just messing with me, but just in case, I never meant that anyone's time was less important than mine... I would never, ever SAY that... even if it is true :)

Tuna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top