thank you, but that did not help. everytime i launch the emulator
application i get stuck with an older version of a perviosuly installed app
on it whihc doesn't run corretly.  I have to do a "New Session" each time i
get in there, because by default the older "buggy" program is running.  I
need to stop this somehow, it odesn't matter if i download a new version of
the emulator and run the executable, i still get that program running. 

boaz


----------
Greetings, in the settings of the emulator, there is an option which allows
the emulator to save the session: never, always, ask user. It's under
properties. That might be what you first problem is. Concerning the 2nd
issue, I'll let the more experienced developers deal with it.

Kind regards,

----- Original Message -----
From: "Laor, Boaz" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 9:16 PM
Subject: 2 problems with codewarrior and emulator


> the first probelm i am having is everytime the emulator loads, it doesn;t
> come to the default opening screen, btu somehow launches into a program i
> installed on it. I tried re-downloading the emulator, but the program
keeps
> loading by default, and i didn't make any switches or prefrences to have
it
> do that.
>
> the second problem i am having is with data base, when i retrieve records
> from a data base the emulator crashes, and i assume there is something
wrong
> with my memory management, or the DmWrite.
>
> this is how i retrieve text from text field and store them.
>
>
> textFieldPrt = getObject(frmP,MainFirstNameField);
> FldCompactText(textFieldPrt);
> h = FldGetTextHandle(textFieldPrt);
> s = MemHandleLock((void *)h);
>    clientRec.firstName = s;
> FldSetTextHandle(textFieldPrt, NULL);
> MemHandleUnlock((void *)h);
> file://MemHandleFree(h);
>
> textFieldPrt = getObject(frmP,MainLastNameField);
> FldCompactText(textFieldPrt);
> h = FldGetTextHandle(textFieldPrt);
> s = MemHandleLock((void *)h);
> clientRec.lastName = s;
> FldSetTextHandle(textFieldPrt, NULL);
> MemHandleUnlock((void *)h);
> file://MemHandleFree(h);
>
> textFieldPrt = getObject(frmP,MainPhoneField);
> FldCompactText(textFieldPrt);
> h = FldGetTextHandle(textFieldPrt);
> s = MemHandleLock((void *)h);
> clientRec.phoneNumber = s ;
> FldSetTextHandle(textFieldPrt, NULL);
> MemHandleUnlock((void *)h);
> file://MemHandleFree(h);
>
> file://Char* FldGetTextPtr (FieldType* fldP)
>
>
FrmCustomAlert(DbInputAlert,clientRec.firstName,clientRec.lastName,clientRec
> .phoneNumber);
>
> file://pointer to record
>
> file://create the database record and get a handle to it
> hrecord = DmNewRecord(contactsDB, &(cursor),
> sizeof(clientRec)+6);
>
> file://lock down the record to motify
> precord = MemHandleLock(hrecord);
>
> file://clear the record
> file://DmSet(precord, 0, sizeof(Client), 0);
>
> DmWrite(precord,0,&(clientRec),sizeof(clientRec)+6);
>
> file://unlock the record
> MemHandleUnlock(hrecord);
>
> file://clear the busy biy and set the dirty bit
> DmReleaseRecord(contactsDB,cursor, true);
>
> file://incrememnt the totalr ecord count
> numRecords++;
> file://increment cursor
> file://cursor++;
>
> isDirty = true;
>
>
> ---------------
> this next sample is how i retrive my records, the varibale cursor is set
> globaly in a different function. is there anything i am missing in memeory
> management htta may cause this?
>
> static void setFields(void)
>

>         FormPtr form; file://contact detail form
>         file://CharPtr precord; file://A record pointer
>         Int16   index; file://The object index
>         Client  *clientRecPtr;
>
>         form = FrmGetActiveForm();
>
>         file://get currect record
>         hrecord = DmQueryRecord(contactsDB, cursor);
>         clientRecPtr = MemHandleLock(hrecord);
>
>         if (clientRecPtr->firstName!= NULL)
>

>                 file://set the text for the first name field
>
> setText(getObject(form,MainFirstNameField),clientRecPtr->firstName);
> file://precord+ DB_FIRST_NAME_START);
>                 file://set the text for the last name field
>
>
setText(getObject(form,MainLastNameField),clientRecPtr->lastName);//precord+
> DB_LAST_NAME_START);
>                 file://set the text for the phone number field
>                 setText(getObject(form,
>
MainPhoneField),clientRecPtr->phoneNumber);//precord+DB_PHONE_NUMBER_START);
>
>
>         }
>         else
>

>                 file://set the text for the first name field
>                 setText(getObject(form,MainFirstNameField)," ");
> file://precord+ DB_FIRST_NAME_START);
>                 file://set the text for the last name field
>                 setText(getObject(form,MainLastNameField)," ");//precord+
> DB_LAST_NAME_START);
>                 file://set the text for the phone number field
>                 setText(getObject(form, MainPhoneField),"
> ");//precord+DB_PHONE_NUMBER_START);
>         }
>         if(isDirty)
>

>                 file://get the index of our field
>                 index = FrmGetObjectIndex(form, MainFirstNameField);
>
>                 // set the focus to the first name field
>                 FrmSetFocus(form,index);
>
>                 file://set upper shirt on
>                 GrfSetState(false,false,true);
>         }
>
>         MemHandleUnlock(hrecord);
>         return;
> }
>
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>


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