Richedit line insertion error ошибка alex flasher

Topic: RichEdit line insertion error…  (Read 46145 times)

hi there mouser,

i just noticed that if i click on «About», an error message pops up.
it doesn’t hinder the functionality but just thought that you should know…
here’s the screenshot:

http://img129.imageshack.us/img129/7659/frerror9cm.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

best regards,
lanux

« Last Edit: September 27, 2005, 11:58 PM by lanux128 »


yipes!!
does anyone else see this?
this is quite bad actually and not at all ok, because the about box is how users enter license info, so this should never happen!!!
anyone else see this?


what operating system do you have?


what operating system do you have?

hi there mouser,

i’m using WinXP Pro on P4 1.8GHz with 256MB RAM… this is the 1st time i noticed this.

best regards,
lanux


hi there mouser,

just tried out the v1.07.18 beta, you are going so fast that i totally skipped v1.07.15 beta… ;-)
anyway, there are few pointers that i would like to share…

the above-mentioned error keeps popping up in the v1.07.18 beta, so i thought i’d just google it…
and this solution came the closest:

RichEdit line insertion error.

This error message is due to a size limitation with richedit components for some versions of Windows.
An exception error is raised when trying to insert text greater than 64KB.
It has to do with the version of riched32.dll that you’re using on your computer.

Source: http://www.philosophers.co.uk/quotations/bugs.htm

then i checked my version of Riched32.dll, which is 5.1.2600.0
so maybe there is some version conflicts…
http://img338.imageshack.us/img338/5821/riched32dll9hn.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

another thing is that while the «Auto-shrink window to fit results» is cool, i wish there was a way that it doesn’t save the windows’ size because i also use «Blank search shows files from launch history» which i’ve set to 9 entries (so i’d like to retain the windows’ height)…

okey, that’s it for now…

best regards,
lanux

P.S. to try out the skins thingy… :-)


i saw that on google too but i couldn’t figure out why it would be writing so much info as to show that error…
does it happen EVERY time you bring up about box? if not, do you have any clues when it does?
i really need to find this problem and fix it.  does it happen on all donationcoder.com programs about boxes?

ps.
can you explain a little more the issue with window sizing?


this richedit bug really needs to get fixed otherwise you (and anyone with same problem) willl have no way to enter license key..
or did you already enter a license key and maybe thats the cause of the issue?


lanux regarding the about box problem, could you try going to your find and run robot directory and moving the file DonationCoder_findrunrobot_Key.dat out of that directory and restarting F&R and then go to about box and see if you get the error?
maybe there is something in the license key that is upsetting the program..

and with regard to F&R window size — does autoshrink mode properly set the window size when showing results normally — and it’s only when you close and re-open that has those bad scrollbars?
and if you resize the window by just one pixel taller or wider does everything fit and scrollbars go away?

« Last Edit: October 04, 2005, 01:38 AM by mouser »


hi there mouser,

sorry, «real life» kept me back… ;-)
ok, to answer your questions…

lanux regarding the about box problem, could you try going to your find and run robot directory and moving the file DonationCoder_findrunrobot_Key.dat out of that directory and restarting F&R and then go to about box and see if you get the error?

-mouser

the error still recurs, as you can see from the screen-shot…

http://img247.imageshack.us/img247/4897/frerror25ul.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

and with regard to F&R window size — does autoshrink mode properly set the window size when showing results normally — and it’s only when you close and re-open that has those bad scrollbars? and if you resize the window by just one pixel taller or wider does everything fit and scrollbars go away?

yes, only when i close & re-open does the scrollbars appear & yes, if i resize then the scrollbars disappear.

and can you try latest version and see if the window size problem is still there with this version

man, that was fast! but sorry mouser, the sizing problem is still persistent. anyway it’s okay, it’s a minor annoyance that i can live with… ;-)

best regards,
lanux


we don’t live with such problems — we fix them!
don’t worry we will get it fixed, as long as you are still willing to test fix attempts.

one of things i’ve learned is that for every 1 person who reports a bug, probably 100 others experience it and just get mad and uninstall, so i treat all bug reports as things that need to be fixed.

let me prepare another test version to try.


we don’t live with such problems — we fix them!
don’t worry we will get it fixed, as long as you are still willing to test fix attempts.

man, that’s the spirit!
anyway as they say, if you insist, i can’t resist. keep them test versions coming.. ;-)

best regards,
lanux


i’d like to fix the richedt line problem first.

see this interesting entry from clipmate faq:
http://www.thornsoft…hEditlineinserterror

can you try their test app here:
http://www.thornsoft…rt/richedittest1.zip

and see if it also causes an error for you?

actually you know i use a richedit control just because i thought i might allow some formatting text (bold,etc.) but since i don’t, i could just change to a control that doesnt use richedit at all and that would solve the problem.  maybe i’ll just do that…


im going to split off the window sizing stuff into a separate thread — let’s use this one just for the richedit issue.


and see if it also causes an error for you?

well, the test app works fine…

http://img238.imageshack.us/img238/2355/richedittestapp4au.png

RichEdit line insertion error…

actually you know i use a richedit control just because i thought i might allow some formatting text (bold,etc.) but since i don’t, i could just change to a control that doesnt use richedit at all and that would solve the problem.  maybe i’ll just do that…

that’s ok, since the formatting makes the about box look much nicer… but why no one else have this problem?
i made a search inside my system folder & found these files:

  • riched20.dll —> v5.40.11.2210
  • riched32.dll —> v5.1.2600.0
  • richtx32.ocx —> v6.1.97.82

i’m no expert but does these version numbers match with the one in your pc?

best regards,
lanux


well if that test works then its a different issue for sure.
let me try something else then.


can you try this version:
https://www.donation…/FindAndRunRobot.zip
and test window sizing and about box again?

probably both will still be there.

IMPORTANT NOTE:
this is not a setup program! it is a replacement .exe in a zip file, so you need to copy this over on top of your existing Find and Run Robot directory and restart F&R.

If you would prefer i make setup programs as usual let me know.


ps. your versions are more recent than mine, so i don’t think its a dll problem..
must be something that i’m doing that is reacting strangely in your case..

does the same problem occur in other donationcoder.com program about boxes?


