HELP:Simulator Crashed when background applet start to foreground | developer.brewmp.com HELP:Simulator Crashed when background applet start to foreground | developer.brewmp.com

Developer

HELP:Simulator Crashed when background applet start to foreground

Forums:

I have an application running in background.when received a massage(EVT_APP_POST_URL),it started to foreground to inform end users confirm massage and process status.

HandleEvent:
static boolean appHandleEvent(IApplet* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch ( eCode )
{
case EVT_APP_START:
{
pMe->m_bIsBgState = FALSE;
ISHELL_CloseApplet( pMe->m_pIShell, FALSE );
return(TRUE);
}

case EVT_APP_STOP:
{
/*set dwParam to run in bg*/
pMe->m_bIsBgState = TRUE;
*((boolean*) dwParam) = FALSE;
return(TRUE);
}

case EVT_PUSHAPP_POST_URL:
case EVT_APP_POST_URL:
{
ISHELL_StartApplet(pMe->m_pIShell, 0x83409675);
return(TRUE);

}

default:
return FALSE;

the problem is :at the first time receiving message, this course works well.But at the second time of receiving message,after called ISHELL_StartApplet in HandleEvent function and return SUCCESS, simulator crashed and did not receive EVT_APP_START event.

if said:First-chance exception in BREW_Simulator.exe: 0xC0000005: Access Violation.

call stack is:
1.AppModel_Suspend(AppModel * 0x033727d0) line 559 + 12 bytes
2.AppForm_HandleEvent(AppForm * 0x03371eb8, unsigned short 0x0002, unsigned short 0x0000, unsigned long 0x0012f444) line 1323 + 12 bytes
3.FORMS! 040b92f4()
4.FORMS! 040b3670()
5.FORMS! 040b92f4()
6.App_HandleEvent(_IApplet * 0x0336d498, unsigned short 0x0002, unsigned short 0x0000, unsigned long 0x0012f444) line 196 + 34 bytes
7.BREW_SIMULATOR! 004a9741()

What had happened? Why it crashed at the second time?
Who can give some suggestion?

before called ISHELL_StartApplet I called ISHELL_ActiveApplet,The last active applet is the same.
then I called ISHELL_CanStartApplet,it all returned TRUE.it seems that the situation is not changed.

:confused: :confused: :confused: