Re: newbie question: how to read a string from a MemHandle?

2003-08-14 Thread Gearoid Murphy
correction, should be err = MemHandleResize(h, MemHandleSize(h)+(len+1)); From: Gearoid Murphy [EMAIL PROTECTED] Reply-To: Palm Developer Forum [EMAIL PROTECTED] To: Palm Developer Forum [EMAIL PROTECTED] Subject: Re: newbie question: how to read a string from a MemHandle? Date: Thu, 07 Aug 2003

Re: newbie question: how to read a string from a MemHandle?

2003-08-14 Thread Gearoid Murphy
I'm not sure what you are doing wrong. As I see it to write the data to the handle you should be doing something like the following: // global MemHandle MemHandle h = NULL; // Append data to whatever is already in handle void WriteDataToHandle(Char *dataInP) { Char *strP; Err err;

newbie question: how to read a string from a MemHandle?

2003-08-14 Thread blaman
hi everbody, i am new to palm and its memoryhandles. I receive a string and have to store it in a MemHandle, because i resize it in a loop while receiving the data. However, i´ve got no idea how to read the data from the handle, neither a normal (char*) cast, nor a sprintf works. I´m sure it is

Re: newbie question: how to read a string from a MemHandle?

2003-08-14 Thread blaman
at first thanx for your reply. However, when i try to access strP my programm crashes telling me it read memory from the memory manager data structures. Any idea what i did wrong? i locked the handle to write it, unlocked it, locked it again by strP = (Char *)MemHandleLock(h); accessed strP and

Re: newbie question: how to read a string from a MemHandle?

2003-08-11 Thread Gearoid Murphy
Char *strP; strP = (Char *)MemHandleLock(h); // h is a MemHandle if (strP) { // Do stuff with strP } // Make sure to unlock MemHandle MemHandleUnlock(h); From: blaman [EMAIL PROTECTED] Reply-To: Palm Developer Forum [EMAIL PROTECTED] To: Palm Developer Forum [EMAIL PROTECTED] Subject: newbie