erebus Posted May 4, 2007 Share Posted May 4, 2007 (edited) Hello,I am using the 7-zip.dll to extract cabinets. Using the beta v3.2.3.2 I am now suddendly getting the error message "AutoIT has detected the stack has become corrupt". Here is the code:$dll = DllOpen($lib) $check = DllCall($dll, "int", "SevenZip", "hwnd", 0, "str", 'x ' & $ExtraParams & ' -o' & $Target & ' ' & $CabFile & ' ' & $filter, "int", 0) DllClose($dll) If @error Then ; unexpected error If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError("Transfer error.") ElseIf $check[0] = "32800" Then ; user has pressed the Cancel button If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError("Transfer interrupted.") EndIfWhat should I change so as to continue using this code with the beta version?Also why AU3 produces that critical error since I use Opt("RunErrorsFatal", 0) in my script?P.S. You can find the DLL here and the related post is here. Edited May 4, 2007 by erebus Link to comment Share on other sites More sharing options...
NELyon Posted May 5, 2007 Share Posted May 5, 2007 $dll = DllOpen($lib) $check = DllCall($dll, "int:cdecl", "SevenZip", "hwnd", 0, "str", 'x ' & $ExtraParams & ' -o' & $Target & ' ' & $CabFile & ' ' & $filter, "int", 0) DllClose($dll) If @error Then ; unexpected error If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError("Transfer error.") ElseIf $check[0] = "32800" Then ; user has pressed the Cancel button If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError("Transfer interrupted.") EndIf Did that work? Link to comment Share on other sites More sharing options...
erebus Posted May 5, 2007 Author Share Posted May 5, 2007 No it doesn't... It produces the same error. Anyone please? Link to comment Share on other sites More sharing options...
piccaso Posted May 5, 2007 Share Posted May 5, 2007 wrong number of parameters, try this:$dll = DllOpen($lib) ; int WINAPI SevenZip(const HWND _hwnd, LPCSTR _szCmdLine, LPSTR _szOutput, const DWORD _dwSize); $check = DllCall($dll, "int", "SevenZip", _ "hwnd", 0, _ "str", 'x ' & $ExtraParams & ' -o' & $Target & ' ' & $CabFile & ' ' & $filter, _ "str", "", _ "int", 65535) DllClose($dll) If @error Then ; unexpected error If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError ("Transfer error.") ElseIf $check[0] = "32800" Then ; user has pressed the Cancel button If $Debug = "1" Or $Debug = "2" Then ProgressOn($title, "Cleaning up...", "Removing partial folders. Please hold...") DirRemove($Target & "\" & $Dir, 1) If $Debug = "1" Or $Debug = "2" Then ProgressSet(100) If $Debug = "1" Or $Debug = "2" Then Sleep(500) If $Debug = "1" Or $Debug = "2" Then ProgressOff() CError ("Transfer interrupted.") EndIfJust if you don't have them already, there is a English translation of the docs:http://www.csdinc.co.jp/archiver/lib/7-zip32api-en.txt CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
erebus Posted May 5, 2007 Author Share Posted May 5, 2007 You are a life saver! Thank you very much, it seems to work well! The truth is I knew the site with the EN docs, however my knowledge of the Dll* functions in AutoIT and DLLs in general is very limited, so I cannot debug such problems myself easily. Thank you very much again for your response, I really appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now