I have a DLL where I want one of it's functions to process in the background. When it has finished processing it will raise an event so that the requesting program can then see if it failed or succeeded.

ok - I know how to raise events - what I am not sure of is how to code it so that the program calling it can call the function and continue immediately.

If the DLL had a form then I guess I could do something with a timer - ie something like this.

Public Sub BackgroundTask()

timer1.enabled

End Sub

where all the background code is in the timer event.

However - the DLL doesn't have an associated form - and surely there must be a better way of doing this?

Thanks in advance