Hi Chris, I'm new to C and I'm not. I stop with C 5 years ago.
Thanks a lot for the hint with the memory. Of course, i have no memory for the pointer's inside my structure. Michael Chris Tutty <[EMAIL PROTECTED]> schrieb in im Newsbeitrag: [EMAIL PROTECTED] > > "Michael Kipcke" <[EMAIL PROTECTED]> wrote > > I'm new to the Palm development and I have some problems with reading > > records. > > > I'm guessing that you're also new to C programming. If this is so then the > shortest answer is that C is a powerful but complex language that has a high > learning curve. If you're familiar with basic you might be better to check > out NSBasic which is excellent for small, simple apps without getting into > the nastier issues of C and the Palm API. > > > > PackedPersInfo * p_Person ; > > PersInfo * Person; > > > > VoidHand hrecord = DmQueryRecord ( kontakteDB , cursor ) ; > > p_Person = MemHandleLock ( hrecord ) ; > > const char * s = p_Person->Name ; > > > > Person->Name = s ; // at this Point I get an Emulator Error, dont't > > write to // CPU Register > > s += StrLen (s) + 1 ; > > > Person has never been initialised to point to anything. A pointer (*) isn't > a storage location, it's a reference to a storage location. If you don't > set it to either a locally defined structured (as in 'PersInfo Person;' and > Person.Name = ) or an allocated space (using MemHandleNew/MemHandleLock and > leaving the rest of the code the same) the OS will slap you for trying to > access memory location zero. > > If you need to continue with GCC and the Palm API go get a good book on C > for beginner's - it'll save you a bundle of pain. > > Chris Tutty > > > > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
