Jump to content

7z add display in GUICtrlCreateEdit


Recommended Posts

I don't have what I need to play with this right now but here is a suggestion.

Run the command using 7z.exe but direct the results to a text file using > somefile.txt

If the file is generated then you can use GUICtrlSetData($hEdit, FileRead("somefile.txt")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

As I suspected, the code is not coming from your script. Without checking 7Zip.au3 I'll take a guess that it's okay to add a line before that one that reads as follows

If NOT IsArray($aRet) Then Return SetError(1, 1)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Don't you think it is about time you provide some code? :(

I think it is only a matter of time until people will completely stop helping you, playing "guess what I do wrong in my script?" game is annoying.

It is likely that you call some function with the wrong parameters.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

#include <7Zip.au3>

;Example #1
$ArcFile = FileOpenDialog("Select archive", "", "Archive Files (*.7z;*.zip;*.gzip;*.bzip2;*.tar)")
If @error Then Exit

$Output = FileSelectFolder("Select output folder", "")
If @error Then Exit

$retResult = _7ZIPExtract(0, $ArcFile, $Output)
If @error = 0 Then
    MsgBox(64, "_7ZIPExtractEx", $retResult)
Else
    MsgBox(64, "_7ZIPExtractEx", "Error occurred")
EndIf

;Example #2
$ArcFile = FileOpenDialog("Select archive", "", "Archive Files (*.7z;*.zip;*.gzip;*.bzip2;*.tar)")
If @error Then Exit

$Output = FileSelectFolder("Select output folder", "")
If @error Then Exit

$retResult = _7ZIPExtract(0, $ArcFile, $Output, 0, 0, 1, 0, 0, 0, "*.wav")
If @error = 0 Then
    MsgBox(64, "_7ZIPExtractEx", $retResult)
Else
    MsgBox(64, "_7ZIPExtractEx", "Error occurred")
EndIf

Link to comment
Share on other sites

Bah, stupid. I'm stupid, I was running it in x64 mode, tried in x86 and bam, works. Thank's everyone.

One last error.

Posted Image

I have tried removing Local and adding in Global, but that dos not work. I cant really think of anything else, any ideas?

Func _Archive($hWnd, $Msg, $nState, $ExInfo)
    Local $iFileSize, $iWriteSize, $iPercent = 0
    
    If $nState = 0 Then
        Local $EXTRACTINGINFO = DllStructCreate($tagEXTRACTINGINFO, $ExInfo)    <-----------------------------
        
        GUICtrlSetData($BE, DllStructGetData($EXTRACTINGINFO, "szSourceFileName") & @CRLF, 1)
    
        $iFileSize = DllStructGetData($EXTRACTINGINFO, "dwFileSize")
        $iWriteSize = DllStructGetData($EXTRACTINGINFO, "dwWriteSize")
    
        $iPercent = Int($iWriteSize / $iFileSize * 100)
    
        GUICtrlSetData($Progress, $iPercent)
        Return 1
    EndIf
    
    If $nState = 2 Then GUICtrlSetData($Progress, 100)
    
    Return 1
EndFunc
Edited by thexshadow
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Without my crystal scriptalyzer to see the pertinant part of your code it's pretty much guess work since firstly there are not 84 lines of code there (Line 84) and the pertinant part of the code

If NOT IsArray($aRet) Then Return SetError(1, 1)
also isn't there so just on a hunch I'm going to say that either $aRet is not declared at all or it's declared after the fact OR you have it inside of some function and you are attempting to reference it from another function.

Try putting

Global $aRet at the top of the script and then lets see what errors you get.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...