|
|||
|
Hi,
User of my program could import/export his data and files via the program. For export part, I do fine (Just follow this) For import part, I try to do something similar. But I stuck when define new type ZIPENTRY and FILETIME. How could I define new type in FFishScript? How could I get the unzip work? Thanks |
|
|||
|
the following code where the error?
Code:
struct{
long dwLowDateTime
long dwHighDateTime
}FILETIME
struct {
long Index
long Attributes
FILETIME AccessTime
FILETIME CreateTime
FILETIME ModifyTime
long CompressedSize
long UncompressedSize
char Name
}zipEntry
var unLiteZip = getAdditionalFile("LiteUnzip.dll");
dllimport unLiteZip stdcall long UnzipOpenFileA(long*,String ,String);
dllimport unLiteZip stdcall long UnzipGetItemA(char,zipEntry*) ;
dllimport unLiteZip stdcall long UnzipItemToFileA(char,char,zipEntry*) ;
function unzip(){
var obj=new Object
obj.value=0
var ze = new Struct(zipEntry)
UnzipOpenFileA(obj,"c://test.zip",0)
trace(obj.value)
ze.Index =0
UnzipGetItemA(obj.value,ze)
trace(ze.Name)//output 0 ???????
UnzipItemToFileA(obj.value,ze.Name,ze)
trace (ze.Name)
}
|
|
|||
|
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*);
function unzip() {
var obj = new Object;
obj.value = 0;
UnzipOpenFileA(obj, "c://test.zip", null);
var handle = obj.value;
var ze = new Struct(zipEntry);
ze.Index = 0;
obj.value = ze;
UnzipGetItemA(handle, obj);
trace(obj.value.Name);//output 0 ???????
UnzipItemToFileA(handle, "c:\\1.pdf", obj);
}
unzip();
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|