Jump to content
Sign in to follow this  
thexshadow

7z add display in GUICtrlCreateEdit

Recommended Posts

thexshadow

Title kind of says it all, I have tried to use this UDF http://www.autoitscript.com/forum/index.php?showtopic=91283, but I always error. Is there an easier way to stream the 7z add or 7z extract to a GUICtrlCreateEdit box?

Share this post


Link to post
Share on other sites
thexshadow

Sorry for the bump, 24 hr.

I have also tried this.

http://www.autoitscript.com/forum/index.php?showtopic=85094&hl=7zip&st=0

I always get an error.

Posted Image

or with a different dll.

Posted Image

Any ideas?

Edited by thexshadow

Share this post


Link to post
Share on other sites
thexshadow

No one?

Share this post


Link to post
Share on other sites
logo78

ur are probably using the wrong 7z.dll

Take this one.

Share this post


Link to post
Share on other sites
thexshadow

That's the exact one I used. :(

Share this post


Link to post
Share on other sites
GEOSoft

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!"

Share this post


Link to post
Share on other sites
thexshadow

I get this when trying to use the exe. :(

Posted Image

Share this post


Link to post
Share on other sites
GEOSoft

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!"

Share this post


Link to post
Share on other sites
thexshadow

Ok, that removed the error popups, but now this is what I get.

Posted Image

Share this post


Link to post
Share on other sites
enaiman

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 :)

Share this post


Link to post
Share on other sites
thexshadow

I have tried using all of the provided example scripts in the archive (In Rasims download) to test, but all of them fail. I have yet to make anything as it is not working!

Edited by thexshadow

Share this post


Link to post
Share on other sites
thexshadow

#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

Share this post


Link to post
Share on other sites
enaiman

Your first example works very well; I've tested on a *.zip file and everything was OK.

Be sure that 7-zip.dll is in your script folder.


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 :)

Share this post


Link to post
Share on other sites
thexshadow

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

Share this post


Link to post
Share on other sites
thexshadow

No one? :(

Share this post


Link to post
Share on other sites
thexshadow

Bump. :(

Share this post


Link to post
Share on other sites
thexshadow
Posted Image

Share this post


Link to post
Share on other sites
thexshadow

Ahhh, no one? :idea:

Share this post


Link to post
Share on other sites
GEOSoft

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!"

Share this post


Link to post
Share on other sites
thexshadow
:idea: I added Global $aRet to the top in the first place, but forgot to run it in x86 mode again... Thank you again Geo, you are god. :)

Share this post


Link to post
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
Sign in to follow this  

×