![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как в RichEdit загрузить файл DOS формата? [D6, D7, WinME]
Alex31 © (2005-02-13 17:19:00)Здравствуйте уважаемые мастера!
Как в RichEdit загрузить файл DOS формата?
Метод LoadFromFile() грузит одни иероглифы ...:( помогите плиз..
Cobalt (2005-02-14 03:15:00) [1]Из дельфовой справки:
Description
GetNamePath is used to determine the text to display in the Object Inspector for the name of the object being edited. GetNamePath is introduced in TPersistent so descendants such as collections can appear in the Object Inspector. TComponent overrides GetNamePath to return the component’s name. Do not call GetNamePath directly.
:)
Просто Джо (2005-02-14 00:06:00) [2]
> SaveDialog1.GetNamePath
Однако...
Alex31 (2005-02-13 18:25:00) [3]Kerk © (13.02.05 18:22) [5]
Эта фигня как раз сохраняет в файт Richedit2.text !!!!!
А ответ на свой вопрос я уже нашел сам...!
RichEdit2.PlainText:=true;
Kerk (2005-02-13 18:22:00) [4]
> RichEdit2.Lines.SaveToFile( SaveDialog1.GetNamePath);
что за фигня?
Alex31 (2005-02-13 18:11:00) [5]2 Kerk © (13.02.05 18:03) [3]
А вот не выходит почему-то....
вот код:
procedure TForm1.Button1Click(Sender: TObject);
var s: string;
begin
if SaveDialog1.Execute then
begin
s:=RichEdit2.Text;
CharToOem(Pchar(s),Pchar(s));
RichEdit2.Text:=s;
RichEdit2.Lines.SaveToFile(SaveDialog1.GetNamePath);
end;
end;
Kerk (2005-02-13 18:03:00) [6]Alex31 (13.02.05 17:50) [2]
CharToOem видимо
Alex31 (2005-02-13 17:50:00) [7]Спасибо, помогло OemToChar!!!
А еще вопросик... метод SaveToFile тоже работает криво...как тут быть?
Юрий Зотов (2005-02-13 17:31:00) [8]TStringStream.LoadFromFile + OemToChar + LoadFromStream.