you da man! ;-) :up: :up:
the about box is displayed & the sizing bug is also nowhere to be seen (yet)…

http://img250.imageshack.us/img250/9695/frok3ds.png

RichEdit line insertion error…

this is not a setup program! it is a replacement .exe in a zip file, so you need to copy this over on top of your existing Find and Run Robot directory and restart F&R.

If you would prefer i make setup programs as usual let me know.

btw, why not distribute all releases this way since it’ll make zip file smaller… just a thought…

best regards,
lanux


ok so i guess its just a bug with the richedit control, i used a different way of setting the text this time.
good to know the richedit error bug is killed!


good to know the richedit error bug is killed!

yup, we can break out the champagne on this one! ;-)
btw, if it’s not too technical, may i know what’s the different way of setting of the text.
just in case, if i ran into another program that has the same bug then i can notify the author…

best regards,
lanux


sure, that’s a great idea.  btw the solution here is relevant for C++ Builder and Delphi.  It may not be direclty relevant for other languages that use the RichEdit control.

the first thing to realize is that it is a bug in the RichEdit control.

normally to set the text in a RichEdit control you could do this:

InfoText->Lines->Text=message;

instead i changed it to this:

InfoText->Lines->Text=»»;
InfoText->SelStart=0;
InfoText->SelText=message;

i also went into the properties for the RichEdit and changed MaxLength from 0 to 16000,
which should not be necesary but i figured i might as well.

the ideas to try these things came from google groups posts describing that RichEdit has some bugs that are triggered when you try to set text the normal way and that you should try setting it using SelText kludge.  Seems to work!

Thanks for helping me find this lanux, it really is appreciated since this could be a really nasty surprise for anyone trying to enter a license key in one of our programs!


hi there mouser,

i found another instance of the RichEdit error… ;-)
this time the error propped up in this program, Icon Factory 1.1…

http://img223.imageshack.us/img223/6553/iconfacterror4wb.png

RichEdit line insertion error…

best regards,
lanux


did you pass on a pointer to this thread to them i hope?


yeah, i did but the author replied saying he’s not developing the software anymore…

best regards,
lanux


FROSYA_26

0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

1

Delphi 6-7

28.12.2022, 11:46. Показов 1398. Ответов 21

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Всем добрый день.В результате работы кода возникает ошибка «RichEdit line insertion error».Задача программы открывать файлы в формате cpp866 сразу перекодировать в windows 1251 и выводить информацию в RichEdit постранично.Само перекодирование работает,но с выводом есть проблемы. Буду благодарен любой помощи,прикладываю код.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function StrOemToAnsi(const S: AnsiString): AnsiString;
begin
  if Length(S) = 0 then Result := ''
  else
    begin
      SetLength(Result, Length(S));
      OemToAnsiBuff(@S[1], @Result[1], Length(S));
    end;
end;
 
procedure TMainForm.OpenFiles(Sender: TObject);
begin
    if OpenDialog.Execute then
      TXT := TStringList.Create;
      TXT.LoadFromFile(OpenDialog.FileName);
      TXTS := StrOemToAnsi(TXT.Text);
      Page := 1;
      ShowPage;
end;
 
procedure TMainForm.ShowPage;
var
  i: Integer;
begin
  RichEdit.Clear;
  for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
    if i >= TXT.Count then
      Break;
      RichEdit.Lines.Add(TXTS[i]);
  end;
end;
 
function TMainForm.PageCount: Integer;
begin
  Result := TXT.Count div LinesOfPage;
  if TXT.Count mod LinesOfPage > 0 then
    Inc(Result);
end;
 
procedure TMainForm.NextPage;
begin
  if Page < PageCount then begin
    Inc(Page);
    ShowPage;
  end;
end;
 
procedure TMainForm.PrevPage;
begin
  if Page > 1 then begin
    Dec(Page);
    ShowPage;
  end;
end;
 
procedure TMainForm.Button1Click(Sender: TObject);
begin
  PrevPage;
end;
 
procedure TMainForm.Button2Click(Sender: TObject);
begin
   NextPage;
end;



0



Модератор

8590 / 5733 / 2306

Регистрация: 21.01.2014

Сообщений: 24,570

Записей в блоге: 3

28.12.2022, 12:26

2

Что такое TXTS? Если публикуете какие-то обрывки своего кода — озаботьтесь хотя бы, чтобы описания переменных присутствовали.



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 12:53

 [ТС]

3

Извините пожалуйста,сразу как-то и не подумал.

TXT // имя файла с текстом
TXTS // Имя файла уже с перекодированным текстом
LinesOfPage // количество строк на странице



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 14:04

4

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

TXT // имя файла с текстом

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

TXT := TStringList.Create;

Серьёзно? Давайте весь проект, или не ждите внятной помощи.



0



FROSYA_26

0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 14:54

 [ТС]

5

Простите меня ещё раз пожалуйста,виноват что сразу все не скинул.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
unit Unit1;
 
interface
 
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
 
type
TMainForm = class(TForm)
Button1: TButton;
Button2: TButton;
OpenDialog: TOpenDialog;
RichEdit: TRichEdit;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure OpenFiles(Sender: TObject);
procedure ShowPage;
function PageCount: Integer;
procedure NextPage;
procedure PrevPage;
 
private
{ Private declarations }
public
{ Public declarations }
end;
 
var
MainForm: TMainForm;
TXT: TStringList; // имя файла с текстом 
TXTS : String;  // имя файла уже с перекодированным тестом
Page: Integer;
 
const
LinesOfPage = 30; // кол-во строк на странице
 
implementation
 
 
 
{$R *.dfm}
 
function StrOemToAnsi(const S: AnsiString): AnsiString;
begin
if Length(S) = 0 then Result := ''
else
begin
SetLength(Result, Length(S));
OemToAnsiBuff(@S[1], @Result[1], Length(S));
end;
end;
 
procedure TMainForm.OpenFiles(Sender: TObject);
begin
if OpenDialog.Execute then
TXT := TStringList.Create;
TXT.LoadFromFile(OpenDialog.FileName);
TXTS := StrOemToAnsi(TXT.Text);
Page := 1;
ShowPage;
end;
 
