有没有办法在winapi中创建非unicode ver4.1 richedit控件? [英] Is there no way to create a non-unicode ver4.1 richedit control in winapi?

查看:93
本文介绍了有没有办法在winapi中创建非unicode ver4.1 richedit控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照以下这些非常简单的说明在Windows中创建丰富的编辑控件[
我只是意识到我完全不正确地表达了我的问题,在所有我说unicode的地方,我的意思是使用宽字符串.是否有没有使用宽字符串的Richedit 4.1版本?


哇,一个谷歌搜索使用词组宽字符而不是词组unicode,我找到了我正在寻找的答案.

< a href ="http://cboard.cprogramming.com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html"> http://cboard.cprogramming. com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html</a> [< a href ="http://cboard.cprogramming.com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html"target =" _ blank"title ="新窗口> ^</a>]

特别指出4.1只能在unicode中使用.至少现在我知道了.我将只使用3.0,直到以后我决定重写我的unicode程序时为止.感谢SAKryukov暂时忍住了我的废话.

Hi, i''m trying to create a rich edit control in windows, following these very straightforward instructions here [http://msdn.microsoft.com/en-us/library/hh298375(v=vs.85).aspx[^], which are very straightforward, but when i try to compile, it tells me that MSFTEDIT_CLASS defines a unicode string, "RICHEDIT50W". I have no intention of using unicode in my program but in searching, i found no counterpart, "RICHEDIT50A". is there a non-unicode richedit 4.1 class? or am i gonna have to rewrite my entire appication to use unicode?

I just realized i worded my question entirely incorrectly, and everywhere that i said the word unicode, i meant the use of wide character strings. Is there a version of richedit 4.1 that does not utilize wide character strings?


wow, one google search using phrase wide characters instead of the phrase unicode and i find the answer i''m looking.

<a href="http://cboard.cprogramming.com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html">http://cboard.cprogramming.com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html</a>[<a href="http://cboard.cprogramming.com/windows-programming/54614-why-i-cant-use-richedit-4-1-a.html" target="_blank" title="New Window">^</a>]

specifically states that 4.1 was not available in anything but unicode. at least now i know. i''ll just use 3.0 until a future time when i decide to rewrite my program for unicode. Thanks SAKryukov for putting up with my nonsense for awhile.

推荐答案

是的,不是. RTF是一种非常古老的格式,在引入Unicode之前就已创建.使用启用了Unicode的Windows,然后在Wordpad.exe中键入一些Unicode字符.保存.使用一些纯文本编辑器查看RTF-您将看不到Unicode的痕迹.相同的RTF具有不同的接口;当应用程序在支持Unicode的系统上运行时,您可以复制文本,并将其粘贴为Unicode.您可以通过在项目中定义_UNICODE not 来使组件成为非Unicode.参见 http://www.i18nguy.com/unicode/c-unicode.html [ ^ ].

现在,让我们看看它是否有意义.如果您已经向用户提供了RTF控件,则用户可以键入任何内容.然后,您以某种方式使用生成的格式化文本,又使用什么? —如果用户使用已安装的输入法使用Unicode代码点键入文本,是否要将这些字符转换为?"字符?

不能,这几天使用非Unicode字符串可能无法自洽,尤其是对于RTF(用户无法立即检测到不支持Unicode的RTF),它将继续输入,这真是令人沮丧!想一想.这是可能的,但不正确.



原则上,您可以过滤每个键入的字符,并且只允许某些字符子集.竞标麻烦.支持Unicode更容易.

同样,您在Rich Text编辑器中键入的内容在内部不是Unicode.但是,当您将其另存为文本时,它将被另存为Unicode文本或非Unicode编译形式,并使用``?''替换非ANSI字符.

—SA
Yes and no. RTF is a very old format, created well before Unicode was introduced. Take your Unicode-enabled Windows and type some Unicode characters in Wordpad.exe. Save it. Look at the RTF using some plain-text editor — you will see no trace of Unicode. The same RTF has different interfaces; when the application is run on Unicode-enabled system, you can copy text and it will be paste as Unicode. You can make the component non-Unicode by not defining _UNICODE in your project. See http://www.i18nguy.com/unicode/c-unicode.html[^].

Now, let''s see if it makes any sense. If you already provide Rich text control to the user, the use can type anything. Then you use the produced formatted text somehow and what? — if the user types text using Unicode code point using installed input method, do you want these characters to be converted to ''?'' characters?

No, these days using non-Unicode strings cannot be self-consistent, especially with RTF where the user cannot immediately detect that Unicode is not supported, will continue typing and — what a frustration! Think about it. This is possible, but incorrect.



In principle, you can filter each and every typed character and allow only certain subset of characters. A bid hassle. Supporting Unicode is much easier.

Again, what you type in Rich text editor is internally not Unicode. But when you save it as text, it will be saved as Unicode text, or in non-Unicode compilation, with ''?'' replacing non-ANSI characters.

—SA


这篇关于有没有办法在winapi中创建非unicode ver4.1 richedit控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