I'm having problems registering the type of data I wish to have my
application respond to. I can't trace the code on the debugger since the
failures are in the IrDA section (that's an assumption). But I have done
some deductive testing and concluded (perhaps incorrectly) that
ExgRegisterData() is failing. Here's the section of code straight from my
app:
#define NIIRExt "nir"
#define NIIRCreator 'NIIR'
DWord
PilotMain (Word cmd, Ptr cmdPBP, Word launchFlags)
{
Err err;
#define version30 0x03000000 // PalmOS 3.0 version number
#ifdef __GNUC__
CALLBACK_PROLOGUE
#endif
err = RomVersionCompatible(version30, launchFlags);
if (err)
return err;
switch(cmd) {
case sysAppLaunchCmdNormalLaunch:
if(err =StartApplication())
return err;
EventLoop();
StopApplication();
break;
case sysAppLaunchCmdSyncNotify:
// register our extension on syncNotify so we do not need to
// be run before we can receive data.
if(ExgRegisterData(NIIRCreator,exgRegExtensionID,NIIRExt))
FrmAlert(AskAlert); //crash!!!
break;
<snip>
When the application is first installed, the code passes through the
sysAppLaunchCmdSyncNotify case block. This is where the application should
register the type of data it wishes to receive. If the registration fails,
I call FrmAlert (and bring the system to its knees - which is okay for my
debugging). The ExgRegisterData always returns 0, which means success. So
at this point I believe that the register is successful. I know that the
code is passing through this case statement because if I take the if()
check out and always call the FrmAlert whenever the
sysAppLaunchCmdSyncNotify condition occures, I see the alert form.
Now I have two pilots (doesn't every body?), one is a IIIx and the other a
plain ol' III, with my application installed on both. If I attempt to have
them exchange data with the extension type I registered ("nir"), the
receiving palm displays an alert box stating: "Cannot find application for
data received". Damn.
However, if instead of sending the data from palm to the other I send the
data from one Palm to my pc - the transmit works! On the PC I'm running
Linux and specifically irobex_palm3. The data is received correctly; the
extension is what I expect, the size is correct, the contents are correct.
So at this point I believe the two palm scenario is failing because my
application is not registering the extension.
Any ideas on what may be happening? Is there a hack out there to see what
extension types are registered?
The only factor that I can see different between my app and the Beamer
example app is that I'm using gcc (under Linux) and not code warrior.
Scott