I would really appreciate some advice on getting passed this
problem. When I install an application I wrote and attemp to run it, I
receive the following message in the form of a small dialog box.
Launch Error.
The application cannot be launched because of a system error.
This dialog box is within the PalmOS (not an emulator popup). The only
option given me is to click OK, after which the system enters the Prefs
application.
I have searched through the knowledge base and the mailing list archives
without much luck. I am convinced it is something I am doing
habitually, because (and get this) the problem occurs both in the source
I build with CodeWarrior in Windows AND using the prc-tools (ver. 2.8)
on Linux (Debian).
I have to believe this is a common error, because I know of at least one
other person that had the same problem (it just mysteriously disappeared
for him, though he may have accidentally fixed it) and just the fact
that I am getting the same error using two completely seperate
development tools (meaning, its not likely a corrupt resource or prc
file) seems to indicate this.
Anyway, I have included the complete set of files used for the project
below. Please, if you can spare the time take a look and offer any
advice that you can.
-------------------------------------------------------
First I compile the source file below into sketch.o. Then I use the
following command to write the prc file which I install and attempt to
run.
build-prc sketch.prc "Sketch" TRol sketch.o *.bin
---------- sketch.rcp:
FORM ID 1000 AT (0 0 160 160) NOSAVEBEHIND
BEGIN
TITLE "Sketch"
LABEL "Sketch" AUTOID AT (CENTER 148) FONT 1
END
---------- sketchRsc.h:
#define MainForm 1000
---------- sketch.c:
#include <PalmOS.h>
#include "sketchRsc.h"
static Err StartApplication (void)
{
FrmGotoForm (MainForm);
return 0;
}
static void StopApplication (void)
{
}
static Boolean MainFormHandleEvent (EventPtr event)
{
Boolean handled = false;
switch (event->eType) {
case frmOpenEvent: {
FormType *form = FrmGetActiveForm ();
FrmDrawForm (form);
handled = true;
}
break;
}
return handled;
}
static Boolean ApplicationHandleEvent (EventPtr event)
{
FormType *form;
UInt16 formID;
Boolean handled = false;
if (event->eType == frmLoadEvent) {
formID = event->data.frmLoad.formID;
form = FrmInitForm (formID);
form = FrmInitForm (formID);
FrmSetActiveForm (form);
switch (formID) {
case MainForm:
FrmSetEventHandler (form, (FormEventHandlerPtr)MainFormHandleEvent);
break;
default:
break;
}
handled = true;
}
return handled;
}
static void EventLoop (void)
{
EventType event;
UInt16 error;
do {
EvtGetEvent (&event, evtWaitForever);
if (!SysHandleEvent (&event))
if (!MenuHandleEvent (0, &event, &error))
if (!ApplicationHandleEvent (&event))
FrmDispatchEvent (&event);
} while (event.eType != appStopEvent);
}
UInt32 PilotMain (UInt16 launchCode, MemPtr cmdPBP, UInt16 launchFlags)
{
Err err;
switch (launchCode) {
case sysAppLaunchCmdNormalLaunch:
if ((err = StartApplication ()) == 0) {
EventLoop ();
StopApplication ();
}
break;
default:
break;
}
return err;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/