Sign in to follow this  
Followers 0
dexto

GUI noob question

7 posts in this topic

Working on my first full GUI app.

For some reason in this loop:

While True
        $nMsg = GUIGetMsg()
        $data = UDPRecv($socket, 500)
        $dataa = UDPRecv($socketa, 500)
        $datab = UDPRecv($socketb, 500)
        
        If $data <> "" Then
            cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 788> ' & $data)
        EndIf
        If $dataa <> "" Then
            cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 9> ' & $data)
        EndIf
        If $datab <> "" Then
            cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 7> ' & $data)
        EndIf
        
    ;GUI LOOP
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
                
        EndSwitch

        Sleep(100)
    WEnd

When I try to close the gui window it takes 5-10 seconds for it to close...?

Is that normal? What did I do wrong?

Share this post


Link to post
Share on other sites



probably it's CW function :P


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

CW = ConsoleWrite???

I cant see nothing more besides that!

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

probably it's CW function :(

:P here:

Func cw($txt)
    ConsoleWrite($txt & @CRLF)
EndFunc  ;==>cw

I tried commenting CW() => no diff.

Share this post


Link to post
Share on other sites

Hi again,

Probably no info incoming to Sockets.

Check incoming data!

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

Hi again,

Probably no info incoming to Sockets.

Check incoming data!

Cheers

True, it is just waiting for incoming info. (as in server)

Can it be rewritten so it will fire an event on incoming data?

I think this will be "dirty" way to fix it: :P

;MAIN LOOP
    Local $u = 0
    While True
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
        
        $u = $u + 1
        If $u = 100 Then
            $u = 0
            $data = UDPRecv($socket, 200)
            $dataa = UDPRecv($socketa, 500)
            $datab = UDPRecv($socketb, 500)
            
            If $data <> "" Then
                cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 788> ' & $data)
            EndIf
            If $dataa <> "" Then
                cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 9> ' & $data)
            EndIf
            If $datab <> "" Then
                cw(@HOUR & ':' & @MIN & ':' & @SEC & ' 7> ' & $data)
            EndIf
        EndIf
    
    WEnd

Share this post


Link to post
Share on other sites

hi again,

you can try to simulate some data, give data to $data, $dataa and $datab. If this part of code is running, then try to see if you are recieving ou sending data.

Troubleshoot sometimes sucks, but it's a great way to learn and improve ourselves.

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

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  
Followers 0