Thanks for your reply!
After long time trying to understand the problem, I realise that, because my program is made with multiple files, the "DmOpenRef db;" was accecible only in the file it was created, so, other files couldn't know db! So I put in every file I use db, this line "extern DmOpenRef db;" and all worked fine!!!


Andr� Augusto


Chris Tutty wrote:

From: "Andre Augusto" <[EMAIL PROTECTED]>


I have a function to get text from a field and another function to save the text to a database. But when I call the "InsertRecord()" function, the simulator craches (I also try the code in PDA, with same results.. ). I can't guess what's the problem.... can anyone help?



If you're trying to catch a crash start by checking for
null pointers. The InsertRecord() function uses a number
of pointers without checking them - the GetField result
that's passed to the stratoi, the recP result from the memhandlelock, the db value itself.


I'm also not sure about setting index to DmNumRecords to add a record at the end. Although it's probably fine,
is there any reason you can't use dmMaxRecordIndex
as the documentation for DmNewRecord
suggests?


Chris Tutty





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

Reply via email to