procedure TMainForm.ShowPage;
var
i: Integer;
begin
RichEdit.Clear;
for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
if i >= TXT.Count then
Break;
RichEdit.Lines.Add(TXTS[i]);
 
end;
end;
 
function TMainForm.PageCount: Integer;
begin
Result := TXT.Count div LinesOfPage;
if TXT.Count mod LinesOfPage > 0 then
Inc(Result);
end;
 
procedure TMainForm.NextPage;
begin
if Page < PageCount then begin
Inc(Page);
ShowPage;
end;
end;
 
procedure TMainForm.PrevPage;
begin
if Page > 1 then begin
Dec(Page);
ShowPage;
end;
end;
 
procedure TMainForm.Button1Click(Sender: TObject);
begin
PrevPage;
end;
 
procedure TMainForm.Button2Click(Sender: TObject);
begin
NextPage;
end;
end.



0



AzAtom

Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 15:44

6

Я программу не запускал, но вопрос по алгоритму появился:

Delphi
1
2
3
4
5
6
7
8
9
10
11
procedure TMainForm.ShowPage;
var
i: Integer;
begin
RichEdit.Clear;
for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
if i >= TXT.Count then // <<<---------- Вот здесь в TXT.Count содержится количество строк в файле
Break;            // А в TXTS содержится весь перекодированный текст
RichEdit.Lines.Add(TXTS[i]); // <<<--------- А здесь добавляется LinesOfPage штук символов из TXTS, начиная с символа номер LinesOfPage * (Page - 1).
end;
end;

Если даже в каждой строке по 1 символу, то так не выйдет, так как, ещё есть символы конца строки.

Добавлено через 11 минут
FROSYA_26, вот эти 2 процедуры исправь вот так:

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
procedure TMainForm.OpenFiles(Sender: TObject);
begin
  if OpenDialog.Execute then
  begin
    TXT := TStringList.Create;
    TXT.LoadFromFile(OpenDialog.FileName);
    TXT.Text := StrOemToAnsi(TXT.Text);
    Page := 1;
    ShowPage;
  end;
end;
 
procedure TForm1.ShowPage;
var
  i: Integer;
begin
  RichEdit.Clear;
  for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
    if i >= TXT.Count then
      Break;
    RichEdit.Lines.Add(TXT[i]);
  end;
end;

А переменную TXTS можно вообще убрать.



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 15:56

 [ТС]

7

Большое спасибо AzAtom убрал лишнюю переменную так сказать,это действительно логично.



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 16:19

8

FROSYA_26, ещё желательно StringList (TXT) создавать только 1 раз, а то сейчас утечка памяти получается.



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 16:34

 [ТС]

9

Большое спасибо за совет,сейчас поправлю.А относительно получаемой ошибки у Вас случайно нет идей в чем она может быть? Просто у меня появилась мысль что может ошибка связанна с длиной строки по которым идёт разделение по страницам? Просто отдельно в коде и перекодирование и разделение по страницам работает,а вот в месте пока никак



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 16:48

10

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

А относительно получаемой ошибки у Вас случайно нет идей в чем она может быть?

Это происходит потому, что при Page = 1 значение LinesOfPage * (Page — 1) равно 0, и получается пытаешься взять символ №0 из строки, TXTS[0], тут и получается ошибка.



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 16:55

 [ТС]

11

Получается что у перекодированной строки нет первого символа в строке? Просто с обычным тхт файлом если не использовать перекодирование то все работает,а ошибка именно в разделении перекодированных файлов.Хммм
Извините пожалуйста меня,но может у вас есть какое-то решение этого вопроса,хотя бы примерное,я бы был вам премного благодарен за помощь



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 17:02

12

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

Получается что у перекодированной строки нет первого символа в строке?

Нет, это потому, что в строках (string) первый символ имеет номер 1, в отличие от остальных массивов, списков и т.д.



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 18:29

 [ТС]

13

Так у меня же тоже после перекодирования получаются строки.Такие же как и в обычном файле просто в кодировке другой.Или я что-то не понимаю?

Добавлено через 5 минут
Так у меня же тоже после перекодирования получаются строки.Такие же как и в обычном файле просто в кодировке другой.Или я что-то не понимаю? А нет стоп,у меня же StringList,получается



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 19:00

14

FROSYA_26, в первом варианте все эти строки укладывались в одну строковую переменную TXTS, вот в ней первый символ имеет индекс 1. А по замыслу нужно не отдельные символы выбирать, а целиком строки, как в исправленном варианте.



0



FROSYA_26

0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 19:35

 [ТС]

15

Я вроде бы понял и исправил код как Вы советовали мне,но результат тот же и ошибка та же.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    RichEdit1: TRichEdit;
    OpenDialog1: TOpenDialog;
    procedure OpenFiles(Sender: TObject);
    procedure ShowPage;
    function PageCount: Integer;
    procedure NextPage;
    procedure PrevPage;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
 
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
TXT: TStringList;
Page: Integer;
 
const
LinesOfPage = 30;
 
implementation
 
{$R *.dfm}
function StrOemToAnsi(const S: AnsiString): AnsiString;
begin
if Length(S) = 0 then Result := ''
else
begin
SetLength(Result, Length(S));
OemToAnsiBuff(@S[1], @Result[1], Length(S));
end;
 
end;
 
 
 
procedure TForm1.OpenFiles(Sender: TObject);
begin
if OpenDialog1.Execute then
TXT := TStringList.Create;
TXT.LoadFromFile(OpenDialog1.FileName);
TXT.Text := StrOemToAnsi(TXT.Text);
Page := 1;
ShowPage;
end;
 
procedure TForm1.ShowPage;
var
i: Integer;
begin
RichEdit1.Clear;
for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
if i >= TXT.Count then
Break;
RichEdit1.Lines.Add(TXT[i]);
 
end;
end;
 
function TForm1.PageCount: Integer;
begin
Result := TXT.Count div LinesOfPage;
if TXT.Count mod LinesOfPage > 0 then
Inc(Result);
end;
 
procedure TForm1.NextPage;
begin
if Page < PageCount then begin
Inc(Page);
ShowPage;
end;
end;
 
procedure TForm1.PrevPage;
begin
if Page > 1 then begin
Dec(Page);
ShowPage;
end;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  PrevPage;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
 NextPage;
