-
Background Task
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
-
Could you do something like this ...
Code:
Public Sub Modules_BackgroundTask() as boolean
Modules_BackgroundTask = false
'do something here
Modules_BackgroundTask = true
End Sub
Public Sub WhaDaYaMaCallit()
Call Modules_BackgroundTask
Do while not Modules_BackgroundTask = true
'time wasting loop here
loop
-
Thanks for the reply, but I think I must be missing something.
Surely that code would just process module_backgroundTask twice - all the way through. and not in the background.
-
you're right, sorry I mis-read the question.