Was discussing this with an engineer at work here...
He suggested using the WaitForSingleObject up to the point that the new thread has acquired the atomic time back over thenetwork, thus we are waiting on a network return, after that release it wiht a SetEvent call..
This is new to me, does anyone understand that?
SetEvent requires an hEvent handle, where is that achieved from?
-------------
Scott
mailto:[email protected][email protected]</A>
He suggested using the WaitForSingleObject up to the point that the new thread has acquired the atomic time back over thenetwork, thus we are waiting on a network return, after that release it wiht a SetEvent call..
This is new to me, does anyone understand that?
SetEvent requires an hEvent handle, where is that achieved from?
Code:
'In DialogProc: Case %WM_COMMAND Select Case LoWrd(wParam) Case %IDM_ACHECK Select Case CbCtlMsg Case %BN_CLICKED If IsFalse g_lngInitThreadHandle Then Thread Create InitThread(id) To g_lngInitThreadHandle Thread Close g_lngInitThreadHandle To Result ' Select Case WaitForSingleObject(hDlg , %INFINITE) ' Case %WAIT_OBJECT_0 ' The process terminated. ' Case %WAIT_TIMEOUT ' The process did not terminate within 5000 milliseconds. ' Case %WAIT_ABANDONED ' Bad call to function (invalid handle?) ' End Select End If End If Function = 0 Exit Function Now thefunction, code removed to get to the point: '----------------------------------------------------------------------------------- Function InitThread(ByVal x As Long) As Long UTCTime = CheckAtomicTime(nServer,Val(AtomPort),aTimeOut, Delay,st)
-------------
Scott
mailto:[email protected][email protected]</A>
Comment