> From: Mike Eynon [mailto:[EMAIL PROTECTED]]
> err=SysAppLaunch(cardNo,dbID,0,sysAppLaunchCmdAddRecord,...);
> When I run this, I am getting an err return of 528 (?)

First, learn to interpret OS error codes.  They always consist of a round
(in hex) base code that indicates the subsystem, plus small sequential
numbers for the specific error.  In this case, 528 should jump out as
looking like 512 + 16, or 0x200 + 16.  And sure enough, the SDK header files
reveal these definitions:

        // file ErrorBase.h
        #define dmErrorClass 0x0200 // Data Manager

        // file DataMgr.h
        #define dmErrResourceNotFound (dmErrorClass | 16)

So something in SysAppLaunch is failing to find some resource.  Without the
OS source that's not very specific, but good to know.  So let's look for
problems in your first piece of code:

> In order to get the cardNo and dbID for iMessenger, I do:
> err = DmGetNextDatabaseByTypeCreator( true, &searchState,
>                                       0, sysFileCMessaging, ... );

You pass zero for the database type to find.  This tells it to return the
first matching database with iMessenger's creator ID.  This might just work
and find the iMessenger application, but it might find some other database
that has the same creator ID instead.  In fact that's what is happening
here.  It finds iMessenger's 'DATA' database instead.  (Or on 3.5 it may
also find the resource overlay DB.)  Then when you try to SysAppLaunch it,
the OS can't find a code resource in it, so SysAppLaunch fails and returns
dmErrResourceNotFound.

The fix: pass sysFileTApplication ('appl') instead of 0 to DmGNDBTC.

-slj-


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to