I hate to beg but I really need an answer.  I've been over this and over
this - I've tried everything I could think of and cannot get it to work.
Part of my problem is that I'm still developing an understanding of
"Fields".  The two books I  have on Palm programming don't go into fields
much.  I've also reviewed the SDK's but it hasn't all clicked yet.  (I've
also searched the Palm Dev Knowledgebase and the archives of this
newsgroup.)  I'm sure that what I'm trying to do is possible - it probably
just needs some re-arranging of my code.  So...if anyone could help it would
be greatly appreciated.

Dave

David Leland <[EMAIL PROTECTED]> wrote in message
news:46808@palm-dev-forum...
>
> I am struggling with the PhoneNumberLookup function.  I have a test
> application that takes a string and updates a field on a form.  Then I
call
> the PhoneNumberLookup function with that field.  All that works fine.
> However, when the PhoneNumberLookup function returns the address I select,
I
> receive a "MemoryMgr.c, Line:5253, Chunk under-locked" error.  I've
reviewed
> all the books I have on Palm computing and looked at the MemoPad SDK which
> also uses the PhoneNumberLookup function and I can't find the answer.
> Following is a snippet of the code I'm using.  As you'll notice I'm not
> doing anything with the returned field currently.  Eventually, when I get
> this working, I'm going to copy the information in the field to a string
> (HiddenHiddenField is declared with a maximum length of 160):
>
>  FormPtr   hiddenfrmP;
>  FieldPtr  fieldP;
>  MemHandle  textH;
>  Char*   str;
>
> // initialize "hidden" form and retrieve "hidden" field
>    hiddenfrmP = FrmInitForm (HiddenForm);
>    FrmDrawForm(hiddenfrmP);
>    fieldP = (FieldPtr)FrmGetObjectPtr(hiddenfrmP,
> FrmGetObjectIndex(hiddenfrmP, HiddenHiddenField));
>    textH = FldGetTextHandle(fieldP);
>    textH = MemHandleNew ( 5 );
>    str = MemHandleLock(textH);
>    StrCopy(str, "Test");
>    MemHandleUnlock(textH);
>    FldSetTextHandle(fieldP, textH);
>    FldDrawField(fieldP);
>    MemHandleFree(textH);
>
> // perform lookup
>    textH = FldGetTextHandle(fieldP);
>    textH = MemHandleNew ( 161 );
>
>    PhoneNumberLookup(fieldP);
>
>    FldSetTextHandle(fieldP, textH);
>    FldDrawField(fieldP);
>
> // free handle to prevent memory leak
>    StrIToA(result1P, FldGetTextLength(fieldP));
>    MemHandleFree(textH);
>
>    FrmDeleteForm(hiddenfrmP);
>
> Thanks,
> Dave
>
>
>
>



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