problem with threading and formexdesctop

Byak@

Active Member
Licensed User
i don't understand...
this code return error when i compil it to exe!why???
B4X:
Sub App_Start
FormEx.New1("mainf")
Thread1.New1(B4PObject(1))
Msgbox(1)
FormEx.EnableThreading("Main.thread1", B4PObject(1))
Msgbox(2)
formex.Run
End Sub
version of threading.dll is 1.3?formexdesctop.dll is 1.6...
 

agraham

Expert
Licensed User
Longtime User
ithis code return error when i compil it to exe!why???
Because EnableThreading expects there to be some thread events to actually enable. Perhaps the help does not make this clear enough :( Sorry!
EnableThreading(Thread As String, B4PObject(1)) : Connects the FormEx to the ThreadEvent and DebugEvent of the Thread object

As you have no thread events delared there is an error. Add two events as below and all is well.

B4X:
Sub Thread1_ThreadEvent
End Sub

Sub Thread1_DebugEvent
End Sub
 
Top