Hi,
I already run my function in a thread using:
hb_threadStart( @VerificaVersoes(),oEmpresa )
But when I close the program, always generates the error message below, Even having been completed the process carried out by VerificaVersoes()
#include "Fivewin.ch"
PROC Main()
LOCAL aObj := Array(1000000)
LOCAL oDlg, oButton
PUBLIC nDestroyed := 0
DEFINE DIALOG oDlg SIZE 400, 500
@ 11, 0 BUTTON oButton PROMPT "Start" SIZE 80, 8 ACTION Button1_Click(oDlg)
ACTIVATE DIALOG oDlg CENTER
RETURN
PROC Button1_Click(oDlg)
LOCAL n := 0
LOCAL pMutex := HB_MutexCreate()
FOR n :=1 TO 10
StartThread( "MyFuncForThreads", pMutex, oDlg, n )
NEXT
WaitForThreads()
RETURN
PROC MyFuncForThreads(pMutex,oDlg,n)
LOCAL cTID
HB_MutexLock(pMutex)
oDlg:Say(n,0,"Thread ID" + lTrim(Str(GetThreadID())) + " system id: " + lTrim(Str(GetSystemThreadID())))
HB_MutexUnlock(pMutex)
RETURN
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 87 guests