I have a class named CDialog with this function:
int CDialog::DoDialog()
{
ASSERT(m_nThisFormID!=0)
m_nRetFrmId = -1;
m_nActivationMode = -1; //0 goto; 1 popup
//m_nReturnFormID = 0;
//FormType* pForm = FrmGetActiveForm();
//if(pForm)
// m_nReturnFormID = FrmGetFormId( pForm );
int nResult = 0;
FormType* pForm = FrmInitForm( m_nThisFormID );
for( int i=0; 0 != CPalmApp::_appMsgMap[i].m_iFormID; i++ )
{// Set the event handler for the form
if( m_nThisFormID == CPalmApp::_appMsgMap[i].m_iFormID )
{
#ifdef USE_EXPANDED_MODE
FrmSetEventHandler( pForm, (FormEventHandlerType
*)CPalmApp::_appMsgMap[i].m_pThunk);//m_pfnHandleEvent );
#else
FrmSetEventHandler( pForm,
CPalmApp::_appMsgMap[i].m_pfnHandleEvent );
#endif
break;
}
}
FormActiveStateType curFrmState;
FrmSaveActiveState(&curFrmState); // save active form/window
state
FrmSetActiveForm(pForm);//to can call OnInitForm and to work with form's
controls
if( OnInitForm() )
{
//allways get form pointer, because it can change in OnInitForm, if a
control is added dynamic
pForm = FrmGetFormPtr(m_nThisFormID);
//RaiseEvent(frmOpenDialogEvent);
EventType newEvent;
MemSet(&newEvent, sizeof(EventType),0);
newEvent.eType = (eventsEnum)frmOpenDialogEvent;
newEvent.data.generic.datum[0] = m_nThisFormID;
EvtAddEventToQueue(&newEvent);
nResult = FrmDoDialog( pForm );
}
pForm = FrmGetFormPtr(m_nThisFormID);
FrmDeleteForm(pForm);
FrmRestoreActiveState(&curFrmState);
return nResult;
}
And from another class named COrderForm I do this:
if( theCOrderHeaderFormForm.DoDialog() == OrderHeaderCancelGraphicButton )
{
EXIT();
return false;
}
(COrderHeadeForm derives from CDialog)
It exit from COrderForm only if I tap twice this button: OrderHeaderCancelGraphicButton
It works on Palm OS < 5.0
I appreciate any help
Regards
Ciornei Mihai Bogdan
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Carol(Min) Li
Sent: Friday, June 04, 2004 2:58 AM
To: Palm Developer Forum
Subject: RE: FrmDoDialog...
you'd better write out the code here~
is it work well on other palm os version ?
-----Original Message-----
From: Mihai Ciornei [mailto:[EMAIL PROTECTED]
Sent: 2004年6月3日 22:58
To: Palm Developer Forum
Subject: FrmDoDialog...
Hi,
I have a problem with FrmDoDialog( FormType* pForm ) and Palm OS 5.3
I have to tap twice a control for the call of this function to take
effect.
And when I tap the second time I receive a Fatal Alert and my handheld
resets.
Do you have any idea why?
Thank's in advance
Ciornei Mihai Bogdan
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/