473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

reference to shell32.dll

jamesd0142
469 256MB
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.  
  3.     Private Sub CreateZipFile(ByVal Filename As String) 'create a new empty zip file
  4.         Dim Encoder As New System.Text.ASCIIEncoding
  5.         Dim Header As String = "PK" & Chr(5) & Chr(6)
  6.         Header = Header.PadRight(22, Chr(0))
  7.         My.Computer.FileSystem.WriteAllBytes(Filename, Encoder.GetBytes(Header), False)
  8.     End Sub
  9.  
  10.     Private Sub ZipFile(ByVal Input As String, ByVal Filename As String)
  11.         Dim Shell As New Shell32.Shell
  12.         CreateZipFile(Filename)
  13.         Shell.NameSpace(Filename).CopyHere(Input)
  14.     End Sub
  15.  
  16. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  17.         'take everything from the C:\Testfrom directory and compress it into the c:\testzip.zip file
  18.         ZipFile("c:\testfrom", "c:\testzip.zip")
  19.  
  20.     End Sub
  21. End Class
  22.  
The code above allows me to zip a folder. Although i get error with the line "Dim Shell As New Shell32.Shell" {LINE 11}

It says (by the person who wrote the code:
Requires reference to shell32.dll in %windir%\system32

So could anyone help by telling me what i need to do?

Source: http://www.xtremevbtalk.com/showthread.php?t=284538

Thanks
Jan 7 '08 #1
1 6551
jamesd0142
469 256MB
OK i sorted this now, thanks anyway...
Jan 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ron | last post by:
Last week I saw in a code snippet where you can use the shell32.dll to use code that will shut down Windows from an Access application. I tried this and this worked nicely. My question: How...
2
by: emde | last post by:
Any tips on using the icons in shell32.dll as the image on a button in a form? Thanks.
2
by: Craig | last post by:
I've seen many examples of how to call SHGetFileInfo in shell32.dll to get a files associated icon, but I can't find anywhere how to get the file information (size, last date modified, etc, etc)...
3
by: Just Me | last post by:
I've referenced the shell32.dll but can't seen to use it. Could someone give an example of using any function in it? Something like: Dim ShellQAs New Shell32.ShellClass Dim shellFolder...
0
by: Steve Mauldin | last post by:
I am trying to get from files the keywords saved as part of the properties under the summary tab. I am able to get the Title, and Comments using the following code but I need to get the keywords...
0
by: Steve Mauldin | last post by:
I am trying to get from files the keywords saved as part of the properties under the summary tab. I am able to get the Title, and Comments using the following code but I need to get the keywords...
4
by: Neo | last post by:
I am developing a GUI for a destop application in Visual C++ .Net 2005, I am trying to create toolbar exactlly same as windows explorer which will have default windows icons, which are in windows...
1
by: Zairay | last post by:
Hi All, I'm having a problem with the Shell32.dll when I try to open a program from my Access db. When I try to open a program called FalconViewLite from my access database I get an error in...
9
by: str1ker | last post by:
Hey guys, Sorry if this question is stupid, but I've searched everywhere, but I can't seem to find a solution. Basically, I've got this code that makes use of the the Interop.Shell32.dll. This...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.