Read-only archive of the All About Symbian forum (2001–2013) · About this archive

How to power off the phone...

1 replies · 1,517 views · Started 04 December 2003

Hello,

Does anyone knows how to power off the phone ? I've tried the following methods without success:

UserHal::SwitchOff();

but i've read that I should not use it directly, but instead I need
to
use :

Kern::AddEvent(ESwitchOff);

because I don't know what are the libraries and headers for this line
of
code I've used the code below without success:

TRawEvent event;
event.Set(TRawEvent::ESwitchOff);
UserSvr::AddEvent(event);

Also I've tried :

TRawEvent event;
event.Set(TRawEvent::ESwitchOff);
RWsSession ws = iEikonEnv->WsSession();
ws.SimulateRawEvent(event);

Do you have any idea of how can I do this ? Any suggestions are
welcome!

Thanks,
Marius.

You can directly call UseHal::Switch() their is no problem.
Where have u read about not calling it directly???