Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unzip to Mem using Dynazip ActiveX Control
Message
From
03/06/2008 15:04:41
 
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Miscellaneous
Thread ID:
01321133
Message ID:
01321388
Views:
12
I'm having trouble unzipping files from a zip file into memory. I first get a count of the available files I wish to extract from the zip then I loop through the number of reports, unzipping them to memory and then checking the content of the file. The first file in the loop works fine but when I attempt to do the same procedure on the next report I get the following error message "OLE exception error: Exception code c00000005. OLE object may be corrupt". I put some sample code below to show you what I'm trying to do. Any help is greatly appreciated.
Sample Code:

m.zip_list = ";"

ThisForm.Ole_unzip.zipfile = bck_path + m.bck_file
ThisForm.Ole_unzip.filespec = file2get

ThisForm.Ole_unzip.noDirectoryItemsFlag = .T.
ThisForm.Ole_unzip.nodirectoryNamesFlag = .T.
ThisForm.Ole_unzip.recurseFlag = .T.
ThisForm.Ole_unzip.actiondz = 3 && UNZIP_COUNTNAMEDZIPMEMBERS

zip_cnt = ThisForm.Ole_unzip.ReturnCount
FOR zz=1 TO zip_cnt
ThisForm.Ole_unzip.actiondz = 4 && UNZIP_GETNEXTNAMEDZIPINFO

m.zip_file = (ThisForm.Ole_unzip.zi_FileName

m.zip_list = m.zip_list + m.zip_file + ";"
ENDFOR
&& ===== GET FILE COUNT FROM ZIP ===== &&


&& ===== SEARCH FILES FOR SEARCH CRITERIA ===== &&
unzip_cnt = OCCURS(";", m.zip_list)-1
FOR zz=1 TO unzip_cnt
m.zip_file = STREXTRACT(m.zip_list, ";", ";", zz)

ThisForm.Ole_unzip.Refresh
ThisForm.Ole_unzip.zipfile = bck_path + m.bck_file
ThisForm.Ole_unzip.filespec = m.zip_file
ThisForm.Ole_unzip.UnZIPString = ""

ThisForm.Ole_unzip.UnZIPStringSize = 100000000
ThisForm.Ole_unzip.UnZIPStringOffset = 0

_VFP.AUTOYIELD = .F.
ThisForm.Ole_unzip.QuietFlag = .T.
ThisForm.Ole_unzip.AllQuiet = .T.
ThisForm.Ole_unzip.OverwriteFlag = .T.
ThisForm.Ole_unzip.noDirectoryItemsFlag = .T.
ThisForm.Ole_unzip.nodirectoryNamesFlag = .T.
ThisForm.Ole_unzip.recurseFlag = .T.
ThisForm.Ole_unzip.actiondz = 9 && UNZIP_FILETOMEM
_VFP.AUTOYIELD = .T.

m.chk_file = ThisForm.Ole_unzip.UnZIPString

IF ATCC(m.srch_item, m.chk_file) > 0
COPY FILE(m.work_dir + m.zip_file) TO ALLTRIM(m.rvw_dir + m.review_name)

INSERT INTO C_RESULTS FROM MEMVAR
ENDIF
ENDFOR
&& ===== SEARCH FILES FOR SEARCH CRITERIA ===== && 
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform