Page 1 of 1

autosave problems, using savehtmlex ...

Posted: Tue Dec 19, 2006 6:37 pm
by Stef
hi Sergey,

I automatically save an RVE every 100 seconds, using saveHTMLex. Now when typing very fast (during autosave) the programs hangs itself completely (100% cpu time and not responding).
I'm not sure the problem is caused by RVE, but if I remove the saveHTMLex, there's no problem.

To narrow the search for the cause, I would like to block the user keyboard input, is there a property or method to accomplish that ?

And in general, could there be a problem to be expected, while modifying the RVE during a saveHTMLex ?

I often find solutions, just after telling someone else about my problem ...
... so I just found out, that when I encapsulate the saveHTMLex in beginupdate/endupdate the problem seems to be solved.
Is that the correct way to solve the problem ??

thanks,

Posted: Thu Dec 21, 2006 2:23 pm
by Sergey Tkachenko
Do you use timer or thread?

Posted: Thu Dec 21, 2006 2:34 pm
by Stef
I use a timer (never used a thread)

Posted: Thu Jan 18, 2007 11:08 pm
by Stef
hello Sergey,

do you have already any thoughts about this issue ?

thanks,

Posted: Fri Jan 19, 2007 2:58 pm
by Sergey Tkachenko
Sorry, I do not know why it happened.
Timer calling SaveHTMLEx must not cause problems.
For blocking editing, you can assign ReadOnly := True
(probably, it is required to set ReadOnly for all inplace editors, if they are active)

Posted: Mon Jan 29, 2007 8:33 pm
by Stef
hi Sergey,
Although the occurrence is reduced significantly,
it's still not completeley vanished.
I ran the program in the Delphi IDE, and pressed PAUSE when the programs hangs. In first instance the program always stops in tGIFimage, probably busy with an animated image which is showed whenever a richview file is saved.
After removing the animated image, the program hangs always in RVThread.pas, in the while-loop shown below?
Do you have any idea what's causing tis behaviour ?
or suggestions how I can trace and / or prevent the effect ?

thanks,
Stef Mientki

procedure TRVWordEnumThread.Stop(ResetNexts: Boolean);
{$IFNDEF RICHVIEWDEF6}
var Msg: TMsg;
{$ENDIF}
begin
if (StopWorking=3) then
exit;
if ResetNexts then begin
NextRVData := nil;
NextItemNo := -1;
NextOffs := -1;
end;
if Suspended then
exit;
StopWorking := 1;
if not Delaying then begin
Priority := tpNormal;
while (StopWorking=1) and not Suspended do
{$IFDEF RICHVIEWDEF6}CheckSynchronize;{$ELSE}
if PeekMessage(Msg, 0, $8FFF, $8FFF, PM_REMOVE) then
DispatchMessage(Msg);
{$ENDIF};

Posted: Mon Jan 29, 2007 9:26 pm
by Stef
some more information: it has nothing todo with savehtmlex.

The program just hangs, when typing very fast.
It seem to happen more often, when you edit in the middle of a document,
compared to editing at the end of the document.
I'm using 1.9.6, and I didn't see any related problems solved in the newer releases (unless it's one of those "nameless major fixes" ;-)

cheers,

Posted: Tue Jan 30, 2007 2:14 pm
by Sergey Tkachenko
Please update to 1.9.24, very probably, this problem is solved

Posted: Tue Jan 30, 2007 6:48 pm
by Stef
thanks Sergey,

I updated to 1.9.24 ,....
... but the result is even worse :-(
The program hangs much faster,
sometimes at the point mentioned in my previous message,
sometimes at the point below.
I checked on 4 PC's, and at some PC's the problem can be generated faster then on other PC's. The PC's where it occures the fastest, are the fastest PC's, but these PC's have a small (32MB) video card on board.
Any more suggestions ?

thanks,
Stef Mientki


(Classes.pas)
function CheckSynchronize(Timeout: Integer = 0): Boolean;
var
SyncProc: PSyncProc;
LocalSyncList: TList;
begin
if GetCurrentThreadID <> MainThreadID then
raise EThread.CreateResFmt(@SCheckSynchronizeError, [GetCurrentThreadID]);
if Timeout > 0 then
WaitForSyncEvent(Timeout)
else

Posted: Wed Jan 31, 2007 8:05 am
by Sergey Tkachenko
Does it happen in the specific project, or in different projects?

Posted: Wed Jan 31, 2007 12:36 pm
by Stef
(un)fortunately ;-) I've worked for the past few years on just 1 (huge) application that uses RVE.
From about 10 users I know they have never seen this problem,
I now have one user (who is typing very fast) that reported the problem. From what we can remember, the problem occurred for the first time half a year ago, probably when I updated to 1.9.6, when I implemented spell checking, I Spell, (and a lot of other things not related to RVE).

Sergey, from your question, I assume that you until now never heard of this problem and don't have an idea if it's caused by RVE and where it's caused.
Because of the size of my program, I can also not garantee that it's caused by RVE, but as far as I can see, nothing special happens in my program (although deleting the animated image did influence the bahaviour).

Does it help if I try to make a small program, trying to get the same problem ?

cheers,

Posted: Thu Feb 01, 2007 2:05 pm
by Sergey Tkachenko
No, this problem was not reported.
I am afraid there is a conflict with some code in your application :(

Posted: Thu Feb 01, 2007 4:07 pm
by Stef
I am afraid there is a conflict with some code in your application :(
I guess that's true, but who's to blame ? ;-)

I'll see if can make a small application,
revealing the problem,
I'll let you know my findings.

thanks,
Stef

Posted: Thu Feb 01, 2007 6:45 pm
by Stef
FOUND IT ;-)

But no explanantion:

This hangs the process:

Code: Select all

procedure Tform_rve_edit.RVESpellingCheck(Sender: TCustomRichView;
  const AWord: String; StyleNo: Integer; var Misspelled: Boolean);
(*******************************************************************************
*******************************************************************************)
begin
  misspelled:=false;
  if SpellLanguageComboBox1.ItemIndex<=0) or
     not(Speller_available) then exit;
end;
this works fine (although I've no response from my fastest user ;-)

Code: Select all

procedure Tform_rve_edit.RVESpellingCheck(Sender: TCustomRichView;
  const AWord: String; StyleNo: Integer; var Misspelled: Boolean);
(*******************************************************************************
*******************************************************************************)
begin
  misspelled:=false;
  if (Spell_language<=0) or
     not(Speller_available) then exit;
end;
The combobox is a special one derived form customcombo-box,
but there's nothing special arounf "itemindex".

Any explanation ?

cheers,
Stef

Posted: Tue Feb 06, 2007 1:00 pm
by Sergey Tkachenko
Probably calling SpellLanguageComboBox1.ItemIndex performs some operations that must not be performed in thread