end;
end.



0



AzAtom

Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 19:46

16

Лучший ответ Сообщение было отмечено FROSYA_26 как решение

Решение

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

результат тот же и ошибка та же

У меня работает.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    OpenDialog: TOpenDialog;
    RichEdit: TRichEdit;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
    TXT: TStringList; // Текст
    Page: Integer;
    procedure ShowPage;
    function PageCount: Integer;
    procedure NextPage;
    procedure PrevPage;
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
const
  LinesOfPage = 30; // кол-во строк на странице
 
implementation
 
{$R *.dfm}
 
// https://www.cyberforum.ru/delphi-beginners/thread3065738.html
 
function StrOemToAnsi(const S: AnsiString): AnsiString;
begin
  if Length(S) = 0 then
    Result := ''
  else
  begin
    SetLength(Result, Length(S));
    OemToAnsiBuff(@S[1], @Result[1], Length(S));
  end;
end;
 
//procedure TMainForm.OpenFiles(Sender: TObject);
procedure TForm1.Button3Click(Sender: TObject);
begin
  if OpenDialog.Execute then
  begin
    TXT := TStringList.Create;
    TXT.LoadFromFile(OpenDialog.FileName);
    TXT.Text := StrOemToAnsi(TXT.Text);
    Page := 1;
    ShowPage;
  end;
end;
 
procedure TForm1.ShowPage;
var
  i: Integer;
begin
  RichEdit.Clear;
 
  for i := LinesOfPage * (Page - 1) to LinesOfPage * Page - 1 do begin
    if i >= TXT.Count then
      Break;
    RichEdit.Lines.Add(TXT[i]);
  end;
end;
 
function TForm1.PageCount: Integer;
begin
  Result := TXT.Count div LinesOfPage;
  if TXT.Count mod LinesOfPage > 0 then
    Inc(Result);
end;
 
procedure TForm1.NextPage;
begin
  if Page < PageCount then begin
    Inc(Page);
    ShowPage;
  end;
end;
 
procedure TForm1.PrevPage;
begin
  if Page > 1 then begin
    Dec(Page);
    ShowPage;
  end;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  PrevPage;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
  NextPage;
end;
 
end.

Вложения

Тип файла: rar delphi-beginners thread3065738 OEM to ANSI.rar (4.3 Кб, 2 просмотров)



1



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 20:02

 [ТС]

17

Спасибо за помощь,оно вроде как работает.Один файл я смог открыть и он нормально разбивает,но остальные почему-то даже не открываются с такой же ошибкой.Как вы думаете это может быть из-за длины строки?

Миниатюры

Ошибка: RichEdit line insertion error
 



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

28.12.2022, 21:09

18

Цитата
Сообщение от FROSYA_26
Посмотреть сообщение

но остальные почему-то даже не открываются

Где файл, чтобы попробовать?



0



0 / 0 / 0

Регистрация: 22.02.2015

Сообщений: 67

28.12.2022, 21:21

 [ТС]

19

Извините,что сразу не скинул



0



Модератор

3472 / 2027 / 722

Регистрация: 15.11.2015

Сообщений: 8,082

29.12.2022, 01:44

20

FROSYA_26, здесь RTF документ и кодировка CP1251. Нужно расширение сменить на .RTF и откроется в том же word-е, только страницу сделать альбомной надо.



1



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

29.12.2022, 01:44

Помогаю со студенческими работами здесь

Ошибка There was an error parsing the query. [ Token line number = 1,Token line offset = 43,Token in error = записи ]
В чем проблема, не могу понять. Вот исходник:

using System;
using System.Collections.Generic;…

Ошибка Parse error: syntax error, unexpected T_VARIABLE on line 11
Добрый день. Столкнулась с такой ошибкой в коде формы Parse error: syntax error, unexpected…

