1. Still having Win32lib problem

Hi,

Didn't get any answer to this before, but I still need it.  I have been
unable to get text back out of a RichEdit control.  I tried poking around
in win32lib.ew and w32dll.ew, but no luck so far.

I made a little test program in Judith's IDE:

sequence line,text
text={}
line=" This is some text to test RichEdit Control\r\n"
for i=1 to 10 do text&=line end for
setText(RichEdit2,text) --works fine
text={}
text=getRichText(RichEdit2,-1) -- FAIL text={32 }


The content of "text" is {32 } (first char).

I am surprised no one else has reported this problem, if it isn't somehow
just on my machine. Has anyone had success getting text from a RichEdit?

--Quark

new topic     » topic index » view message » categorize

2. Re: Still having Win32lib problem

DB James wrote:

> I have been
> unable to get text back out of a RichEdit control.  I tried poking around
> in win32lib.ew and w32dll.ew, but no luck so far.

<snip>

> The content of "text" is {32 } (first char).

This has to do with the RichEdit class changing from WinXP SR1 onwards, so that
it expects strings in Unicode.

Have you tried using getStream instead? That should work fine.

-- 
Craig

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

3. Re: Still having Win32lib problem

Craig Welch wrote:
> 
> DB James wrote:
> 
> > I have been
> > unable to get text back out of a RichEdit control.  I tried poking around
> > in win32lib.ew and w32dll.ew, but no luck so far.
> 
> <snip>
> 
> > The content of "text" is {32 } (first char).
> 
> This has to do with the RichEdit class changing from WinXP SR1 onwards, so
> that
> it expects strings in Unicode. 
> 
> Have you tried using getStream instead? That should work fine.
> 
> -- 
> Craig

Thank you, Craig.  That did the trick -- onward!

--Quark

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

4. Re: Still having Win32lib problem

DB James wrote:
> 
> Hi,
> 
> Didn't get any answer to this before, but I still need it.  I have been
> unable to get text back out of a RichEdit control.  I tried poking around
> in win32lib.ew and w32dll.ew, but no luck so far.
> 
> I made a little test program in Judith's IDE:
> 
> }}}
<eucode>
> sequence line,text
> text={}
> line=" This is some text to test RichEdit Control\r\n"
> for i=1 to 10 do text&=line end for
> setText(RichEdit2,text) --works fine
> text={}
> text=getRichText(RichEdit2,-1) -- FAIL text={32 }
> </eucode>
{{{

> 
> The content of "text" is {32 } (first char).
> 
> I am surprised no one else has reported this problem, if it isn't somehow
> just on my machine. Has anyone had success getting text from a RichEdit?
> 
> --Quark

This problem has been there for a long time already: precisely, since Microsoft
started to ship RichEdit controls v3.0 and higher, because they  no longer store
text in UTF-8, but UTF-16 instead. You probably noticed that demos using RichEdit
controls weren't fully working.

The next version of win32lib will solve this; the fix was not trivial.

CChris

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

5. Re: Still having Win32lib problem

CChris wrote:
> 
> DB James wrote:
> > 
<SNIP>
> > I am surprised no one else has reported this problem, if it isn't somehow
> > just on my machine. Has anyone had success getting text from a RichEdit?
> > 
> > --Quark
> 
> This problem has been there for a long time already: precisely, since
> Microsoft
> started to ship RichEdit controls v3.0 and higher, because they  no longer
> store
> text in UTF-8, but UTF-16 instead. You probably noticed that demos using
> RichEdit
> controls weren't fully working.
> 
> The next version of win32lib will solve this; the fix was not trivial.
> 
> CChris

Hi CChris,

Thanks for the information on this.  The update on win32lib will be most
welcome when it happens.

--Quark

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

Search



Quick Links

User menu

Not signed in.

Misc Menu