Question : Problem: Restart webserver

I need to be able to restart the webserver on my WinCE 5.0 device programmatically. I know it can be done but I have not found any articles laying it out. This probably works very similar to the WinXP or WinXP Embedded webserver. Any suggestions?

Answer : Problem: Restart webserver

Thank you for the link. I have seen that page in CodeProject but it looked more involved than what I wanted to do so I decided to keep looking. Maybe I'm just stubborn. But ultimately I wound up hunting through the Windows folder of my CE device and noticed that there was an executable called "services". I started playing with it and sure enough I was able to figure out how to start and stop and refresh any windows service I wanted to. I have had a look on MSDN for information on Services and it ranged from scant to misleading. So for the sake of posterity I am posting the call to CreateProcess() has worked to restart a WinCE 5.0 Webserver inside my application. This is likely to work for many other services but I have not tested them.

PROCESS_INFORMATION ProcInfo;
CString ServicesExe = "\\Windows\\services.exe";
CString Arguments = "refresh HTP0:";

BOOL bSuccess = CreateProcess(ServicesExe, Arguments, NULL, NULL, NULL, 0, NULL, NULL, NULL, &ProcInfo);

Thanks again for the help.
Random Solutions  
 
programming4us programming4us