bool isZIPArchive(wstring dir, wstring &arch_name){ vector<wstring>dirs; bool isArch = false; dirs = toDirVector(dir); arch_name = dirs[0]; CZipArchive zip; for(int i=1;i<dirs.size();i++){ arch_name = arch_name + L"\\" + dirs[i]; try{ zip.Open(arch_name.c_str(), CZipArchive::OpenMode::zipOpenReadOnly); isArch = true; zip.Close(); break; }catch(Exception ^){ zip.CloseFile(); //continue } } /*if(!zip.IsClosed()) zip.Close();*/ //TODO: check if there is opened file _fcloseall(); return isArch; }