Jump to content

DLLStruct* + GUI Issues


Recommended Posts

  • Moderators

I'm curious if this is failing/freezing for anyone else.

After speaking with Gary last night, he had suggested that using DLLStruct* with GUIs caused him some issues as well. So I rolled back from 3.2.4.9 to 3.2.2.0, and the issue is still there for me... I just need to know if the GUI is freezing.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'm curious if this is failing/freezing for anyone else.

After speaking with Gary last night, he had suggested that using DLLStruct* with GUIs caused him some issues as well. So I rolled back from 3.2.4.9 to 3.2.2.0, and the issue is still there for me... I just need to know if the GUI is freezing.

Presents one GUI with a list view and exits when I close that: screenshot attached.

P.S. XP Pro SP2, with 3.2.4.9

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I'm curious if this is failing/freezing for anyone else.

After speaking with Gary last night, he had suggested that using DLLStruct* with GUIs caused him some issues as well. So I rolled back from 3.2.4.9 to 3.2.2.0, and the issue is still there for me... I just need to know if the GUI is freezing.

I'm guessing that you're talking about the problem when you double click on the ListView and it freezes? If so, the problem isn't with the DllStruct* functions. You're hooking the WM_NOTIFY event and then displaying a dialog box in the middle of the event. Per the AutoIt help file on GUIRegisterEvent:

Warning: blocking of running user functions which executes window messages with commands such as "Msgbox()" can lead to unexpected behavior, the return to the system should be as fast as possible

It's not an AutoIt problem as you'd have the same problem in any language AFAIK. Typically, what you want to do is set a global flag in your event handler that indicates the event has happened and then monitor that flag in your main GUIGetMsg() loop. You can then safely launch your other code from there without causing any problems.

Edit: Something like this. :rolleyes:

#include <GUIConstants.au3>
#include <GUIListView.au3>
Global &ÌÍÙÚPÒQ    ÌÍÙÜÕ^ ÌÍÙÙYÏQ[ÙBÌÍÚXZ[HÕRPÜX]J ÌÎNÑ7Æb33²Â#CÂ3¢b33c¶ÅbÒuT7G&Ä7&VFTÆ7EfWrb33³Ã'Ã7ÃGÃWÃWÃbÌäì°À°À°ÄÈÐÀ°ÈÔÀ° ¥Ñ=H ÀÌØí1YM}M%91M0°ÀÌØí1YM}M!=]M11]eL°#036;LVS_NOSORTHEADER))
GUICtrlSendMsg($hLV, $LVM_SETEXTENDEDLISTQUÔÕSK   ÌÍÓ×ÑVÑÔQSTË    ÌÍÓ×ÑVÑÔQSTÊBÕRPÝÙ[ÙÊ  3c¶ÅbÂb33c´ÅdÕõ4UDUDTäDTDÄ5EdUu5EÄRÂb33c´Åe5ôUôeTÄÅ$õu4TÄT5BÂb3ÌØí1YM}a}U11I=]M1
P¤)}U%
Ñɱ1¥ÍÑY¥ÝMÑ
½±Õµ¹]¥Ñ  ÀÌØí¡1X°À°äÀ¤)}UICtrlListViewSetColumnWidth($hLV, 1, 90)
_GUICtrlListViewSetColumnWid
    ÌÍÚML
BÑÕRPÝÝY]ÔÙ]ÛÛ[[ÚY
    ÌÍÚËÌ
BÑÕR7G&ÄÆ7EfWu6WD6öÇVÖåvGFb33c¶ÅbÂBÂ#¥ôuT7G&ÄÆ7EfWu6WD6öÇVÖåvGF ÀÌØí¡1X°Ô°ÄÀؤ)}U%
Ñɱ1¥ÍÑY¥ÝMÑ
½±Õµ¹]¥Ñ  ÀÌØí¡1X°Ø°ÌÀÀ¤(ÀÌØhLVItem = GUICtrlCreateListViewItem('A|B|C|D|E|F|G', $hLV)
GUIYÚÝÙÊ
K   ÌÎN×ÕÓWÓÝYWÑ][ÉÌÎNÊBÕRTÙ]Ý]J
BÚ[HBÝF6uTvWD×6r¢66RÓ0¢W@¢VæE7vF6¢bb33c¶±Ñ¡¸(}U%1Y
½µµ¹Ð ÀÌØí¥
%°ÀÌØíÍQáФ(ÀÌØí±= False
  endif
WEnd

Func _GUILVAddComment($iCID, $sText)
    LoØ[   ÌÍÚÚ[HÕRPÜX]J ÌÎNÐYHÛÛ[Y[    ÌÎNË
MLLKLK  3cµu5ôUõDõÔõ5B¢uT7G&Ä7&VFTÆ&VÂb33´6öÖÖVçG2b33²ÂÂÂ3ÂÀ°ÁàÀÀÀĤ(1½°ÀÌØí¡1Y%¹ÁÕÐôU%
Ñɱ
ÉѥРÌäìÌäì°ÄÀ°ÌÔ°380, 40, BitOR(0x0004, 0x0040,0x00200000))
    Local $hButton = GUICtrÜX]P]Û ÌÎNÐYÛÛ[Y[ ÌÎNËL
KÎJBÕRTÙ]Ý]JÕ×ÔÒõrÂb33c¶Åd6ÆB¢vÆR¢b33c¶×6rÒuTvWD×6r¢7¥Ñ ÀÌØí¡5ÍlÅt(
ÍÀÌØí¡1Y
¡¥±(MÝ¥Ñ 036;hMsg[0]
                    Case -3
                        ExitLoop
  ØÙH ÌÍÚ]ÛÕRPÝÙ]]Jb33c¶4BÂb33c·5FWBfײuT7G&Å&VBb33c¶ÅdçWB¢á¥Ñ1½½À(¹MÝ¥Ñ (¹MÝ¥Ñ (]¹(UDelete($hLVChild)
    Return
EndFunc

Func _WM_Notify_Events($hWnÕRK ÌÍÓÙÒQ ÌÍÝÔ[K  ÌÍÛ[JBØØ[  ÌÍÝ][6Âb33c·FtäÔE"ÒFÆÅ7G'V7D7&VFRgV÷C¶çC¶çC¶çBgV÷C²Âb33c¶Å&Ò%ÉɽÈQ¡¸IÑÕɸÀÌØíU%}IU95M(ÀÌØíÙÙ¹Ðô±±MÑÉÕÑtData($tagNMHDR, 3)
    If $wParam = $hLV Then
        If &#ÍÝ][HLÈ[    ÌÍÙÚPÒQHÕRPÝXY
    ÌÍÚBb33c¶w5FWBÒuT7G&Å&VBb33c¶v4B¢b33c¶vdfÆrÒG'(¹%(¹%(IÑÕɸÀÌØíU%}IU95M)¹Õ¹
Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • Moderators

I'm guessing that you're talking about the problem when you double click on the ListView and it freezes? If so, the problem isn't with the DllStruct* functions. You're hooking the WM_NOTIFY event and then displaying a dialog box in the middle of the event. Per the AutoIt help file on GUIRegisterEvent:

It's not an AutoIt problem as you'd have the same problem in any language AFAIK. Typically, what you want to do is set a global flag in your event handler that indicates the event has happened and then monitor that flag in your main GUIGetMsg() loop. You can then safely launch your other code from there without causing any problems.

That's what I did do as a matter of fact :rolleyes: ... I was unaware of the GUIRegisterEvent issue thanks.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...