Ошибка Parse error: syntax error, unexpected ‘[‘ in W:\domains\hospitalCateringSys-master\index.php on line 69
Открываю через OpenServer, php 7.1
я понимаю что говорит об не закрытых скобках в строке 69, НО…

ошибка в коде Parse error: syntax error, unexpected ‘{‘ in E:\OpenServer\domains\test.ru\index.php on line 17
ошибка в коде Parse error: syntax error, unexpected ‘{‘ in E:\OpenServer\domains\test.ru\index.php…

Ошибка Parse error: syntax error, unexpected T_STRING in /home/bh22299/public_html/wp-config.php on line 25
Здравствуйте. Залил сайт на хостинг и выдаёт ошибку

Вот участок кода из файла конфига…….

В чем ошибка? Parse error: syntax error, unexpected ‘[‘ in Z:\home\localhost\www\inc\config.php on line 17
Что в этой строке не так?

static $a =

Я новичок в этом деле. Голову сломал с этой ошибкой….

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

20

You are getting the RichEdit line insertion error because of check added to the Delphi 2009 version. This check verifies if the insertion of a new line has been successful and this check uses for it the selection position. Unfortunately, for the following piece of code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  RichEdit1.Clear;
  RichEdit1.Lines.Add('1');
end;

procedure TForm1.RichEdit1Change(Sender: TObject);
begin
  if RichEdit1.Lines.Count > 0 then
    RichEdit1.Lines.Delete(0);
end;

The workflow looks like this:

1. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Get the position of the first char for the line where the string will be inserted, add the linebreak to that string, setup the selection (0 length, starting at the line beginning) and insert the string by performing EM_REPLACESEL message, what except the text insertion, changes also the selection position. The check mentioned above has not been performed yet, and in the meantime that text insertion causes the OnChange event to fire, where the TRichEdit.Lines.Delete is called.

2. — TRichEdit.Lines.Delete

Delete does something similar. It gets the first character index of the deleted line, setup the selection, now in the whole line length and performs the EM_REPLACESEL message with the empty string. But it also changes the selection position of course. And that’s the problem, because we are now going back to the last line of the TRichEdit.Lines.Insert function.

3. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Now the last thing of a previous call of the TRichEdit.Lines.Insert function remains to be done, the evil check based just on the selection position. And since the position has been changed by the meantime deletion, it doesn’t match to the expected result and you are getting the error message.

Also, before someone fix this issue, don’t use even this, it will cause the same error:

procedure TForm1.Button1Click(Sender: TObject);
begin
  RichEdit1.Lines.Add('1');
end;

procedure TForm1.RichEdit1Change(Sender: TObject);
begin
  RichEdit1.SelStart := 0;
end;

If you didn’t fell asleep from this boring story, then I can suggest you just to avoid the manipulation with the lines in OnChange event as much as you can (better to say, only when you know what can happen).

I got an error that says ‘EOutOfResources-RichEdit line insertion error’.
The error is in a control derived from TRichEdit, on this like:

Lines.Add(sMyString); 

Open in new window

The user that reported the error uses Win XP SP3 Korean. So it may be a problem between my Delphi 7 and the UNICODE strings? How can I solve it?

DelphiPascalProgramming Languages-Other

Почему я получаю ошибку вставки строки RichEdit при вызове события Delete в OnChange?

Я искал в Google и проверил много мест для решения, но все случаи, которые я обнаружил, отличались или включали что-то более продвинутое, чем простое добавление или удаление строк. По сути, я хочу сделать своего рода прокрутку с расширенным редактированием (альтернативой было бы перемещение курсора вниз, для чего я уже нашел решение).

Я добавляю к нему строки и проверяю Lines.Count с помощью события OnChange расширенного редактирования, и как только оно достигает значения больше 15, я хочу вызвать Lines.Delete(0) , однако получаю сообщение об ошибке :

RichEdit line insertion error

Может кто-нибудь сказать мне, что я здесь делаю не так?

Raith 7 Май 2012 в 02:40

Вы получаете сообщение об ошибке RichEdit line insertion error , о чем вы можете упомянуть в своем вопросе. Я попытаюсь понять, почему, но вы можете просто удалить строку, прежде чем вставлять новую.

7 Май 2012 в 03:00

Gsm Aladdin V2 1.4.2 Crack Full & Fix Registry Error (win error code: 2)

Когда вы вводите слова «ошибка», следующее , что вы должны ввести, — это точная ошибка, которую вы получаете, с полным сообщением об ошибке.

7 Май 2012 в 03:00
7 Май 2012 в 08:55

1 ответ

Лучший ответ

Вы получаете RichEdit line insertion error из-за проверки, добавленной в версию Delphi 2009. Эта проверка проверяет, была ли вставка новой строки успешной, и эта проверка использует для этого позицию выбора. К сожалению, для следующего фрагмента кода:

procedure TForm1.Button1Click(Sender: TObject); begin RichEdit1.Clear; RichEdit1.Lines.Add(‘1’); end; procedure TForm1.RichEdit1Change(Sender: TObject); begin if RichEdit1.Lines.Count > 0 then RichEdit1.Lines.Delete(0); end;

Рабочий процесс выглядит так:

1. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Получите позицию первого символа для строки, в которую будет вставлена ​​строка, добавьте разрыв строки к этой строке, установите выделение (длина 0, начиная с начала строки) и вставьте строку, выполнив сообщение EM_REPLACESEL, кроме текста вставка, также изменяет позицию выделения. Упомянутая выше проверка еще не была выполнена, и тем временем вставка текста вызывает событие OnChange, в котором вызывается TRichEdit.Lines.Delete.

2. — TRichEdit.Lines.Delete

Удаление делает нечто подобное. Он получает индекс первого символа удаленной строки, устанавливает выбор теперь по всей длине строки и выполняет сообщение EM_REPLACESEL с пустой строкой. Но, конечно, это также меняет позицию выбора. И в этом проблема, потому что теперь мы возвращаемся к последней строке функции TRichEdit.Lines.Insert.

3. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Осталось выполнить последнее из предыдущего вызова функции TRichEdit.Lines.Insert, злонамеренная проверка, основанная только на позиции выбора. И так как позиция была изменена за время удаления, она не соответствует ожидаемому результату, и вы получаете сообщение об ошибке.

Кроме того, прежде чем кто-то исправит эту проблему, не используйте даже это, это вызовет ту же ошибку:

How To Fix Miracle 2.82 Crack Error Problem Solution 2021

procedure TForm1.Button1Click(Sender: TObject); begin RichEdit1.Lines.Add(‘1’); end; procedure TForm1.RichEdit1Change(Sender: TObject); begin RichEdit1.SelStart := 0; end;

Если вы не заснули от этой скучной истории, то я могу посоветовать вам просто по возможности избегать манипуляций со строками в событии OnChange (лучше сказать, только когда вы знаете, что может случиться).

Community 20 Июн 2020 в 12:12

Забыл упомянуть, что он был написан кодом из Delphi 2009. В настоящее время у меня нет другой версии вручную, поэтому я не могу проверить, такая же ли она и в других версиях.

7 Май 2012 в 05:04

Думаю, можно предположить, что он (почти) для всех версий одинаков, у меня Delphi XE2. Хорошо, кажется, что это работает, если я инициирую удаление не в OnChange, а сразу после добавления новой строки в той же процедуре, я полагаю, что это лучший способ справиться с этим на данный момент?

7 Май 2012 в 09:01

Хранить строки вставки и удаления вместе в одном месте (без использования события OnChange) — это нормально и более общее с моей точки зрения. Это сообщение об ошибке просто раздражает и должно быть удалено оттуда, ИМХО.

7 Май 2012 в 10:25

Спасибо за объяснение того, что на самом деле происходит за кулисами RichEdit. Кроме того, не выйдет ли он без этой ошибки и просто не добавит странного поведения? Или вы хотите исправить это, чтобы заставить его работать так, как я изначально пытался? (Пришлось удалить последний комментарий, потому что вы уже обратились к SelStart в событии.)

7 Май 2012 в 13:44

Я бы сказал, что чек с этим исключением принес больше вреда, чем пользы. Я не могу представить, что может случиться, что строка не будет вставлена; может не хватило мощности? Тем не менее, единственное, что вы получите из-за этого реального сбоя, — это возникшее исключение, но это все. По сравнению с последствиями изменения выделения (или модификации строк) в таких событиях, как OnChange или OnSelectionChange , это довольно высокая цена. На ваш вопрос, как вы сказали; вам придется пересчитывать позицию выделения с учетом удаленной строки, а не только восстанавливать позицию до удаления строки.

Источник: question-it.com

Я пролистал уже существующие темы, но как такового ответа не нашел. Может объясните кто-то, что за ошибка? Как исправить?
Смысл там думаю и так будет понятен, но все же: Ищу в строках richedit’a слова, и выделяю эти строки жирным.
Ошибка конкретно тут:

selstart:=FindText(s,0,length(text), [stWholeWord]);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
begin for i:=0 to Veto.Lines.Count-1 do begin if (pos(‘picked’,Veto.Lines.Strings[i])>0) or (pos(‘left over’,Veto.Lines.Strings[i])>0) then begin s:=Veto.Lines.Strings[i]; with Veto do begin selstart:=FindText(s,0,length(text), [stWholeWord]); sellength:=length(s); selattributes.Style:=[fsbold]; end; end; end; end;
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
Ответы с готовыми решениями:

Ошибка «richedit line insertion error»
когда пытаюсь задать количество символов строке для вывода в RichEdit: AnsiString.

Избавиться от «RichEdit line insertion errror»
Посоветуйте, как избавиться от такой ошибки: «RichEdit line insertion errror» Ошибка.

Ошибка Parse error: syntax error, unexpected T_VARIABLE on line 11
Добрый день. Столкнулась с такой ошибкой в коде формы Parse error: syntax error, unexpected.

Заблокирован

Ошибка в том, что работать нужно со свойством RichEdit.Text, а вовсе не со строками. И то, текст ещё нужно «исправить» — удалить из него все переводы строки.

500 / 356 / 231
Регистрация: 29.03.2015
Сообщений: 675

Ваш код отлично работает у меня в Delphi 6, но начиная с Delphi 2009 добавили обязательную проверку на значения. FindText может вернуть (-1), если строка не найдена, поэтому у Вас код должен быть приблизительно такой:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
procedure TForm1.Button1Click(Sender: TObject); var i,p:integer; s:string; begin for i:=0 to Veto.Lines.Count-1 do begin if (pos(‘picked’,Veto.Lines.Strings[i])>0) or (pos(‘left over’,Veto.Lines.Strings[i])>0) then begin s:=Veto.Lines.Strings[i]; with Veto do begin p:=FindText(s,0,length(text), [stWholeWord]); if p>-1 then begin selstart:=p; sellength:=length(s); selattributes.Style:=[fsbold]; end; end; end; end; end;

Источник: www.cyberforum.ru

Почему я получаю сообщение об ошибке вставки строки RichEdit при вызове Delete в событии OnChange?

Я гуглил и проверял много мест в поисках решения, но все случаи, которые я нашел, отличались или включали что-то более сложное, чем простое добавление или удаление строк. По сути, я хочу сделать своего рода богатое редактирование с прокруткой (альтернативой было бы перемещение каретки вниз, для чего я уже нашел решение).

Я добавляю к нему строки и проверяю Lines.Count с OnChange событие богатого редактирования, и как только оно достигает значения больше 15, я хочу позвонить Lines.Delete(0) , однако я получаю сообщение об ошибке:

RichEdit line insertion error

Может кто-нибудь сказать мне, что я делаю неправильно здесь?

задан 06 мая ’12, 23:05

Ошибка, которую вы получаете, это RichEdit line insertion error , что вы можете упомянуть в своем вопросе. Я попытаюсь понять, почему, но вы можете просто удалить строку, прежде чем вставлять новую. — TLama

Когда вы набираете слова «ошибка», самое следующее вы должны печатать это точный ошибка, которую вы получаете, с полным сообщением об ошибке. — Ken White

1 ответы

Вы получаете RichEdit line insertion error из-за проверки, добавленной в версию Delphi 2009. Эта проверка проверяет, была ли вставка новой строки успешной, и эта проверка использует для этого выбранную позицию. К сожалению, для следующего фрагмента кода:

procedure TForm1.Button1Click(Sender: TObject); begin RichEdit1.Clear; RichEdit1.Lines.Add(‘1’); end; procedure TForm1.RichEdit1Change(Sender: TObject); begin if RichEdit1.Lines.Count > 0 then RichEdit1.Lines.Delete(0); end;

Рабочий процесс выглядит так:

1. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Получите позицию первого символа для строки, в которую будет вставлена ​​строка, добавьте разрыв строки к этой строке, настройте выделение (длина 0, начиная с начала строки) и вставьте строку, выполнив сообщение EM_REPLACESEL, что, кроме текста вставки, изменяет также позицию выделения. Упомянутая выше проверка еще не была выполнена, а тем временем вставка текста вызывает срабатывание события OnChange, где вызывается TRichEdit.Lines.Delete.

2. — TRichEdit.Lines.Delete

Удалить делает что-то подобное. Он получает индекс первого символа удаленной строки, устанавливает выделение, теперь уже по всей длине строки, и выполняет сообщение EM_REPLACESEL с пустой строкой. Но это также, конечно, меняет положение выбора. И в этом проблема, потому что сейчас мы возвращаемся к последней строке функции TRichEdit.Lines.Insert.

3. — TRichEdit.Lines.Add → TRichEdit.Lines.Insert

Теперь остается сделать последнюю вещь предыдущего вызова функции TRichEdit.Lines.Insert, проверку на зло, основанную только на позиции выбора. И поскольку позиция была изменена при удалении, она не соответствует ожидаемому результату, и вы получаете сообщение об ошибке.

Кроме того, прежде чем кто-то исправит эту проблему, не используйте даже это, это вызовет ту же ошибку:

procedure TForm1.Button1Click(Sender: TObject); begin RichEdit1.Lines.Add(‘1’); end; procedure TForm1.RichEdit1Change(Sender: TObject); begin RichEdit1.SelStart := 0; end;

Если вы не уснули от этой скучной истории, то могу посоветовать вам просто максимально избегать манипуляций со строками в событии OnChange (лучше сказать, только тогда, когда вы знаете, что может произойти).

Источник: stackovergo.com

TRichEdit Error mensage: RichEdit line insertion error

Возможно, адреса электронной почты являются анонимными для этой группы или вам требуется разрешение на просмотр адресов электронной почты ее участников, чтобы увидеть исходное сообщение.

I´ve only a form with a tRichEdit.
When I choose the Lines prop. of component I receive the mensage:

RichEdit line insertion error

I use Delphi 5, with pack 1.

I reinstall my delphi and the error persist.
Four days ago it´s ok and now not run.

Peter Below (TeamB)

не прочитано,
8 мар. 2001 г., 23:35:37 08.03.2001
Написать сообщение автору
Чтобы ответить автору, войдите в систему
Чтобы переслать сообщение, войдите в систему

Пожаловаться на сообщение
Чтобы пожаловаться на сообщение, войдите в систему
Показать исходное сообщение

Возможно, адреса электронной почты являются анонимными для этой группы или вам требуется разрешение на просмотр адресов электронной почты ее участников, чтобы увидеть исходное сообщение.

You can get this problem when you add a lot of text to a richedit using
richedit.lines.add. It seems to depend on certain versions of the
richedit DLL. You can work around it by not using lines.add but this to
add a line:

richedit.selstart := richedit.gettextlen;
richedit.seltext := linetoadd+#13#10;

If you add several lines in sequence the first statement setting the
selstart needs only be done before the first line you add.

There is another problem, also connected to some richedit DLL version
(mostly on Win9x): if you load a large file into the control it may
refuse to add more lines in code or by typing. This can be solved by
setting the controls MaxLength property to a value much higher than the
filesize after you loaded the file.

Источник: groups.google.com

Что не так?
Если поместить в ресурс тукстовый файл то всё хорошо но если ртф то ошибка при открытии, но сам файл загружается а потом ошибку выбивает(((

procedure TForm1 . Image2Click ( Sender : TObject );
var
LinesLoad : LongWord ;
begin
RichEdit1 . Clear ;
LinesLoad := FindResource ( hInstance , ‘Proj’ , RT_RCDATA );
LinesLoad := LoadResource ( hInstance , LinesLoad );
begin
RichEdit1 . Lines . Add ( StrPas ( PChar ( LinesLoad )));
begin
FreeResource ( LinesLoad );
end ;
end ;
end ;

Зарание благодарен!
С уважением,
Volkogriz!
Не количеством плюсов измеряется репутация человека.
Форумчанин
Регистрация: 11.10.2007
Сообщений: 372

Кто нить подскажет, хотябы намекните чтоб понять гте капать.
что только не пробовал выдаёт ошибку!
подскажите плиз
Зарание благодарен!
С уважением,
Volkogriz!

Не количеством плюсов измеряется репутация человека.
Форумчанин
Регистрация: 11.10.2007
Сообщений: 372
Всем спасибо разабрался спустя ночь)))

var LinesLoad:LongWord; LinesStream:TStringStream; begin RichEdit1.Clear; begin LinesLoad:= FindResource( hInstance, ‘Proj’,RT_RCDATA); LinesLoad := LoadResource(hInstance,LinesLoad); LinesStream:=TStringStream.create(StrPas(PChar( LinesLoad))); begin richedit1.Lines.LoadFromStream(LinesStream); begin LinesStream.free; FreeResource(LinesLoad); end; end; end; end;
Не количеством плюсов измеряется репутация человека.
Регистрация: 11.02.2014
Сообщений: 2

у меня с твоим кодом вопросики повылазили
и сделал вот так вот

procedure TBokus_UtilKad56_Glav_Form.LoadResRTF(Sender: TObject); var ResStream : TResourceStream; NameRTF : PWideChar; begin NameRTF:=pchar(Copy((Sender as TComponent).Name,3,100)); RE_Details.Clear; if FindResource(hInstance, NameRTF, ‘RTF’) <> 0 then begin ResStream:=TResourceStream.Create(hInstance, NameRTF, ‘RTF’); RE_Details.Lines.LoadFromStream(ResStream); ResStream.Free; end Else RE_Details.Text:=’Описание’; end;

Источник: www.programmersforum.ru

Topic: RichEdit line insertion error…  (Read 45344 times)

hi there mouser,

i just noticed that if i click on «About», an error message pops up.
it doesn’t hinder the functionality but just thought that you should know…
here’s the screenshot:

http://img129.imageshack.us/img129/7659/frerror9cm.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

best regards,
lanux

« Last Edit: September 27, 2005, 11:58 PM by lanux128 »


yipes!!
does anyone else see this?
this is quite bad actually and not at all ok, because the about box is how users enter license info, so this should never happen!!!
anyone else see this?


what operating system do you have?


what operating system do you have?

hi there mouser,

i’m using WinXP Pro on P4 1.8GHz with 256MB RAM… this is the 1st time i noticed this.

best regards,
lanux


hi there mouser,

just tried out the v1.07.18 beta, you are going so fast that i totally skipped v1.07.15 beta… ;-)
anyway, there are few pointers that i would like to share…

the above-mentioned error keeps popping up in the v1.07.18 beta, so i thought i’d just google it…
and this solution came the closest:

RichEdit line insertion error.

This error message is due to a size limitation with richedit components for some versions of Windows.
An exception error is raised when trying to insert text greater than 64KB.
It has to do with the version of riched32.dll that you’re using on your computer.

Source: http://www.philosophers.co.uk/quotations/bugs.htm

then i checked my version of Riched32.dll, which is 5.1.2600.0
so maybe there is some version conflicts…
http://img338.imageshack.us/img338/5821/riched32dll9hn.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

another thing is that while the «Auto-shrink window to fit results» is cool, i wish there was a way that it doesn’t save the windows’ size because i also use «Blank search shows files from launch history» which i’ve set to 9 entries (so i’d like to retain the windows’ height)…

okey, that’s it for now…

best regards,
lanux

P.S. to try out the skins thingy… :-)


i saw that on google too but i couldn’t figure out why it would be writing so much info as to show that error…
does it happen EVERY time you bring up about box? if not, do you have any clues when it does?
i really need to find this problem and fix it.  does it happen on all donationcoder.com programs about boxes?

ps.
can you explain a little more the issue with window sizing?


this richedit bug really needs to get fixed otherwise you (and anyone with same problem) willl have no way to enter license key..
or did you already enter a license key and maybe thats the cause of the issue?


lanux regarding the about box problem, could you try going to your find and run robot directory and moving the file DonationCoder_findrunrobot_Key.dat out of that directory and restarting F&R and then go to about box and see if you get the error?
maybe there is something in the license key that is upsetting the program..

and with regard to F&R window size — does autoshrink mode properly set the window size when showing results normally — and it’s only when you close and re-open that has those bad scrollbars?
and if you resize the window by just one pixel taller or wider does everything fit and scrollbars go away?

« Last Edit: October 04, 2005, 01:38 AM by mouser »


hi there mouser,

sorry, «real life» kept me back… ;-)
ok, to answer your questions…

lanux regarding the about box problem, could you try going to your find and run robot directory and moving the file DonationCoder_findrunrobot_Key.dat out of that directory and restarting F&R and then go to about box and see if you get the error?

-mouser

the error still recurs, as you can see from the screen-shot…

http://img247.imageshack.us/img247/4897/frerror25ul.png

RichEdit line insertion error…

Free Image Hosting by ImageShack

and with regard to F&R window size — does autoshrink mode properly set the window size when showing results normally — and it’s only when you close and re-open that has those bad scrollbars? and if you resize the window by just one pixel taller or wider does everything fit and scrollbars go away?

yes, only when i close & re-open does the scrollbars appear & yes, if i resize then the scrollbars disappear.

and can you try latest version and see if the window size problem is still there with this version

man, that was fast! but sorry mouser, the sizing problem is still persistent. anyway it’s okay, it’s a minor annoyance that i can live with… ;-)

