> #include <Pilot.h>
> #include <StringMgr.h>
>
> static Boolean TimerFormHandleEvent(EventPtr event)
> {
>    CharPtr strptr, dbgptr;
>    // other variable declarations here
>
> ...
>
>    strptr = "00:00.0";
>    dbgptr = "12:34.5";
>
>    // other case statement code here for handling the various events on
the
> form...
> switch(event->data.ctlSelect.controlID) {
>    case TimerFormRecalcButton:
>       StrCopy(dbgptr, srcptr);
>       break;
> }
>
> When I am running and get to the string copy line, I get a failure with a
> dialog window (with no error description thank you very much) and the
Close
> button.  The Error dialog is just an empty window with a couple of ASCII
> graphic (garbage) characters in it.

Has dbgptr been set to some allocated memory by this time?  If it is as you
originally set it, its pointing to read-only space within your program code,
the location where the string "12:34.5" is stored.

You need to either declare dbgptr as a char[8] (if it can't get longer than
7 characters) or allocate it dynamically from the heap using MemPtrNew.



-- 
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