Borislav Kolev wrote:
> Even better, can somebody tell me how to check who sub-launched the
> application?
I think the way I'd do this is to scan each presently opened application database and
obtain its creator code. This will indicate
who in the calling chain is calling you.
Note that there may be a number of apps call you and you're way down the chain.
Here's some code that walks the database list and does something similar:
/*
* Obtain information to see if the Date Book is already open i.e. another task has
it open.
*/
UInt theVersion;
DmOpenRef theOpenDB = ::DmNextOpenDatabase(0);
while (theOpenDB)
{
/*
* If its the Date Book DB then find out if its open
*/
LocalID theDbID;
UInt theCardNo;
ReturnIfErr_(::DmOpenDatabaseInfo(theOpenDB, &theDbID, NULL, NULL, &theCardNo,
NULL));
ULong theType;
ULong theCreator;
ReturnIfErr_(::DmDatabaseInfo(
theCardNo,
theDbID,
NULL,
NULL,
&theVersion,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
&theType,
&theCreator
));
if (theType == datebookDBType && theCreator == sysFileCDatebook)
{
mDateDBOpenByAnotherTask = true;
break;
}
theOpenDB = ::DmNextOpenDatabase(theOpenDB);
}
Kind regards,
Christopher
--
Christopher Hunt
Class Action Pty. Ltd.
Complete time zone management for the Palm(tm) connected organizer.
Check out http://www.classactionpl.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/