On Sat, Jun 29, 2002 at 08:27:58AM -0400, Paul Nevai wrote:
> Is the following known and/or documented? Are there any fixes?
[...]
> Here is an example to show that using DmOpenDatabase() during
> sysAppLaunchCmdSystemReset does NOT work. The following PilotMain() returns
> errNone BUT all subsequent attempts to use the opened up database fail,
> including attempts to close it. Both DmNextOpenDatabase() and
> DmNextOpenResDatabase() fail to recognize the opened up database BUT it can't
> be deleted since it is open.  I need a pageUp-reset to delete the database.

Indeed:  that does not do what you want.  Your observations *ought*
to be enough of a clue for you to figure out what is going on.  The
Reference documentation of DmNextOpenDatabase() (but sadly not that
of DmNextOpenResDatabase()) provides a good clue too (in its "Purpose"
section).  And having looked at that you might be tempted to look at
DmNextOpenDatabase() source code, which will lead you to an enormous
clue in struct SysAppInfoType in SystemMgr.h in the SDK.

There is also a clue in table 1.1 of the Reference, but to be sure
it's not much of a clue.

I also faced this problem in my ErrorCodes application, and you can see
my analysis and solution in the sysAppLaunchCmdSystemReset processing in

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/prc-tools/samples/errorcodes/errorcodes.c?rev=1.5&content-type=text/vnd.viewcvs-markup

<meta>  The talk of clues above was not in any way intended as a rebuke;
I was able to figure out what was going on here, and I think you should
be able to too.  So why did I see the problem easily but you didn't?
The general observation I think, and the takeaway lesson for us all, is
that it comes down to a difference in attitude.

When faced with a problem ("dmModeLeaveOpen doesn't do the right thing
from sysAppLaunchCmdSystemReset"), one option is to point fingers and
call it an OS bug and demand that it be fixed.  But even if PalmSource
agrees that it is a bug and that it is worth fixing and fixes it, that
still doesn't help you much:  there will still be millions of devices
out there on which you can't assume the fixed functionality.  (If the
functionality was a bug, then long-term it did help to get it reported
and fixed, but it doesn't help with your immediate problem.)

Another option is to say "okay, so I can't use dmModeLeaveOpen from
sysAppLaunchCmdSystemReset" and realise that that per se was not what
you wanted to do: in reality, you had some higher-level goal and that
was one possible implementation.  And then you would look at other ways
to achieve your higher-level goal ("my database gets left open soon
after reset") using other existing Palm OS functionality.

And, during that investigation, you might find that dmModeLeaveOpen not
working as you (naively :-)) expected from sysAppLaunchCmdSystemReset is
in fact NOT a bug, but merely an implication of the way the operating
system works.  Not necessarily a particularly useful feature for you or
me, certainly, but an understandable feature that makes sense from
within Palm OS's admittedly somewhat warped view of the world.  In this
case it's suboptimal from our point of view, of course, but, often, we
do need to work with what actually exists rather than what would be
ideal.  (No, I'm not generally comfortable with such a pragmatic view
either: that's why I contribute to free software :-))  </meta>

    John

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

Reply via email to