>
> I found some code a while back that allowed me to have an application that
> could run as a service or a  winform interface…anyone done this before?
>

If you want the same executable image to be both a Windows Service or a
WinForms app, I've never tried to do that, but perhaps you can different
entry points. One public method will start the message loop, the other
would wire-up to SCM start and stop. It's a bit weird though as services
and forms usually do different things and are used in completely different
ways.

A more common pattern is to simply write good structured code that
completely isolates the independent "work" and then wrap that in a WinForm
or a service (or a WCF service, or a console command, etc). If you factor
out the "work" you can wrap it in anything convenient.

Greg

Reply via email to