Actually IÂve already sent the code last week to the list, as I had no aswer, tried another aproach.

Here is the load procedure set in the tblsetloadprocedure:


Err PrvMedindoPegaItem(void *tableP, Int16 row, Int16 column, Boolean editable,
MemHandle *dataH, Int16 *dataOffset, Int16 *dataSize,
FieldPtr fld){
FieldAttrType attr;
Char * dataP;
AnPiRecordPtr recordP;
MemHandle recordH, fldH;

/*Aproveita que a funÃÃo lida field a field e os configura*/
FldGetAttributes(fld, &attr);
attr.justification = rightAlign;
attr.numeric = true;
attr.singleLine = true;
FldSetAttributes(fld, &attr);



FldSetMaxChars(fld, 6); *dataSize = FldGetMaxChars(fld) + 1; *dataOffset = 0; /*Retorna 1 se houver erro na alocaÃÃo da memÃria*/ if (!(fldH = MemHandleNew(*dataSize))) return 1; recordH = DmQueryRecord(AnPiDB, CurrentRecord); ErrFatalDisplayIf(DmGetLastRecord(), "Record nÃo encontrado");

        recordP = MemHandleLock(recordH);       

dataP = (Char *) MemHandleLock(fldH);

/*record->estado diz a medida atual*/
FlpFToText(recordP->P[recordP->estado][row][column], dataP, *dataSize - 1);

MemHandleUnlock(fldH);
MemHandleUnlock(recordH);

*dataH = fldH;


        return 0;

}

The save procedure isnÂt invoked before the debug display the unallowed memory read message.


Thanks,

On Wed, 02 Feb 2005 20:50:44 -0600, Logan Shaw <[EMAIL PROTECTED]> wrote:


Your English isn't perfect, but it's good enough to get across the idea. The problem is that you didn't give very much information. You didn't give any code. You just said something really vague and general. I have a function that does the same thing you describe (use a MemHandle to change the contents of a field) in my own code, and it works just fine. So, what can I tell you? I don't know what you're doing differently, so I can't say what the problem is. If I had to guess, I would say that if you're getting warned about accessing 0x000000 and 0x000002, then you're probably dereferencing a NULL pointer. But that is just a guess.



-- AyloNs Hazzud, com N invertido

Sempre usando Opera e seu fantÃstico programa de email, o M2. ComparaÃÃo do zoom do Opera com o do Firefox:
http://www.aylons.kit.net/2004/11/isso-sim-que-zoom.html


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

Reply via email to