General information
Category:
ActiveX controls in VFP
Title:
Unzip to Mem using Dynazip ActiveX Control
Environment versions
Network:
Windows 2000 Server
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_uznip.noDirectoryItemsFlag = .T.
ThisForm.Ole_uznip.nodirectoryNamesFlag = .T.
ThisForm.Ole_uznip.recurseFlag = .T.
ThisForm.Ole_uznip.actiondz = 3 && UNZIP_COUNTNAMEDZIPMEMBERS
zip_cnt = ThisForm.Ole_uznip.ReturnCount
FOR zz=1 TO zip_cnt
ThisForm.Ole_uznip.actiondz = 4 && UNZIP_GETNEXTNAMEDZIPINFO
m.zip_file = (ThisForm.Ole_uznip.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_uznip.Refresh
ThisForm.Ole_uznip.zipfile = bck_path + m.bck_file
ThisForm.Ole_uznip.filespec = m.zip_file
ThisForm.Ole_uznip.UnZIPString = ""
ThisForm.Ole_uznip.UnZIPStringSize = 100000000
ThisForm.Ole_uznip.UnZIPStringOffset = 0
_VFP.AUTOYIELD = .F.
ThisForm.Ole_uznip.QuietFlag = .T.
ThisForm.Ole_uznip.AllQuiet = .T.
ThisForm.Ole_uznip.OverwriteFlag = .T.
ThisForm.Ole_uznip.noDirectoryItemsFlag = .T.
ThisForm.Ole_uznip.nodirectoryNamesFlag = .T.
ThisForm.Ole_uznip.recurseFlag = .T.
ThisForm.Ole_uznip.actiondz = 9 && UNZIP_FILETOMEM
_VFP.AUTOYIELD = .T.
m.chk_file = ThisForm.Ole_uznip.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 ===== &&
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only