void MainFormDoMQe( void )
{
MQEBYTE byteBuf[]={0x31,0x32,0x33,0x34 }; /*By Eugene*/
MQEBYTE *byteBufs;
SetFieldTextFromStr( MainErrorField, (char *)byteBuf); /*??????Here has
error*/
SetFieldTextFromStr( MainErrorField, (char *)byteBufs); /*??????Here
also has error*/
}
/***********************************************************************
*
* FUNCTION: SetFieldTextFromHandle
*
* DESCRIPTION: This routine simplifies the setting of hext in a field.
*
* PARAMETERS: fieldID - ID of field to populate
* txtH - Handle to memory containing string to use.
*
* RETURNED: nothing
*
* REVISION HISTORY:
*
*
***********************************************************************/
FieldPtr SetFieldTextFromHandle(UInt16 fieldID, MemHandle txtH)
{
MemHandle oldTxtH;
FormPtr frm = FrmGetActiveForm();
FieldPtr fldP;
// get the field and the field's current text handle.
fldP = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, fieldID));
ErrNonFatalDisplayIf(!fldP, "missing field");
oldTxtH = FldGetTextHandle(fldP);
// Set the field's text to the new text.
FldSetTextHandle(fldP, txtH);
FldDrawField(fldP);
// Free the handle AFTER we call FldSetTextHandle().
if (oldTxtH)
MemHandleFree(oldTxtH);
return fldP;
}
/***********************************************************************
*
* FUNCTION: SetFieldTextFromStr
*
* DESCRIPTION: This routine simplifies the setting of hext in a field.
*
* PARAMETERS: fieldID - ID of field to populate
* strP - Pointer to string to use.
*
* RETURNED: nothing
*
* REVISION HISTORY:
*
*
***********************************************************************/
FieldPtr SetFieldTextFromStr(UInt16 fieldID, MQETCHAR * strP)
{
MemHandle txtH;
// get some space in which to stash the string.
txtH = MemHandleNew(StrLen(strP) + 1);
if (!txtH)
return NULL;
// copy the string to the locked handle.
StrCopy(MemHandleLock(txtH), strP);
// unlock the string handle.
MemHandleUnlock(txtH);
// set the field to the handle
return SetFieldTextFromHandle(fieldID, txtH);
}
/***********************************************************************
*
* FUNCTION: StarterPalmMain
*
* DESCRIPTION: This is the main entry point for the application.
*
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the
launch code.
* launchFlags - word value providing extra information about
the launch.
*
* RETURNED: Result of launch
*
* REVISION HISTORY:
*
*
***********************************************************************/
static UInt32 StarterPalmMain(UInt16 cmd, MemPtr /*cmdPBP*/, UInt16
launchFlags)
{
Err error;
error = RomVersionCompatible (ourMinVersion, launchFlags);
if (error) return (error);
switch (cmd)
{
case sysAppLaunchCmdNormalLaunch:
error = AppStart();
if (error)
return error;
FrmGotoForm(MainForm);
AppEventLoop();
AppStop();
break;
default:
break;
}
return errNone;
}
/***********************************************************************
*
* FUNCTION: PilotMain
*
* DESCRIPTION: This is the main entry point for the application.
*
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the
launch code.
* launchFlags - word value providing extra information about
the launch.
* RETURNED: Result of launch
*
* REVISION HISTORY:
*
*
***********************************************************************/
UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
return StarterPalmMain(cmd, cmdPBP, launchFlags);
}
/***********************************************************************
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
*By Eugene
***********************************************************************/
//���o���������
static FieldPtr GetFieldPtr( UInt16 fieldID) //fieldID�����ID
{
//�ŧi�ܼ�
UInt16 fieldIndex; //��쪺����
FieldPtr field; //��쪺����
FormPtr form = FrmGetActiveForm(); //�@�Τ����檺����
fieldIndex = FrmGetObjectIndex( form, fieldID ); //���o������
field = FrmGetObjectPtr( form, fieldIndex ); //���o������
FrmSetFocus( form, fieldIndex ); //�]�w�J�I�����
return field; //�Ǧ^������
}���+��b�z'�ȧ��^=�f
�ޖ�^�Z+�k(��.�˛���m�ey��硶��0��f��(��^��^r캚h��ߢ���