I'm making some test with hackmaster and write this code t try to show an
alert for cheking error, but when run on emulator always give me an error
"line 1111" or "illegal instruction", but if I remove the call to the
routine ShowMyError it work fine.What am I doing wrong?
Any suggestion will be great.
Gabo.
I make with this commands:
m68k-palmos-gcc -O1 -palmos3.5 -nostartfiles -o code03e8 code03e8.c
m68k-palmos-obj-res code03e8
cp code0001.code03e8.grc code03e8.bin
build-prc -t HACK myhack.prc "myhack" slid *.bin
The code is:
#include <PalmOS.h>
#include <PalmCompatibility.h>
#include "sliderhack.h"
void ShowMyError(Char *s1,Char *s2,Char *s3);
void MyEvtGetEvent(EventPtr evento, Int32 tiempo)
{
DWord temp;
void (*oldTrap)(EventPtr, Int32);
FtrGet('slid', 1000, &temp);
oldTrap = (void (*)(EventPtr, Int32)) temp;
ShowMyError("a","b","c");
oldTrap(evento, tiempo);
}
void ShowMyError(Char *s1,Char *s2,Char *s3)
{
DmOpenRef dbref;
UInt16 button;
dbref = DmOpenDatabaseByTypeCreator('HACK','slid',dmModeReadOnly);
if (dbref) {
button=FrmCustomAlert(ErrorA,s1,s2,s3);
DmCloseDatabase(dbref);
}
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/