View Full Version : How to use Start-on-boot API
Can anyone provide the sample code to use Start-on-boot API to launch exe file?
Thanks!
Hi,
look on http://www.symbian.com/developer/development/syslibs.html#sob
Bye
STeN
The codes below do not work with the downloaded ExeStartOnBoot.h
.cpp---------------------------------------------
#include "ExeStartOnBoot.h"
#include <e32base.h>
#include <e32def.h>
_LIT(KWatchCallApp, "\\system\\apps\\run\\run.exe");
void MainL()
{
RServiceStartOnBoot sob;
sob.CreateL();
CleanupClosePushL(sob);
sob.AddServiceL(KWatchCallApp);
sob.Close();
CleanupStack::PopAndDestroy();
}
// Cleanup stack harness
GLDEF_C TInt E32Main()
{
__UHEAP_MARK;
CTrapCleanup* cleanupStack = CTrapCleanup::New();
TRAPD(error, MainL());
__ASSERT_ALWAYS(!error, User::Panic(_L("ExeStartOnBoot"), error));
delete cleanupStack;
__UHEAP_MARKEND;
User::Exit(0);
return KErrNone; // and return
}
.mmp----------------------------------------------
TARGET ExeStartOnBoot.exe
TARGETTYPE exe
UID 0
SOURCEPATH .
SOURCE ExeStartOnBoot.cpp
USERINCLUDE .
SYSTEMINCLUDE . \epoc32\include
LIBRARY euser.lib //ws32.lib
-------------------------------------------
Any help? Thanks...
hmauricio
2005-10-03, 20:06
whell first of all you should tell you that my start-on-boot is also not working. but I can see that some things are missing in your code
1-you need to add the EXESTARTONBOOT.LIB to your .mmp (don't forget to use makmake after you add this LIB)
2-I think that where you have #include "exestartonboot.h" you should have #include <exestartonboot.h> (I'm not shure if this is relevant)
Tell me then if you can put this thing working
Hugo MaurĂcio
Yes, after add the EXESTARTONBOOT.LIB to the mmp, it compiles successfully. But when run the exe file, it gives error that missing startonbootdb.dll, which is odd. I still don't know why there is a class CServiceStartOnBootDb in .h file and how to use it. Possible the missing dll is from this class.
Any idea?
hmauricio
2005-10-04, 11:21
Hey!!
Yes that is odd and happend to me too in the emulator. But have you tried it in a mobile phone?
Whell I did and it doesn't work!
Hugo