--- Christian Eyrich <[EMAIL PROTECTED]> wrote: > > Thanks to a hint by mail from Mark Clayton it works now. > I didn't fill prefsSize (parameter 4) before calling > PrefGetAppPreferences() with the structure size/number of bytes > awaited ... > > Simple thing, big effect. Although the original reference from > Palm doesn't say it that clear, that you'll only get the number > of bytes you passed in prefsSize I'd interpret it this way now. > But the documentation I'm using (from Falch.net IDE) is even > more imprecisely at this point. > I thought of it as an info field when using the two pass procedure > with a NULL pointer on first call.
I think the Palm docs are fairly clear (it could use a little improvement) that you need to set prefSize for the second call. Note the <->, indicating you pass something in and the OS passes something out, and the mention of "size of the prefs buffer passed in": <-> prefsSize Pointer to the size of the prefs buffer passed in. Upon return, contains the number of bytes actually written or the number of bytes needed for the prefs structure. You can determine the required size for the prefs structure by passing NULL for prefs. Upon return, the prefsSize parameter contains the required size. Always compare the value returned in this parameter with the value you passed in. If the two values differ, you need to resize the prefs structure and call this function again. Since Palm frequently improves the docs, you might want to get a copy of the latest docs from the link (Windows or Mac OS) at http://www.palmos.com/dev/support/docs/palmos/ __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
