Jump to content

Search the Community

Showing results for tags 'multi thread'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. #include <Array.au3> Opt("MustDeclareVars", 1) Func Test_1($x) Local $Array = _STCBF_Struct($x) Local $At = '' For $i = 0 To (UBound($Array)-1) Step 1 $At &= $Array[$i] &' - ' ;ConsoleWrite("$Array["& $i &"] = "& $Array[$i] &@CRLF ) Next MsgBox(0x40, "Thread-1", "Added Thread #1" &@CRLF&@CRLF& StringLeft($At,(StringLen($At) -3)) ) EndFunc ;==> _Thread_Start Func Test_2($x) Local $Array = _STCBF_Struct($x) Local $At = '' For $i = 0 To (UBound($Array)-1) Step 1 $At &= $Array[$i] &' - ' ;ConsoleWrite("$Array["& $i &"] = "& $Array[$i] &@CRLF ) Next MsgBox(0x40, "Thread-2", "Added Thread #2" &@CRLF&@CRLF& StringLeft($At,(StringLen($At) -3)) ) EndFunc ;==> _Thread_Start Func Test_3($x) Local $Array = _STCBF_Struct($x) Local $At = '' For $i = 0 To (UBound($Array)-1) Step 1 $At &= $Array[$i] &' - ' ;ConsoleWrite("$Array["& $i &"] = "& $Array[$i] &@CRLF ) Next MsgBox(0x40, "Thread-3", "Added Thread #3" &@CRLF&@CRLF& StringLeft($At,(StringLen($At) -3)) ) EndFunc ;==> _Thread_Start Local $Ax[4] = [100, 'A', 200, 'B'] Local $N = 10 Local $Bx[4] = [300, 'C', 400, 'D'] _Sub_Thread_CallBack_Func("Test_1", $Ax) _Sub_Thread_CallBack_Func("Test_2", $N) _Sub_Thread_CallBack_Func("Test_3", $Bx) MsgBox(0x40, "Thread-0", "## Default_Thread ##") ;################################################################################################################################################# Func _Sub_Thread_CallBack_Func($F, ByRef $P) Local $Px = "", $L = StringLen($P) If IsArray($P) Then For $i = 0 To (UBound($P)-1) Step 1 $Px &= $P[$i] &"," Next $Px = StringLeft($Px, (StringLen($Px) -1) ) $L = StringLen($Px) $P = $Px EndIf Local $H = DllCallbackRegister($F, "int", "DWORD_PTR") Local $S = DllStructCreate("INT; Char["& $L &"]") DllStructSetData($S, 2, $P) DllStructSetData($S, 1, $L) Local $R = DllCall("kernel32.dll", "hwnd", "CreateThread", "ptr", 0, "dword", 0, _ "long", DllCallbackGetPtr($H), "ptr", DllStructGetPtr($S), "long", 0, "int*", 0) ;DllCallbackFree($H) ;Return $R Sleep(10) EndFunc Func _STCBF_Struct(ByRef $x) Local $y = DllStructGetData(DllStructCreate("INT; Char["& DllStructGetData(DllStructCreate("INT; Char[1]", $x), 1) &"]", $x), 2) Local $Ar = StringSplit($y, ',', 2) Return $Ar EndFunc ;################################################################################################################################################# creates a thread and already passes the data in a array.
×
×
  • Create New...