Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/06/2020 in all areas

  1. Petrask24

    multi threading

    I recall seeing this in one of my recent OS classes. Time to get way in over my head and relearn it. Thanks 🙂
    1 point
  2. argumentum

    multi threading

    yes. Search around for IPC
    1 point
  3. markyrocks

    multi threading

    edit sry. o Its because the slots is only global to the script. When you create threads using authread variables aren't global across threads. The threads can communicate with each other using messages, that's one way variables could be changed globally. You could also use a file that's shared between threads. The reason for this is the way that authread creates the threads, as you know autoit is not multi threaded capable on its own. To create "threads" authread actually creates a new autoit process for each thread. That being said your thread1() never actually executes inside the process in which your script is ran. To expand on this separate processes don't share virtual memory unless some kinda communications pipe is set up or memory is reserved by one process in another.
    1 point
  4. jchd

    multi threading

    This question would be best asked in the specific AuThread thread in Example Script forum.
    1 point
  5. Have you checked out any of the available UDFs for controlling services? See wiki for more details
    1 point
  6. abberration

    AutoIt Snippets

    Or.. MsgBox(0, "", @Compiled)
    1 point
  7. Thank you so much for your helpful links, mLipok!! I am finally able to display the output now. Here's my example which I'm finally able to see the output in the console. #include-once #include <array.au3> #include "ADO.au3" Global $oADODB_Connection = ObjCreate("ADODB.Connection") _Example() Func _Example() ; Error monitoring. This will trap all COM errors while alive. ; This particular object is declared as local, meaning after the function returns it will not exist. Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $sPassword ='MyPassword' $oADODB_Connection.Open("PROVIDER=SQLOLEDB.1;SERVER=localhost;DATABASE=mydb;uid=sa;pwd="&$sPassword&";") Local $objquery = $oADODB_Connection.Execute("if 1 = 1 print 'this is a test - hello'") Local $test = $objquery.Parent ;ConsoleWrite('Before CommitTrans' & @CRLF) ;$oADODB_Connection.CommitTrans EndFunc ;==>_Example ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) Local $iErrorCol_Max = $oADODB_Connection.errors.Count If $iErrorCol_Max = 0 Then ConsoleWrite( @CRLF & _ "! ==> COM Error intercepted ==> NOT ADO related Error " & @CRLF & _ "-" & @TAB & "$oError.description is: " & @TAB & $oError.description & @CRLF & _ "-" & @TAB & "$oError.number is: " & @TAB & @TAB & $oError.number & " in HEX is 0x" & Hex($oError.number) & @CRLF & _ "-" & @TAB & "$oError.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ "-" & @TAB & "$oError.windescription:" & @TAB & @TAB & $oError.windescription & @CRLF & _ "-" & @TAB & "$oError.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "-" & @TAB & "$oError.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "-" & @TAB & "$oError.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "-" & @TAB & "$oError.scriptline is: " & @TAB & @TAB & $oError.scriptline & @CRLF & _ "-" & @TAB & "$oError.retcode is: " & @TAB & @TAB & "0x" & Hex($oError.retcode) & @CRLF & _ "! ==> COM End of Error dump." & @CRLF & _ @CRLF) Else Local $oErr For $iErrorCol_idx = 0 To $iErrorCol_Max - 1 $oErr = $oADODB_Connection.errors.Item($iErrorCol_idx) ConsoleWrite( @CRLF & _ "! ==> COM Error intercepted ==> ADO Error Collection: .errors.Count = " & $iErrorCol_Max & " $oErr = .errors.Item(" & $iErrorCol_idx & ") " & @CRLF & _ ">" & @TAB & "$oErr.description is: " & @TAB & @TAB & $oErr.description & @CRLF & _ ">" & @TAB & "$oErr.number is: " & @TAB & @TAB & $oError.number & " in HEX is 0x" & Hex($oErr.number) & @CRLF & _ ">" & @TAB & " ErrorValueEnum description:" & @TAB & _ADO_MSDNErrorValueEnum_Description("0x" & Hex($oErr.number)) & @CRLF & _ ">" & @TAB & "$oErr.source is: " & @TAB & @TAB & $oErr.source & @CRLF & _ ">" & @TAB & "$oErr.SQLState is: " & @TAB & @TAB & $oErr.SQLState & ' Description: ' &_SQLState_Description($oErr.SQLState) & @CRLF & _ ">" & @TAB & "$oErr.NativeError is: " & @TAB & @TAB & $oErr.NativeError & @CRLF & _ "-" & @TAB & "$oError.windescription:" & @TAB & @TAB & $oError.windescription & @CRLF & _ "-" & @TAB & "$oError.scriptline is: " & @TAB & @TAB & $oError.scriptline & @CRLF & _ "-" & @TAB & "$oError.helpfile is: " & @TAB & @TAB & $oError.helpfile & @CRLF & _ "-" & @TAB & "$oError.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "-" & @TAB & "$oError.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "-" & @TAB & "$oError.retcode is: " & @TAB & @TAB & "0x" & Hex($oError.retcode) & @CRLF & _ "-" & @TAB & "$oError.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ "! ==> COM End of Error Collections dump." & @CRLF & _ @CRLF) Next $oADODB_Connection.errors.clear EndIf EndFunc ;==>_ErrFunc
    1 point
  8. Beege

    Tiny CPU Bar

    Here is a small and simple little script for creating a tiny cpu indicator bar that sits right above the taskbar like in the pic below. I got the idea from an android phone app called micro cpu and liked the concept. _TinyCPU.au3
    1 point
  9. MasterKnack

    BIOS Informations UDF

    This UDF gets basic information about BIOS. I'm author of this udf, and this is my first udf. Example: #include "BIOS.au3" Example() Func Example() MsgBox(0, "", _ @CRLF & "BIOS Release Date...........| "& _BIOS_Release_Date() & _ @CRLF & "BIOS Vendor.....................| "&_BIOS_Vendor() & _ @CRLF & "BIOS Version....................| "& _BIOS_Version() & _ @CRLF & "System BIOS Version.......| "& _BIOS_SysBIOSVer() & _ @CRLF & "System Family..................| "& _BIOS_SysFamily() & _ @CRLF & "System Manufacturer......| "& _BIOS_SysManufacturer() & _ @CRLF & "System Product Name....| "& _BIOS_SysProdcName() & _ @CRLF & "System Version.................| "&_BIOS_SysVer()& _ @CRLF & "System SKU........................| "&_BIOS_SKU()) EndFunc BIOS.au3
    1 point
  10. Can you please post your script? I guess it is a problem with setting the workbook to invisible.
    1 point
×
×
  • Create New...