Help needed with LiteUnZip !
-
Hi to all, I am using VC++ 2005 and trying to employ LiteUnzip a series of ZIPPED files but once I retrieve the file names within the ZIP I would like to decompress them using an alternate path, so I am trying to override ze.Name and give it a path which has been defined within a String. Take a look at the code below to get an idea where I'm coming from:
private: void UnZIP(String^ file,String^ source, String^ target) { HUNZIP hz; ZIPENTRY ze; String^ inFile; String^ outFile; String^ fileName; DWORD numitems; inFile = source + file; pin_ptr INFILE = PtrToStringChars(inFile); UnzipOpenFile(&hz,INFILE,0); ze.Index = (DWORD)-1; UnzipGetItem(hz,&ze); numitems = ze.Index; for(ze.Index = 0;ze.Index < numitems + 1;ze.Index++) { UnzipGetItem(hz,&ze); // Convert to a System::String String^ systemstring = gcnew String(ze.Name); fileName = Path::GetFileName(systemstring); delete systemstring; outFile = target + "\\" + fileName; **ze.Name = outFile;**
<---- Need to find a way to convert a String to an acceptable type.UnzipItemToFile(hz,ze.Name,&ze); } UnzipClose(hz); }
Cheers Fritzables.