You must be talking about
System.Windows.Forms.Control.Invoke
and
System.Windows.Forms.Control.Invoke
. These methods are specific to this Forms library and have nothing to do with Windows Services. The delegate the invocation of any delegate instances the Form UI thread. I explained them in my past answers:
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^].
A Service does not have a UI thread, so this stuff it totally inapplicable to it. If, by some reason, you would need to delegate some delegate instance invocation to some different thread, this thread should be appropriately designed to accept those invocation request from some queue. You can learn how it work from my article:
Simple Blocking Queue for Thread Communication and Inter-thread Invocation[
^].
I must say, at least in some part of your work you take a wrong route. You should not try "translate" some application from one application type to another application type, especially if you don't clearly understand some techniques or things like this invocation mechanism. Instead, you should start from decomposing the original product into parts by aspects. First of all, you need to isolate UI, the part with never "survives" porting from one application type to another. (In your case, Windows Services don't have UI at all.) Actually, you need to thoroughly separate UI from other aspects of you product in first place, when you create this product, not when you port it.
—SA