You will need to compile your code as a multi-threaded .DLL and use Component Services to create COM+ application.
Assuming you are using Win2003 Server (COM 1.5 required) follow the steps in the link below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/htm/pgservices_ntservices_38o5.asp>There are two ways to run an application as a non-interactive application that only provides certain services: as a regular Windows application and as a Windows service.
>
>I'm building a new FoxPro application I want to run like a process so my clients can't interfere with it. How can I do this?
>
>Thanks,
- Jeff