joanex Posted May 27, 2021 Share Posted May 27, 2021 ... Func Thread_sss($iListview) _GUICtrlListView_SetItem($iListview, "test", 0, 1) EndFunc Global $iListview = GUICtrlCreateListView("Column1|Column2", 10, 10, 480, 250, Default) ... >>Error Code "variable is used without being declared" _CoProc_Create('Thread_sss',$iListview) How to assign control to multiprocess Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2021 Developers Share Posted May 27, 2021 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Earthshine Posted May 27, 2021 Share Posted May 27, 2021 (edited) not enough information to answer. give us code that can be compiled and tested along with a CLEARLY defined process about what you are doing and why. Else don't expect much in the way of help. and put the global definition of the control at the TOP of your script so it's defined before you call it from code. Edited May 27, 2021 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
joanex Posted May 27, 2021 Author Share Posted May 27, 2021 (edited) 33 minutes ago, joanex said: ... Func Thread _ sss ( $ iListview ) _GUICtrlListView_SetItem ( $ iListview , "test" , 0 , 1 ) EndFunc Global $ iListview = GUICtrlCreateListView ( "Column1 | Column2" , 10 , 10 , 480 , 250 , Mặc định ) ... >> Mã lỗi "biến được sử dụng mà không được khai báo" _ CoProc _ Create ( 'Thread_sss' , $ iListview ) Cách gán quyền kiểm soát cho đa quy trình My project expandcollapse popup#include"CoProcEx.au3" #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListView.au3> Func Thread_sss($iLw1) _GUICtrlListView_SetItem($iLw1, "test", 0, 1) EndFunc Global Const $LVM_CHECKED = 8192, $LVM_UNCHECKED = 4096 Global $iLastItemChecked = -1, $blItemAdded = False #region GUI Local $hGUI = GUICreate("MyGUI", 500, 500) Global $iLw1 = GUICtrlCreateListView("Column1|Column2", 10, 10, 480, 250, Default) For $i = 0 To 9 $blItemAdded = True GUICtrlCreateListViewItem("Item " & $i & "|" & "aaa" & $i, $iLw1) Next _GUICtrlListView_SetItemChecked($iLw1, 1) $iLastItemChecked = 1 _GUICtrlListView_SetItem($iLw1, "thread", 0, 1) ;Thread_ss($iLw1) GUISetState(@SW_SHOW, $hGUI) #endregion GUI Local $aText = 0 _CoProc_Create('Thread_ss',$iLw1) Func a($a) MsgBox(0,0,$a) EndFunc ;_CoProc_Create('Thread_', $iLw1, '1') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(10) WEnd GUIDelete($hGUI) Func Thread_ss($iLw1) _GUICtrlListView_SetItem($iLw1, "test", 0, 1) EndFunc CoProcEx.au3 New AutoIt v3 Script.au3 Edited May 27, 2021 by Jos Simply insert code in the post! ;) Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2021 Developers Share Posted May 27, 2021 Why would the new thread know anything about the GUI controls? Doubt it does as it is a separate process, so you would have to use Controlxxx() functions like you would when automating a different program. \ Jos joanex 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
joanex Posted May 27, 2021 Author Share Posted May 27, 2021 Thank you jos for correcting my post 🥰 I want each multiprocess to receive a different listview data, how can each multiprocess get the listview data Link to comment Share on other sites More sharing options...
argumentum Posted May 27, 2021 Share Posted May 27, 2021 #include <ListViewConstants.au3> ; add these to stop the error popup #include <StructureConstants.au3> ; add these to stop the error popup #include "CoProcEx.au3" #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListView.au3> Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
joanex Posted May 28, 2021 Author Share Posted May 28, 2021 I want to assign data from listview to another process Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2021 Share Posted May 28, 2021 ok, you could use https://www.autoitscript.com/forum/topic/197277-_arrayfromstring/ to send/receive the array via IPC Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
joanex Posted May 28, 2021 Author Share Posted May 28, 2021 I still don't get what you mean, can you put it in my project? Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2021 Share Posted May 28, 2021 no Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now