adchar43
asked on
Strange problem with getting Form pointer
I am using Palm Development Suite to write my litte program to testing purpose.
I choose creating a Hello world programs which displaying a "Hello World" string in Main Form of the application. I edit the AppStart(void) function as below:
//------------------------ ---------- ---------- ---------- -
static Err AppStart(void)
{
FormPtr frmPtr;
UInt16 frmID;
FrmGotoForm(MainForm); // MainForm is the Form Resouce ID
// created by Wizard.
frmID = FrmGetActiveFormID();
frmPtr = FrmGetFormPtr(MainForm);
FrmAlert(BeginTestingAlert ); // BeginTestingAlert is a Alert Resource ID
// created before
if (frmID!=MainForm)
WinDrawChars("Error getting Form ID",21,10,10);
else
WinDrawChars("Successfull" ,11,10,20) ;
if (frmPtr== NULL || FrmGetFormId(frmPtr)!=Main Form)
WinDrawChars("Error getting Form Pointer",26,10,30);
else
WinDrawChars("Successfull" ,11,10,40) ;
return errNone;
}
//------------------------ ---------- ---------- ---------- -
1/ If i don't put the "FrmAlert(BeginTestingAler t);" into this code above, no string will be appeared!
2/ I put "FrmAlert(BeginTestingAler t);" into my code and when i start the application, i always get 2 error string:
Error getting Form ID
Error getting Form Pointer
I don't understand what foolish mistake i made that cause this stupid problem.
I included the "Form.h" but nothing better.
This is an emergency, i have to finish my testing application on next 1 week. This is my last bug!
Help me!
I choose creating a Hello world programs which displaying a "Hello World" string in Main Form of the application. I edit the AppStart(void) function as below:
//------------------------
static Err AppStart(void)
{
FormPtr frmPtr;
UInt16 frmID;
FrmGotoForm(MainForm); // MainForm is the Form Resouce ID
// created by Wizard.
frmID = FrmGetActiveFormID();
frmPtr = FrmGetFormPtr(MainForm);
FrmAlert(BeginTestingAlert
// created before
if (frmID!=MainForm)
WinDrawChars("Error getting Form ID",21,10,10);
else
WinDrawChars("Successfull"
if (frmPtr== NULL || FrmGetFormId(frmPtr)!=Main
WinDrawChars("Error getting Form Pointer",26,10,30);
else
WinDrawChars("Successfull"
return errNone;
}
//------------------------
1/ If i don't put the "FrmAlert(BeginTestingAler
2/ I put "FrmAlert(BeginTestingAler
Error getting Form ID
Error getting Form Pointer
I don't understand what foolish mistake i made that cause this stupid problem.
I included the "Form.h" but nothing better.
This is an emergency, i have to finish my testing application on next 1 week. This is my last bug!
Help me!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have been thinking about it when .... having a bath :D . Anyway, thanks.