Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > VB.NET General Discussion

VB.NET General Discussion VB.NET general discussion area

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2009, 4:01 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2009
Age: 26
Posts: 4
Reputation: 0
craneium is on a distinguished programming path ahead
Default shell class problem

I am unzipping a file on a XP machine.
to do this i am using the Shell process

For Each setfiles As String In My.Computer.FileSystem.GetFiles(mydesktop, FileIO.SearchOption.SearchTopLevelOnly, "*.zip")
If setfiles.Count = 0 Then
setfiles = Nothing
Exit For
Else
Dim myshell As New Shell32.Shell
Dim myzip As Shell32.Folder = myshell.NameSpace(setfiles)
Dim mydrop As Shell32.Folder = myshell.NameSpace(mydesktop)
For Each myzipfiles As Shell32.FolderItems In myzip.Items
mydrop.CopyHere(myzipfiles)
Next
End If
Next


This was built on VS 2008 on a vista machine on this machine this process works perfectly when ported over to an XP (with new frameworks v3.5) i get this error

System.InvalidCastException: Unable to cast COM object of type 'Shell32.ShellClass' to interface type 'Shell32.IShellDispatch5'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at Shell32.ShellClass.NameSpace(Object vDir)


What would the reason behind this be, i have to be able to run this on a xp machine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-09-2009, 5:37 PM
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Location: USA
Posts: 816
Reputation: 459
MattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond repute
Default

Shell32 Problems - creating Zip Files

From the last post in the thread:

Quote:
I had the same problem. I got things working by using an interop (Interop.Shell32.dll) that was created on a XP machine. Build your project on XP and just grab the file “Interop.Shell32.dll” to include with your setup on Vista. I created my MSI on Vista with the XP version of “Interop.Shell32.dll” and now things work on both XP and Vista.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-09-2009, 5:52 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2009
Age: 26
Posts: 4
Reputation: 0
craneium is on a distinguished programming path ahead
Default

I looked through my files and i'm using a Interop.shell32.dll.deploy, its in the folder with the app would this be what you are speaking of or should i be calling out to that DLL in my code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-09-2009, 6:21 PM
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Location: USA
Posts: 816
Reputation: 459
MattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond repute
Default

From the thread I linked it looks like you need to grab the Interop.Shell32.dll from an XP machine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 11:27 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.