Logan Wrote:
>When you call this function, are you passing a DmOpenRef that is
>to a database which is open read-write? Did you use dmModeReadWrite?

Yes, of course.

>This may not be the problem, but I always suggest that you use no
>cast on callback functions. If the function is the wrong type,
>you need the compiler to tell you. Casting turns off this error
>checking, and the error checking can be very helpful sometimes.

Thanks for this tip, I'll try not casting it.

>Do you really have "&record"? If so, you are getting a pointer
>to the second argument passed into your DBNewRecord() function.
>Since this argument is a pointer value that exists on the stack,
>you are passing an address on the stack to DmWrite(), and then
>DmWrite() will read from the stack instead of from the record.
>This is almost certainly not what you want.

Yes, I have init "record" explicitly before the invoke of this routine.

>It seems like this should be "DmCloseDatabase (db);" rather than
>"DmCloseDatabase(gLibDB);".

You are right. this place is a error, but I don't think this is the very place 
causes the probem. I'll fix it and have a try.

>Actually, I don't understand why you would open the database before
>you call the function and then close it at the end of the function.
>It seems more logical to either open AND close it in the same
>function or to do neither.

Actually, This is not what I want to do, in the first version of this routine 
does not have this statement, and problem is all the same. I added it to export 
the database I have modified from the simulator.


Thank you very much!

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

Reply via email to