Palm Database Programming:
The Complete Developer's Guide

Updates and Corrections

Return to the companion site main page.


The Time Book sample

The Time Book sample is being rewritten to make it better. It will be up here shortly with some details about writing UltraLite synchronization scripts.

Return to the companion site main page.


Compile problems with some of the samples on the CD-ROM

There are two problems right now with the samples on the CD-ROM:

Return to the companion site main page.


Updated samples for Release 6 of CodeWarrior and CodeWarrior Lite

At the time the book went to press, CodeWarrior Release 5 was the most recent version of CodeWarrior available. The CD-ROM includes a copy of CodeWarrior Lite Release 5. Release 6 is now the most current version of both programs. A few minor changes were required to some of the samples to work with Release 6, so you can download updated samples from this URL:

ftp://ftp.ericgiguere.com/pub/palmbook/cdrom/R6Samples.zip

CodeWarrior Lite users: You can download Release 6 of CodeWarrior Lite from the Metrowerks ftp site:

ftp://ftp2.metrowerks.com/pub/tools/lite/PalmComputing/cw_lite_palm_win.exe

This version of CodeWarrior Lite is less restrictive than Release 5, but it is missing the library files that are necessary to build C++ programs. Since the samples require C++, you have to copy some files from Release 5 over to Release 6. Here's what you do:

If you'd rather use a DOS shell, just do:

    cd "c:\CWLiteR6\Palm OS 3.1 Support"
    xcopy "c:\CWLiteR5\Palm OS 3.0 Support\Runtime" Runtime

You should now be able to build and link all the samples using CodeWarrior Lite Release 6.

Return to the companion site main page.


Corrected CD-ROM contents

The CD-ROM appears to be missing a few files and also has the read-only bit set on files that shouldn't be marked read-only. I've made a corrected CD-ROM image available on this site. You can access it via anonymous FTP to ftp.ericgiguere.com. In your web browser, type in this URL:

ftp://ftp.ericgiguere.com/pub/palmbook/cdrom

You'll see the same set of folders that are on the CD-ROM. You can navigate through the folders and download any of the files that interest you. Note that due to licensing restrictions the Evaluation Software and Palm Computing folders are empty -- you'll have to get the software and documentation in those folders from the original CD-ROM or download them from the appropriate websites.

If you can't access the CD-ROM image for some reason, send me mail at ericgiguere@ericgiguere.com and I can mail the files to you.

Return to the companion site main page.


Relaunching a program may require a new stack

The RelaunchWithGlobals function described in Chapter 4 (in the section "Recovering Global Data") neglected to allocate a new stack when it relaunched the application. This may cause the relaunched application to terminate due to a stack fault if your application does a lot of recursion or allocates large objects on the stack. The solution is simple, just add the sysAppLaunchFlagNewStack flag as follows:

// Relaunches an application with globals enabled.
//    creatorID -- the creatorID of the application
//    cmd       -- the launch code
//    cmdPBP    -- the launch parameter block
//    ret       -- holds the return value after the launch
// Returns: non-zero if the launch failed

Err RelaunchWithGlobals( ULong creatorID, Word cmd,
                         Ptr cmdPBP, DWord *ret )
{
    UInt              card;
    LocalID           id;
    Err               err = sysErrNotAllowed;
    DmSearchStateType stateInfo;

    if( DmGetNextDatabaseByTypeCreator( true, &stateInfo,
                                        'appl', creatorID,
                                        true, &card, &id ) == 0 ){
        err = SysAppLaunch( card, id,
                            sysAppLaunchFlagNewGlobals  | sysAppLaunchFlagNewStack,
			    cmd, cmdPBP, ret );
    }

    return err;
}

Of course, there's a trade-off involved here because each time you allocate a new stack you lose 2K from dynamic memory. Experiment with the flag and see what's right for your application, although in most cases you'll probably want to have it on, because you really never know how much stack space is available when your application is called in a non-initializing launch. The samples on the CD-ROM (which were finished after the book text) use this flag, for example.

Return to the companion site main page.


The wrong syntax is used to access field names in the Consolidator

On page 335 the book refers to the Name field using this syntax:

    olrl4p_tEMPLOYEE_Fields::ix_Name
But it should really be:
    olrl4p_tEMPLOYEE_Record::ix_Name
This is because olrl4p_tEMPLOYEE_Fields is an enumeration inside the olrl4p_tEMPLOYEE_Record structure. The Phone Book sample uses the correct syntax, this is just an error in the book text.

Return to the companion site main page.


Copyright ©2000-2001 by Eric Giguère. This page was last modified on No