Firstly, StrLen returns an Int16, which has a max value of 32767. If your
length is in fact over that limit it is conceivable that it might return the
signed equivalent (in memory) which is -15136 (0xC4E0). When you typecast
this to the UInt32, it is probably sign-extending this to 4294952160
(0xFFFFC4E0). This doesn't explain your figure of 4294952512, though.

    Dominique

"averoes" <[EMAIL PROTECTED]> wrote in message news:99899@;palm-dev-forum...
>
> you're right, i was so sure that my problem was MemHandleNew that i didn't
> notice that tb_size was so big !!
>
> in fact, the problem is not MemHandleNew but StrLen !
>
> when StrLen should return 50400, it returns 4294952512 !?!
>
> Any idea ???
>
> Thanks,
> Averoes
>
> "Henk Jonas" <[EMAIL PROTECTED]> a �crit dans le message de news:
> [EMAIL PROTECTED]
> >
> > tb_size is around 4 * 10^9 which is 4 GByte, or I'm wrong? What handle
> > shall the system return? You better check for a NULL handle and go with
> it.
> >
> > Henk
> >
> > averoes wrote:
> >
> > > Hi All !
> > >
> > > I have some troubles with MemHandleNew !
> > >
> > > UInt32 tb_size = StrLen(MyStr);
> > > UInt8* tb;
> > > MemHandle tb_h = MemHandleNew(tb_size); // here is the problem !
> > > tb = (UInt8*)MemHandleLock(tb_h);
> > > ...
> > >
> > > everything is OK if tb_size is not too big,
> > > for example if tb_size = 4294952512, then tb_h = NULL, then FATAL
ERROR
> !!
> > > [...]
> >
> >
> > --
>
> -------------------------------------------------------------------------
> > [EMAIL PROTECTED]
www.metaviewsoft.de
> >
> > <A
HREF="http://www.handango.com/PlatformTopSoftware.jsp?authorId=95946";>
> > <IMG SRC="http://user.cs.tu-berlin.de/~jonash/werbung.jpg";></A>
>
> -------------------------------------------------------------------------
> >
> >
> >
>
>
>
>



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

Reply via email to