IIS servive not loading fast or early enough

P

PJC

I am running a local application at startup. The application is
launched from the registry "run" key. But, when the system boots, it
seems that IIS is not fully started yet so I get a "page not found."

Is there any way to specify a service startup priority?

At the same time, immediately before the application starts I see a
flash of the Windows desktop - anyone have any way just to go
straight to the app.

Thanks for any help. This is my first time using a development tool
like Embedded XP.

PJC
 
D

Doug Hoeffel \(eMVP\)

One thing you can try to do is wait to startup your application until after
IIS is running. Here is snippet where I check to see if the WWW Publishing
service (which depends on IIS Admin) is running:

// open Service Control Manager (SCM)
schSCManager = OpenSCManager( NULL, // machine (NULL == local)
NULL, // database (NULL == default)
SC_MANAGER_ALL_ACCESS); // access required
if (schSCManager)
{
// open World Wide Web Publishing Service (W3SVC)
schService = OpenService(schSCManager, _T("W3SVC"), SERVICE_ALL_ACCESS);
if (schService)
{
// retrieve the current status of the service
while ((retry_cnt < SERVICE_RETRIES) && (QueryServiceStatus(schService,
&ssStatus)))
{
if (ssStatus.dwCurrentState != SERVICE_RUNNING)
{
// give the service a chance to start
Sleep(500);

// request the service to update it's current status information to the
SCM
if (ControlService(schService, SERVICE_CONTROL_INTERROGATE, &ssStatus)
== 0)
{
// ... log error ...
}
}
else
{
break;
}
retry_cnt++;
} // end while
}
}

HTH... Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top