trichview.com

trichview.support




Re: about GetItemText()


Return to index


Author

Message

Bagio

Posted: 04/01/2003 3:01:20


It is wrong the GetItemTextA()andGetItemTextA() is not a member of "TRichViewEdit"



"Sergey Tkachenko" <svt@trichview.com> wrote:

>If you need to get ansi representation of text, use GetItemTextA() (if text

>is Unicode, returned string will be converted to ansi; but this conversion

>is not always lossless).

>Similarly is with GetItemTextW() - it always returns Unicode string.

>

>GetItemText() returns text "as is".

>If this text is Unicode, it will return Unicode. In case of English text

in

>your example, it returns

>"a\x0s\x0d\x0f\x0a\x0s\x0d\x0f\x0" (each Unicode character consists of two

>bytes).

>If you want to work with this text like with Unicode, be careful: it is

not

>finished with double-byte zero.

>

>>

>> Code:

>>   a->InsertText("asdfasdf");

>>   AnsiString s = a->GetItemText(0));

>>

>> the result s is wrong.

>>

>> if I set Unicode property of text style to True.the s is "a",

>> else I set Unicode property of text style to false.the s is "asdfasdf".

>why?

>> How can I get s is "asdfasdf" when I set Unicode property of text style

to

>> True

>>

>

>





Powered by ABC Amber Outlook Express Converter