best regards,
lanux


we don’t live with such problems — we fix them!
don’t worry we will get it fixed, as long as you are still willing to test fix attempts.

one of things i’ve learned is that for every 1 person who reports a bug, probably 100 others experience it and just get mad and uninstall, so i treat all bug reports as things that need to be fixed.

let me prepare another test version to try.


we don’t live with such problems — we fix them!
don’t worry we will get it fixed, as long as you are still willing to test fix attempts.

man, that’s the spirit!
anyway as they say, if you insist, i can’t resist. keep them test versions coming.. ;-)

best regards,
lanux


i’d like to fix the richedt line problem first.

see this interesting entry from clipmate faq:
http://www.thornsoft…hEditlineinserterror

can you try their test app here:
http://www.thornsoft…rt/richedittest1.zip

and see if it also causes an error for you?

actually you know i use a richedit control just because i thought i might allow some formatting text (bold,etc.) but since i don’t, i could just change to a control that doesnt use richedit at all and that would solve the problem.  maybe i’ll just do that…


im going to split off the window sizing stuff into a separate thread — let’s use this one just for the richedit issue.


and see if it also causes an error for you?

well, the test app works fine…

http://img238.imageshack.us/img238/2355/richedittestapp4au.png

RichEdit line insertion error…

actually you know i use a richedit control just because i thought i might allow some formatting text (bold,etc.) but since i don’t, i could just change to a control that doesnt use richedit at all and that would solve the problem.  maybe i’ll just do that…

