View Issue Details

IDProjectCategoryView StatusLast Update
0004278JEDI VCL00 JVCL Componentspublic2008-07-21 00:12
ReporterZENsanAssigned Toobones 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.34 
Summary0004278: TJvAppEvents exception and total crash when using OnActiveControlChange
DescriptionJvAppEvents calls OnActiveControlChange also after JvAppEvents.Chained = False!!! Whis produce unhandled situations and problems.
Source project attached.
Additional InformationThat was difficult to catch out where is the problem in my project. Because I had verry difficult structure and interfaces/threads and thread safe version of JvDebugHandler.. So at the end I found where is the problem!
TagsNo tags attached.

Activities

2007-10-27 04:11

 

JvAppEvents.7z (14,094 bytes)

ZENsan

2007-10-27 04:16

reporter   ~0014000

I understand that onActiveControlChange notification goes from Screen object, but I think that it is not correct to call OnChangeActiveControl in DoActiveControlChange JvAppEvent.pas[539] there must be a check for "Chained"!
And this also belongs to all other events such as OnActiveFormChange which also comes from Screen object.

ZENsan

2007-10-27 04:25

reporter   ~0014001

var
  I: Integer;
begin
  for I := FAppEvents.Count - 1 downto 0 do
  begin
    TJvAppEvents(FAppEvents[I]).FCancelDispatch := False;
    if Assigned(TJvAppEvents(FAppEvents[I]).FOnActiveControlChange) then
      TJvAppEvents(FAppEvents[I]).FOnActiveControlChange(Sender);
    if not TJvAppEvents(FAppEvents[I]).Chained or
     TJvAppEvents(FAppEvents[I]).FCancelDispatch then
      Exit;
  end;
  if Assigned(FOnActiveControlChange) then
    FOnActiveControlChange(Sender);

Maybe that line "if not TJvAppEvents(FAppEvents[I]).Chained TJvAppEvents(FAppEvents[I]).FCancelDispatch then Exit;" must be before previous lines?
And if we replace Original events of objects Application and Screen why
Originals must not be called when your AppEvents object is not chained: ?

  if Assigned(FOnActiveControlChange) then
    FOnActiveControlChange(Sender);

if that Exit; works then this will not be called, but your Appevents.OnActiveControlChange(..) - will be called. It must be opposite I think..

obones

2008-02-20 06:55

administrator   ~0014173

Can you explain to me in more details using simple terms what the problem is? I'm having a hard time understanding it.

ZENsan

2008-07-18 02:16

reporter   ~0014398

I see that now it is resolved. So we can close this issue.

Issue History

Date Modified Username Field Change
2007-10-27 04:11 ZENsan New Issue
2007-10-27 04:11 ZENsan File Added: JvAppEvents.7z
2007-10-27 04:16 ZENsan Note Added: 0014000
2007-10-27 04:25 ZENsan Note Added: 0014001
2008-02-20 06:55 obones Note Added: 0014173
2008-02-20 06:55 obones Status new => feedback
2008-07-18 02:16 ZENsan Note Added: 0014398
2008-07-21 00:12 obones Status feedback => resolved
2008-07-21 00:12 obones Fixed in Version => Daily / SVN
2008-07-21 00:12 obones Resolution open => fixed
2008-07-21 00:12 obones Assigned To => obones