
Autox
Members-
Posts
12 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by Autox
-
The download link downloads a 0k file. Anyone have a copy or updated link?
-
Very cool! Thanks!
-
I love this UDF. Question though, is it possible to do the progress bar vertically instead of horizontally? I was looking for something that would let me control the look of the progress bar in XP. My gui has limited realestate so I need it vertical. Thanks
-
I do know the handles. $ListBlade & $ListTool. And your right, I am not exactly clear on the how this is working. I have been learning the newest version of AutoIT and this part is fuzziest part for me at this time.
-
I have spent the past hour or so searching the boards looking for something regarding this so here goes... I have a gui that has 2 Listboxes (created via _GUICtrlListBox_Create) that contain data. The data in the two boxes is related. I have managed to get the gui to create both boxes, populate them with data via an ADO recordset and display the data. I even managed to get it to find the appropriate entry in box 2 when you click on an item in box 1. I need to be able to do the same in reverse. I have pretty much just taken the WM_COMMAND from one of the listbox example scripts and made very slight changes. My problem is that this 'canned' handler is set to handle only 1 box. How do I get it to recognize and handle 2? Line 3 appears to force it to use the handle only the one box. Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox If Not IsHWnd($ListBlade) Then $hWndListBox = GUICtrlGetHandle($ListBlade) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $ListBlade, $hWndListBox Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box _DebugPrint("$LBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_ERRSPACE ; Sent when a list box cannot allocate enough memory to meet a specific request _DebugPrint("$LBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_KILLFOCUS ; Sent when a list box loses the keyboard focus _DebugPrint("$LBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SELCANCEL ; Sent when the user cancels the selection in a list box _DebugPrint("$LBN_SELCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SELCHANGE ; Sent when the selection in a list box has changed ListBlade() SearchTool() _DebugPrint("$LBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SETFOCUS ; Sent when a list box receives the keyboard focus _DebugPrint("$LBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value EndSwitch EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND
-
I am working on a project that uses a SQL database. I am using ADO record sets for the data. In my cleanup routine I want to close all the record sets and the database connection. It appears if I don't it cleans itself up when it closes but as a matter of habit I like to clean up after myself. So, depending on what the user does one or more record sets may not be opened. Rather than set a flag stating I opened the record set I was hoping to just check it some how. I tried doing a: If $rsQTaskQueue.State = 1 Then $rsQBladeInfo.Close EndIF But if the RS was never opened I get an error that the variable is being used before being defined. If I create $rsQBladeInfo as a variable just in case, then when I try to actually create it as a record set I get an error about it not being an object. What is the best way to handle this? Thanks in Advance
-
I have a multidimensional array that contains a few hundred data points. One of the fields is a three digit code. 200, 300, 100, 199, 999, 500, etc... I am looking to be able to select based on something like or %9%. Thanks
-
I am doing some DB type stuff and I need to do a match based on If $var = "" .... Is that possible?
-
Thanks for pointing that out. I think I put that in while banging my head on it. Perhaps someone can help outline the flow of how TCP commands should be used? Basically something like this is how I understand it: Start TCP Services =>Listen on an IP/port -=>Attempt to accept an incoming connection --=>If no incoming continue listening ^^^ If yes incoming continue on vvv ---=>Receive data Here is where my understanding runs aground. I thought I understood how this worked but apparently not. How do I detect that the incoming connection is disconnected? In my example I have the sending app send a 'done' command and I close the socket. That doesn't seem right to me but I haven't had much luck elsewise. I get pretty much the same reaction if I don't close the socket and go back to listening. My logs show this: CODE2007-02-06 07:19:36 : - Initializing Logs 2007-02-06 07:19:36 : 2007-02-06 07:19:36 : - Initializing Variables.... 2007-02-06 07:19:36 : -- Logfile is set to H:\Code\IMP - Information Management Platform\DR - Data Router\tcplog.txt 2007-02-06 07:19:36 : -- Listener processes are limited to 100 2007-02-06 07:19:36 : -- Router IP Address is set to 172.19.10.31 2007-02-06 07:19:36 : -- Router Port is set to 33891 2007-02-06 07:19:36 : - Initializing TCP Services... 2007-02-06 07:19:36 : -- TCP Services Online... 2007-02-06 07:19:36 : --- Creating Listening port 2007-02-06 07:19:36 : --- Monitoring for incoming connections--1 The app will stop here and wait for that incoming connection. Then it begins processing that: CODE2007-02-06 07:19:41 : --- Receiving data...-500 - -=> 0 2007-02-06 07:19:41 : ---- Buffer Length=6 2007-02-06 07:19:41 : ---- Detected Communication Request... 2007-02-06 07:19:41 : ---- Responding to communication request The data sent to from the client app said 'report' which the if-then checks for and when it finds it then it sends the app into the 'ohura' function which transmits back some information which is recorded in the log as the 'Responding to communication...' entry. At this point it returns to the rvc function. The next line in that function is exitloop which sends it out of the while-wend code which should then have it process the WEnd stop which would send it back to the main loop. Here the loop would send it back to the detect function. The detect would find the client is still connected and goes back into the receive. Since the client app pauses with a message box for me to click the receive loops spins with no data. CODE2007-02-06 07:29:44 : --- Receiving data...-500 - report-=> 0 2007-02-06 07:29:44 : ---- Buffer Length=0 2007-02-06 07:29:44 : --- Receiving data...-500 - -=> 0 2007-02-06 07:29:44 : ---- Buffer Length=0 As soon as I click the button on the client it sends the 'done' message which the receive detects and processes. CODE... 2007-02-06 07:29:45 : --- Receiving data...-500 - -=> 0 2007-02-06 07:29:45 : ---- Buffer Length=4 2007-02-06 07:29:45 : ----- End Communication requested... 2007-02-06 07:29:45 : ------ Socket closed -0 -=> 500 2007-02-06 07:29:45 : --- Monitoring for incoming connections-500 2007-02-06 07:29:45 : --- Receiving data...-500 - done-=> 0 The socket closed in the above log is just text. I disabled the actual line of text that closes the socket. But here is my problem... The client app closes its socket and exitx but the server apps goes into a loop. You can see it goes to 'monitoring for new...' which is the detect routine. The detect routine looks like this: Func Detect() _FileWriteLog($LogFile,"--- Monitoring for incoming connections-" & $nSocketRecv) While $nSocketRecv = -1 ToolTip( "waiting for incoming file...", 0, 0 ) $nSocketRecv = TCPAccept( $nMainSocket ) WEnd The log entry above that says 'Monitoring for incoming connections-500' is the filewritelog from the detect function. As you can see the '500' in that line is the value of the last TCPAccept. This causes the while loop to be skipped apparently because $nSocketRecv is not equal to -1 it equals 500. This has led me to small break through on my app but I don't understand the logic of it. If I add in a line just above the 'While $nSocketRecv = -1' that says '$nSocketRecv = -1' then the receive loop processes properly and stops and waits for the next connection. My question at this point is... Is this the best/proper method of handling the communications? Resetting the value of the tcpaccept command to -1? Here is what I need my app to do: Daemon (on central server): Listen on designated port for incoming connections Agent (on client system): Connect to daemon on designated port Daemon: accept connection Agent: Tell daemon it wants to report in Daemon: assign a secondary port for the agent to report on. Daemon: Spawn an independent process to listen on that port Daemon: Tell agent which port to report on. Daemon: monitor for and process any other incoming connections Agent: Connect to listener process on the specified port Listener: Accept connection Agent: Send data Listener: Accept data Agent: Wait for verification Listener: Send verify Agent: Send done Agent: Exit Listener: Insert received date into queue Listener: Exit Thanks to all
-
Hey gang, I have been banging my head on this for awhile now and have gotten no where. I have been reading the help file and looking over the examples included there and an example Valery sent the last time I inquired about this stuff but I just don't get it obviously because it doesn't work like I would expect it. I am trying to write a client/server application that works basically like this... I want a central server that just sits waiting for incoming connections. When it receives one it receives the data. In this case it will be a one word request such as 'report' or 'update'. Once it gets this message I want it to send back a response (basically "I heard you"). Then I want it to go back to listening to that port or process any further pending incoming connections. I have managed to get it to start up and listen on the port. It detects the connections and receives the data packet. It sees the packet, reads it properly and sends the response. But then it just loops. It doesn't respond to anymore incoming connections. This is the code I am using for the server side: $StartCheck = TCPStartup() If $StartCheck < 1 Then _FileWriteLog($LogFile, "-- Error starting TCP Services..." & @error & " *****") Exit EndIf _FileWriteLog($LogFile, "-- TCP Services Online...") _FileWriteLog($LogFile, "--- Creating Listening port") $nMainSocket = TCPListen($MasterIP, $MasterPort) While 1 Detect() Rcv() WEnd Func Detect() _FileWriteLog($LogFile, "--- Monitoring for incoming connections-" & $nSocketRecv) While $nSocketRecv = -1 ToolTip("waiting for incoming file...", 0, 0) $nSocketRecv = TCPAccept($nMainSocket) WEnd TCPCloseSocket($nSocketRecv) EndFunc ;==>Detect ;MsgBox(0,"test",$nSocketRecv) Func Rcv() While 1 _FileWriteLog($LogFile, "--- Receiving data...-" & $nSocketRecv & " - " & $szRecvBuffer & "-=> " & @error) $szRecvBuffer &= TCPRecv($nSocketRecv, 2048) ; MsgBox(0,"test",$szRecvBuffer) If @error Then ExitLoop _FileWriteLog($LogFile, "---- Buffer Length=" & StringLen($szRecvBuffer)) If StringLen($szRecvBuffer) Then If $szRecvBuffer = "report" Then _FileWriteLog($LogFile, "---- Detected Communication Request...") Ohura() ExitLoop ElseIf $szRecvBuffer = "done" Then _FileWriteLog($LogFile, "----- End Communication requested...") TCPCloseSocket($nSocketRecv) _FileWriteLog($LogFile, "------ Socket closed -" & @error & " -=> " & $nSocketRecv) $szRecvBuffer = "" Return EndIf EndIf WEnd EndFunc ;==>Rcv Exit Func Ohura() ; _ArrayDisplay($AvailPorts,"test") ; MsgBox(0,"test","Spawn Listener") _FileWriteLog($LogFile, "---- Responding to communication request") TCPSend($nSocketRecv, "ohura-" & _ArrayPop($AvailPorts)) ; TCPCloseSocket($nSocketRecv) $szRecvBuffer = "" ; $nSocketRecv = -1 EndFunc ;==>Ohura TCPSend($nSocketRecv, "go away")
-
SQLite semi Embedded database functionality in AutoIt
Autox replied to ptrex's topic in AutoIt Example Scripts
How about from the perspective of a non-professional programmer? We have needs but not the resources to get help to implement them so I cobble together what I can. Currently for an application we are using I have to gather all of my information and then run an external application to report the data to the database but the app is very limited and we have issues frequently with it. To be able to write to, or pull from database would be awesome. I don't know VB, C, C+, C++, J or any other language. I have used AutoIT for years because it is quick and easy to learn. I have tried a number of other external tools but most require a certain version of .net or have some other limitation. I have reviewed a lot of the message strings on using DLL's but I need something that can run across multiple windows based platforms without requiring special extras installed. I know it can be done since the external app I am using works on everything from NT - 2003. So if there was an option of an include that would give the ability to interact with a centralized database that would be incredible. Just my humble, non-programmer opinion.