StyledText not accept Multi-bytes characters

Frank Benoit keinfarbton at googlemail.com
Thu Aug 21 07:24:36 PDT 2008


yidabu schrieb:
> On Thu, 21 Aug 2008 09:59:31 +0200
> Frank Benoit <keinfarbton at googlemail.com> wrote:
> 
>> yidabu schrieb:
>>> program crashed when StyledText.text encounter multi-bytes characters, e.g. Chinese.
>>>
>>> code below causes EXCEPTION_ACCESS_VIOLATION :
>>> Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at ntdll.dll (0x7c90316c) thread(1260)
>>> ->us
>>> #0 ?? () from ntdll.dll
>>>
>>> Code:
>>>
>>> import dwt.DWT;
>>> import dwt.custom.StyledText;
>>> import dwt.custom.StyleRange;
>>> import dwt.layout.FillLayout;
>>> import dwt.widgets.Display;
>>> import dwt.widgets.Shell;
>>> import dwt.widgets.Listener;
>>> import dwt.widgets.Event;
>>> import dwt.graphics.Color;
>>> import dwt.graphics.Point;
>>>
>>> import dwt.dwthelper.utils;
>>>
>>> void main() {
>>>     static String SEARCH_STRING = "box";
>>>     Display display = new Display();
>>>     Color RED = display.getSystemColor(DWT.COLOR_RED);
>>>     Shell shell = new Shell(display);
>>>     shell.setBounds(10,10,250,250);
>>>     StyledText text = new StyledText(shell, DWT.NONE);
>>>     text.setBounds(10,10,200,200);
>>>     text.setText("StyledText not accept Chinese 中国? ");
>>>     shell.open();
>>>     while (!shell.isDisposed()) {
>>>         if (!display.readAndDispatch()) display.sleep();
>>>     }
>>>     display.dispose();
>>> }
>>>
>>>
>>>
>>>
>> I did some changes to TextLayout.
>> Your example works now. More testing welcome.
> 
> dwtx.lib building error:
> 
> dwt\ole\win32\OleControlSite.d(621): Error: e2ir: cannot cast from __GUID** to _
> _GUID
> 

Should be fixed now.




More information about the Digitalmars-d-dwt mailing list