sly33
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору GOOSE Забудем про Application.GetLastError. Ситуация такая - в одном ЛистБоксе и экзешники и архивы (просто для некоторых программ нужен не один Rus.exe , а несколько файлов, сответственно они лежат в одной папке и сжаты в Zip .) Потому я на Double_Click делаю и File.Run и Zip.Extract. Ну а при том что я наваял при клике на одной строке открываются и все другие окна. Сейчас у меня код выглядит так tSelected = ListBox.GetSelected("ListBox2"); if tSelected then for nTableIndex, nListBoxIndex in tSelected do sFilePath = ListBox.GetItemData("ListBox2", nListBoxIndex); result = File.Run(sFilePath, "", "", SW_SHOWNORMAL, false); end tFilePath = String.SplitPath(sEXEFileName); _sEXEFileName = tFilePath.Drive..tFilePath.Folder..tFilePath.Filename..".zip"; target_folder = Dialog.FolderBrowse("Select a Folder", "C:\\"); -- Check to see if the user cancelled or an error occurred. if (target_folder ~= "CANCEL") and (target_folder ~= "") then -- Gets a list of the contents of a zip file. zip_contents = Zip.GetContents("AutoPlay\\Docs\\system\\Rus\\TU2007TrialEN.zip", true); -- Get the error code of the last action. error = Application.GetLastError(); -- If an error occurred, display the error code message. if (error ~= 0) then Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION); else -- Take the table and turn it into a string with newlines for displaying. zip_contents_display = Table.Concat(zip_contents, "\r\n", 1, TABLE_ALL); -- Ask the user if they are sure they would like to unzip the contents. result = Dialog.Message("Information", "The following files will be unzipped:\r\nClick the Cancel button to abort the process.\r\n\r\n"..zip_contents_display, MB_OKCANCEL) -- If the user clicked Ok, unzip the files. if (result == IDOK) then -- Show the status dialog. StatusDlg.Show(); -- Extract the contents of the Zip file. Zip.Extract("_sEXEFileName", {"*.*"}, target_folder, true, true, "", ZIP_OVERWRITE_NEVER, nil); -- Check the error code for the last action. error = Application.GetLastError(); -- Hide the status dialog. StatusDlg.Hide(); -- If an error occurred, display the error code message. if (error ~= 0) then Dialog.Message("Errror", tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION); else Dialog.Message("Success", "The unzipping was successful.", MB_OK, MB_ICONINFORMATION); end end end end Всё здорово, но это только один Zip архив ,а их несколько. Так что я пока толкусь на одном месте. Если несложно подскажите как решить эту проблемку. | Всего записей: 23 | Зарегистр. 25-04-2007 | Отправлено: 00:04 13-05-2007 | Исправлено: sly33, 00:12 13-05-2007 |
|