Hi, the expected behavior is program should unzip the folder
Member 4201820
Posts
-
need help to check my code why unzip operation not working -
need help to check my code why unzip operation not workingHi All, i download opensourcecode to unzip a folder from below path ------http://www.winimage.com/zLibDll/minizip.html------- ->How to get the Minizip package and then 1.1 with zip64 support i want to unzip a folder to another location. Lets say if the zip file is at C:\\temp\\aaa.zip i want to unzip aaa.zip at C:\\temp\\abcd\\aaa once i download the files from the above link i get Unzip.h file and use unzOpen() function. but unfortunately, its not working as per my expectation. is there any body who can help me ? below is my code : *************************************************************** HRESULT UnZipFile(CAtlString srcPath, CAtlString tgtPath,CAtlString& errorMessage) { HRESULT hr=NOERROR; CAtlString message; INT result=0; unzFile pZipFile=unzOpen((CAtlStringA)tgtPath); if(pZipFile==NULL) { hr=E_FAIL; message.Format(_T("Failed to open a zip file.\r\n%s"), tgtPath); errorMessage=message; } return hr; } ***************************************************************** Kind regards, Praveer
-
CreateProcess() not workingHi All, my objective is to create a .MD5 file using Rehash.exe which will be called by CreatedProcess(). if i run from command line its working fine C:\temp>rehash.exe -none -md5 "C:\temp\aaa.TFI" > "C:\temp\aaa.MD5" but if i implement in code and use CreateProcess, its not working below is the code snippet int main() { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); LPSTR lp_rehashEXE = "C:\\temp\\rehash.exe"; LPSTR lp_Parameter = " -none -md5 C:\\temp\\Praveer.TFI > C:\\temp\\Praveer.MD5"; if(!::CreateProcess(lp_rehashEXE, lp_Parameter, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) { printf( "CreateProcess failed (%d)\n", GetLastError() ); return false; } // Wait until child process exits. ::WaitForSingleObject(pi.hProcess, INFINITE ); // Close process handles. CloseHandle( pi.hProcess ); return 0; } Please help!!!