that’s ok, since the formatting makes the about box look much nicer… but why no one else have this problem?
i made a search inside my system folder & found these files:

  • riched20.dll —> v5.40.11.2210
  • riched32.dll —> v5.1.2600.0
  • richtx32.ocx —> v6.1.97.82

i’m no expert but does these version numbers match with the one in your pc?

best regards,
lanux


well if that test works then its a different issue for sure.
let me try something else then.


can you try this version:
https://www.donation…/FindAndRunRobot.zip
and test window sizing and about box again?

probably both will still be there.

IMPORTANT NOTE:
this is not a setup program! it is a replacement .exe in a zip file, so you need to copy this over on top of your existing Find and Run Robot directory and restart F&R.

If you would prefer i make setup programs as usual let me know.


ps. your versions are more recent than mine, so i don’t think its a dll problem..
must be something that i’m doing that is reacting strangely in your case..

does the same problem occur in other donationcoder.com program about boxes?


you da man! ;-) :up: :up:
the about box is displayed & the sizing bug is also nowhere to be seen (yet)…

http://img250.imageshack.us/img250/9695/frok3ds.png

RichEdit line insertion error…

this is not a setup program! it is a replacement .exe in a zip file, so you need to copy this over on top of your existing Find and Run Robot directory and restart F&R.

