> dbID=DmFindDatabase(0,"PalmPrint");
> if (dbID) {
> StrCopy(theChars,"This is the string to print");
> err=SysAppLaunch(0,dbID,0,32768,theChars,&resultP);
> }
I need to add a strong recommendation to not use DmFindDatabase in this
case. Apps should definitely be referenced by type and creator, so if the
app's name changes, then the code still works. This may not seem important
to folks who think they'll make sure to never change the name of their app,
but we just tracked down a bug where someone used a tool to change the name
of an app, beamed it to a friend, and then under certain conditions the
code called DmFindDatabase, got no dbID, and then passed it along. Beware!
I'll also point out that there is the macro AppLaunchWithCommand in
AppLaunchCmd.h that makes this much more convenient, obvious, and safe.
-Roger Flores