I'm trying to convert a Windows Forms application to a Windows Service and am having problems with BeginInvoke with the error...
'Reference to a non-shared member requires an object reference'
My understanding is that if BeginInvoke is called in a Windows Application without a control reference it will run on the thread that the form was created on. Is this correct?
How then can I use BeginInvoke in a Windows Service which has no UI?
Along the same vein, can anyone share some light on the best way to retrieve the thread that the Windows Service is running on?
'Reference to a non-shared member requires an object reference'
Code:
Dim ar As IAsyncResult = BeginInvoke(New ClearDataDelegate(AddressOf ClearData), o)
EndInvoke(ar)
How then can I use BeginInvoke in a Windows Service which has no UI?
Along the same vein, can anyone share some light on the best way to retrieve the thread that the Windows Service is running on?