I am new to Palm programming and I try to develop an application which keeps 
track of how many times certain applications stored on my handheld are 
launched. To do so, I follow these steps:

1. I get the card number and database ID of the applications I want to track 
using DmGetNextDatabaseByTypeCreator(true, stateInfoP, ‘appl’, ‘xxxx’, true, 
&cardNo, &dbID) (where ‘xxxx’ is the 4 letter creator ID of the application I 
want to track, not the application I try to develop). I make sure that the 
function returns errNone and it always does.
2. I then register to receive notifications from the applications for which I 
just got the card number and database ID using SysNotifyRegister(cardNo, dbID, 
sysNotifyAppQuittingEvent, NULL, sysNotifyNormalPriority, NULL). I make sure 
that the function returns errNone and it does.
3. I added code in the PilotMain to handle the sysAppLaunchCmdNotify launchcode 
so that my application's preference is updated during a 
sysNotifyAppQuittingEvent event. 

Unfortunately, my application's preference is never updated which tells me that 
my application never receives the notifications. Besides, when I close and 
restart my application, I should get the sysNotifyErrDuplicateEntry error when 
I register the other applications again (to indicate that my application is 
already registered to receive notifications from the other applications) but I 
don’t (I get the errNone instead).

Can anyone tell me what I am doing wrong? Thanks.

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

Reply via email to