Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2008, 01:04 PM
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default How to extract a specified file in a .zip file

the following code where the errors
Code:
struct{ 
 long dwLowDateTime 
 long dwHighDateTime 
}FILETIME
struct {
 long Index 
 long Attributes 
 FILETIME AccessTime 
 FILETIME CreateTime
 FILETIME ModifyTime 
 long CompressedSize 
 long UncompressedSize
 char Name[260]
}zipEntry
//==========================
var unLiteZip = getAdditionalFile("LiteUnzip.dll");
dllimport unLiteZip stdcall long UnzipOpenFileA(long*,String ,String); 
dllimport unLiteZip stdcall long UnzipGetItemA(long,zipEntry*) ;
dllimport unLiteZip stdcall long UnzipItemToFileA(long,String,zipEntry*)
dllimport unLiteZip stdcall long UnzipFindItemA(long,zipEntry*,long)
dllimport unLiteZip stdcall long UnzipClose(long)
dllimport "kernel32" stdcall long lstrcpy(char*,char*) 
//===============================
function unzipFind(){
var obj=new Object
obj.value=0
//----------open zip
UnzipOpenFileA(obj,"c://test.zip",0) 
var hanl=obj.value
trace(hanl)
//----------structure
var myStruct = new Struct(zipEntry);
obj.value=myStruct
//--------lstrcpy
trace(lstrcpy(obj.value.Name,"test.txt"));//undefined

//--------UnzipFindItemA
trace(UnzipFindItemA(hanl,obj,0)); // Can't find the specified file in the zip
//---------UnzipItemToFile
trace( UnzipItemToFileA(hanl,obj.value,obj))// Bad arguments passed
//--------
UnzipClose(hanl);
 }
dear SWFKit! i'm very sorry for bothering you again! please tell me what am i doing wrong.
Reply With Quote
  #2 (permalink)  
Old 07-24-2008, 04:47 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: How to extract a specified file in a .zip file

I'm not sure. Maybe "lstrcpy" should be "lstrcpyA"? Or you can write you own lstrcpy function
Code:
function myStrCpy(obj, str)
{
  for (var i = 0; i < str.length; i++)
  {
    obj.value.Name[i] = str[i];
  }
  obj.value.Name[i] = 0;
}
Reply With Quote
Reply

Was this information helpful?    Yes No



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. The time now is 05:18 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.