Start the EXE Server Programmatically On 3rd Edition Symbian Emulator
static TInt StartTheServer()
{
RProcess server;
TInt r=server.Create(KServerBinaryName, KNullDesC);
if (r!=KErrNone)
return r;
TRequestStatus stat;
server.Rendezvous(stat);
if (stat!=KRequestPending)
server.Kill(0); // abort startup
else
server.Resume(); // logon OK - start the server
User::WaitForRequest(stat); // wait for start or death
// Check the exit type.
// We can't use the 'exit reason' because if the server panicked this
// is set to the panic 'reason' (which may be '0' and cannot thus be distinguished
// from KErrNone)
r = server.ExitType();
if (EExitPanic==r)
r = KErrGeneral;
else
r = stat.Int();
server.Close(); // Don't need this
return r;
}
0 comments:
Post a Comment