1. Win32lib richedit bug!

------------2712CE417301E24

Try the attached file. I'm using win32lib 59.1.

1. Fill in 60000 and check StreamRTF, and click OK.
   See at the bottom of the RichEdit. The number is truncated.

2. Uncheck StreamRTF and click OK again.
   See at the bottom of the RichEdit. Now the number is not truncated
   (000059991 still can be seen).

3. Now fill in 200000 and check StreamRTF, click OK.
   The number is truncated at 0000600..

4. Uncheck StreamRTF, click OK. Works well.

5. Check StreamRTF, click OK. Also works well.

It seems that if StreamText is selected (StreamRTF is not checked),
the buffer for the RichEdit will be allocated, but not when StreamRTF
is selected.

How to fix it? I saw the source code but I don't understand.

Thanks!

   

------------2712CE417301E24
Content-Type: APPLICATION/OCTET-STREAM; name="tesrtf.exw"

new topic     » topic index » view message » categorize

2. Re: Win32lib richedit bug!

----- Original Message ----- 
From: "aku saya" <akusaya at gmx.net>
To: "EUforum" <EUforum at topica.com>
Subject: Win32lib richedit bug!


> 
> Try the attached file. I'm using win32lib 59.1.
> 
> 1. Fill in 60000 and check StreamRTF, and click OK.
>    See at the bottom of the RichEdit. The number is truncated.
> 
> 2. Uncheck StreamRTF and click OK again.
>    See at the bottom of the RichEdit. Now the number is not truncated
>    (000059991 still can be seen).
> 
> 3. Now fill in 200000 and check StreamRTF, click OK.
>    The number is truncated at 0000600..
> 
> 4. Uncheck StreamRTF, click OK. Works well.
> 
> 5. Check StreamRTF, click OK. Also works well.
> 
> It seems that if StreamText is selected (StreamRTF is not checked),
> the buffer for the RichEdit will be allocated, but not when StreamRTF
> is selected.
> 
> How to fix it? I saw the source code but I don't understand.
> 

Add this line, just before calling putStream() ..

  LimitText(RichEdit6, length(txt))

By default the limit is 32K. This gets automatically changed, apparently, when
not doing SreamRTF. So to set the limit you really want, call LimitText() just
prior to streaming in data.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu