Jump to content

Heron

Active Members
  • Posts

    43
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Heron's Achievements

Seeker

Seeker (1/7)

4

Reputation

  1. Hi all, it's long time ago that I posted this tool. Feedback was mainly the lack of a help file. Since I still use the tool for my daily work and decided to distribute it to my department I bastled a helpfile together. So why not post it here? During reviewing I noticed several issues candidate for improvement, but who cares? Also post the source code for whoever can use it. *&^#*@ Cannot upload the file, it is more than my upload quota?! Ok, will see how to post it (but not today). Bye
  2. Hi AutoIt nerds, who can help me out with this issue? It is driving me nuts. I found a great activeX control, MSTgrid, that is much easier for me than listview with all the options I need. However there's a strange thing going on. I have bound to the control to receive its events and it does so as expected BUT... the precise moment I enter a key when in the edit mode of a cell all of the events stop firing from then on. And it doesn't start again either when out of the edit mode. The same control bound to VB or to Excel works as expected and gives events like KeyPressEdit and ChangeEdit and so on. I have no clue as why AutoIt behaves different. Below a sample script and the free control to download (which has to be installed of course). #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=D:\nlrgo\My Documents\My AutoIt Scripts\SQList2\datagrid.kxf $Form1 = GUICreate("Form1", 719, 451, 228, 124, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_CLIPCHILDREN,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_Close") $Obj1 = ObjCreate("MstGrid.grdView") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 10, 10, 500, 300) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Event = ObjEvent($Obj1, "MSTEvent_") $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MSTEvent_($ev) ConsoleWrite("Event: " & $ev & @CRLF) EndFunc Func Form1_Close() Exit EndFunc Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) EndFunc While True Sleep(100) WEnd It seems that I cannot attache the control but you can download it from everywhere. Thanks!
  3. Hi Polps, I see what you mean. You confuse the loop with the breakpoint. The script is in one of two modes: or it is executing normally, or it paused. When it is paused (when you check the variables, etc) then the loop is halted. The events, like closing the window, are not stored for when the loop is executed again and thus not detected. So yes, the only way is to resume (the script is running again) and then close the window. What you can do however is to set a breakpoint in the GUIClose function, resume and close the window. The script is halted in the eventhandler then. Greetz, Heron
  4. Hi Polps, your english is perfectly clear for me, no problem. The command pane is not refreshed indeed. This is intended, there can be another or more statements in the command area, and you don't want them to execute each time automatically! But I admit that the array's values cannot be read easily from the variable list (only a few values at a time). I've been thinking about it before, when you click on the variable in the list and then the values are displayed in the result pane? Should that be an option? Your other points: 1. Don't know what script you are testing. I have no problems with the events, can you send your script maybe? 2. The white dots are not removed indeed, this can be fixed with little effort I think. The blue breakpoints however are comfortable to remain between the debug sessions I think. Do you agree? Thanks for your response, highly apprieciated! Gr, Heron
  5. Oh, and about your questions: 1) It's possible (in the next release) to delete the DBugScript file on exit? -> yes, *if* there is a new release, this is not a big deal. 2) Wich is the best way to monitoring array value step by step (not using code tooltips)? -> not sure what you're asking for. For one value of the array you could add a variable to the list (ex: v_arr[1][2]). It will be shown every time you break in the same function. And after a restart of the script you can 'restore saved list' (if you saved it first ). 3) Can you shortly explain the meaning of the "Save list", "Restore original list" buttons? -> 'Save list' will store the (modified) variable list (and the command/result pane) for the particular function. 'Restore original list' will restore the list with all the variables of the current function (or global vars when outside a function). Hope this helps.
  6. Hi Polps! Thanks for your kind words. Actually I'm not working on it anymore, partly because of the pale reactions on the forum. I just decided this weekend to create a Youtube info video as appetizer. Maybe more people will like it. I use it myself from time to time and it has never crashed (although there are odd issues ). I'll try to post a link to the video now. Bye DBUG video (Sorry for the bad quality, it's my first video ever!)
  7. In the main loop of the example there is a logprint of an WaitForSingleObject function. This is blocking the main loop. Confusing - Heron -
  8. Hi there, Update 4 arrived. Buttons, images and variable value under cursor. - Heron -
  9. Hi, thanks for your code, it is very clean, should be an example in the help file! However it doesn't fit my needs. First it seems limited to max approx 100 messages per second and secondly, it misses massages when the receiver is not fast enough (try a Sleep(1000) in the GUIGetMsg() loop). But thanks for thinking with me, really appreciated! - Heron -
  10. Hi there, I stumbled upon this thread by searching for multithreads (no pun intended). The reason is I'm exploring the same area of communicating between scripts, mainly to overcome the limitation of AutoIt being single threaded. I know of several options: pipes, environment variables, memory structures, windows messages and even file transfer, but did not experiment with them yet. But I did manage to communicate interscriptical by using straightforward AutoIt. Why not use _GUICtrlEdit_SetText() to write in the (hidden) edit box of a second script? First get the handle with ControlGetHandle() each time you want to write. It's much faster then I had expected. First I used polling to signal new data but this was to slow and gave complications when more senders were writing to the same script. Therefore I learned working with events, which was easier than I feared, for triggering and synchronizing. This way I could sent up to 2000 lines per second to another script! However I still don't know how to process the messages fast enough. When the receiving script is slow then the sending script is still delayed. I guess I have to use queues to cope with this but that's another story. - Heron -
  11. M23, it's not nearer, it is exactly what I want! I was already playing with this idea but couldn't get it right. And no thanks for the question, you're welcome Thanks, Heron
  12. Thanks for your fast reply! Indeed, I considered the slider already but wanted the standard look&feel. Also the slider has no 'line buttons' or however they are called, I mean the up/down buttons to scroll one line. But maybe I end up with the slider nevertheless - Heron -
  13. Hi there, is it possible to create a stand alone ScrollBar control. It will be used for something different then scrolling contents of a edit/listview control or window. It must generate notify messages to handle changes. I guess I'm not the only one with this desire. Anybody advise to get me on the way? Thanks - Heron -
  14. Hi, I did something similar for displaying array (n-dimensional) contents in a debugger window. It converts to a string and is very compact, but then there is no error handling in the way you do. Func _DispArr(ByRef $ar, ByRef $out, $d=0, $cnt=0) ;display values of n-dimension array Local $res If $cnt = 0 Then Dim $cnt[UBound($ar, 0)] For $i = 0 to UBound($ar, $d+1) if $i = UBound($ar, $d+1) Then Return $d-1 $cnt[$d] = $i if $d < UBound($ar, 0) - 1 Then $d = _DispArr($ar, $out, $d+1, $cnt) ;recursive call if $d = UBound($ar, 0) - 1 Then $res = Execute("$ar[" & _ArrayToString($cnt,"][") & "]") $out &= @CRLF & StringTrimLeft($DBGident, 4) & "[" & _ArrayToString($cnt,"][") & "] " & _Type($res) & ' = ' & @TAB & _Value($res, true) EndIf Next EndFunc I think you have the same approach but I didn't study it. As usual I get headache wich these recursive things... - Heron -
  15. Hi there, thanks for all who worked on this script to get it working. I was looking for something like this and could very well use it (be it that I broke it down to handle just one folder). One thing noted: when stopping and resuming the script, often it will crash. I tried to cleanup the event and struct variables but that didn't help. Finally I found that calling WinAPI CloseHandle() for the directory- and eventhandler did the job. Now monitoring can be stopped and resumed as much as you like. Just wanted to share this with you. - Heron -
×
×
  • Create New...