2
Hello, everybody!
My mission is to give agility and fluidity to a software... leave it without those constant locks in each For...
For this I created a problem and would like to know if someone can solve. The solution will be applied to much of my system
The function below is responsible for performing several complex calculations and when called locks the form completely. The challenge is to run it in the background and still receive the answer: (true/false)
Public Function MinhaFuncao() As Boolean
Try
'Realiza os cálculos'
Return True
Catch ex As Exception
Return False
End Try
End Function
I’ve tried using Threads... something like this:
Dim minhaThread As Threading.Thread
minhaThread = New Threading.Thread(AddressOf MinhaFuncao)
minhaThread.IsBackground = True
minhaThread.Start()
In fact it worked! But I did not return any reply...
Well, anyway, thank you in advance!
I got it! This is a great solution expensive. It worked here!! Heheheheh About migrating to C#... I’ve even considered, but I was born in VB, I can’t leave now kkkkk And deep down the two share the same tools ^^
– Wesley Silva
Solution: Dim response As Boolean = Await Task.Run(Of Boolean)(Function() (Minhafuncao))
– Wesley Silva