If you would prefer i make setup programs as usual let me know.

btw, why not distribute all releases this way since it’ll make zip file smaller… just a thought…

best regards,
lanux


ok so i guess its just a bug with the richedit control, i used a different way of setting the text this time.
good to know the richedit error bug is killed!


good to know the richedit error bug is killed!

yup, we can break out the champagne on this one! ;-)
btw, if it’s not too technical, may i know what’s the different way of setting of the text.
just in case, if i ran into another program that has the same bug then i can notify the author…

best regards,
lanux


sure, that’s a great idea.  btw the solution here is relevant for C++ Builder and Delphi.  It may not be direclty relevant for other languages that use the RichEdit control.

the first thing to realize is that it is a bug in the RichEdit control.

normally to set the text in a RichEdit control you could do this:

InfoText->Lines->Text=message;

instead i changed it to this:

InfoText->Lines->Text=»»;
InfoText->SelStart=0;
InfoText->SelText=message;

i also went into the properties for the RichEdit and changed MaxLength from 0 to 16000,
which should not be necesary but i figured i might as well.

the ideas to try these things came from google groups posts describing that RichEdit has some bugs that are triggered when you try to set text the normal way and that you should try setting it using SelText kludge.  Seems to work!

Thanks for helping me find this lanux, it really is appreciated since this could be a really nasty surprise for anyone trying to enter a license key in one of our programs!


hi there mouser,

i found another instance of the RichEdit error… ;-)
this time the error propped up in this program, Icon Factory 1.1…

http://img223.imageshack.us/img223/6553/iconfacterror4wb.png

RichEdit line insertion error…

best regards,
lanux


did you pass on a pointer to this thread to them i hope?


yeah, i did but the author replied saying he’s not developing the software anymore…

best regards,
lanux


Понравилась статья? Поделить с друзьями:
  • Ricoh 161 ошибка sc322
  • Richtx32 ocx ошибка
  • Reptilicus ошибка при разборе ответа
  • Ricci варочная панель ошибка f3
  • Requiem for the indifferent ошибка