View Issue Details

IDProjectCategoryView StatusLast Update
0005094JEDI VCL00 JVCL Componentspublic2011-06-10 16:10
ReportermigajekAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.40 
Summary0005094: JvDocking - ManualTabDock crashes if application's Main Form is uninitialized yet.
DescriptionManualTabDock functions does it:

  if DockClient1.DockState = JvDockState_Docking then
  begin
    ScreenPos := Application.MainForm.ClientRect // Just making it float
    Form1.ManualFloat(ScreenPos);
  end;

which obviously fails in case MainForm is not initialized yet (like in mine case).
Thus it should be replaced with following workaround (I'm not sure if it is correct as I don't get the idea of ManualFloating it, thus I created some random rect)

  if DockClient1.DockState = JvDockState_Docking then
  begin
    if Application.MainForm <> nil then
      ScreenPos := Application.MainForm.ClientRect // Just making it float temporarily.
    else
      ScreenPos := Rect(10, 10, 250, 250);
    Form1.ManualFloat(ScreenPos);
  end;

anyway it doesn't cause Access Violation anymore.

migajek
Additional Information  if DockClient1.DockState = JvDockState_Docking then
  begin
    if Application.MainForm <> nil then
      ScreenPos := Application.MainForm.ClientRect // Just making it float temporarily.
    else
      ScreenPos := Rect(10, 10, 250, 250); //it doesn't make sense probably
    Form1.ManualFloat(ScreenPos);
  end;
TagsNo tags attached.

Activities

obones

2010-01-13 16:59

administrator   ~0017110

Please provide the zipped sources of a sample application showing this

2010-01-13 20:46

 

jvcl_docking.zip (3,030 bytes)

migajek

2010-01-13 20:46

reporter   ~0017117

I'm including the source you've asked for, but actually it could be any code that calls ManualTabDock from application's main form OnCreate... It seems that during main form OnCreate execution, Application.MainForm is still nil.

This is true for Delphi 7, I'm not able to test it on any recent version ...

AHUser

2010-06-07 17:53

developer   ~0017469

Warren Postma has rewritten the ManualTabDock() method and it doesn't use the Application.MainForm property anymore. With this new code I can't reproduce the bug anymore.

Issue History

Date Modified Username Field Change
2010-01-06 15:57 migajek New Issue
2010-01-13 16:59 obones Note Added: 0017110
2010-01-13 16:59 obones Status new => feedback
2010-01-13 20:46 migajek File Added: jvcl_docking.zip
2010-01-13 20:46 migajek Note Added: 0017117
2010-06-07 13:53 obones Status feedback => acknowledged
2010-06-07 17:53 AHUser Note Added: 0017469
2010-06-07 17:53 AHUser Status acknowledged => resolved
2010-06-07 17:53 AHUser Fixed in Version => Daily / SVN
2010-06-07 17:53 AHUser Resolution open => fixed
2010-06-07 17:53 AHUser Assigned To => AHUser
2011-06-10 16:10 obones Fixed in Version Daily / SVN => 3.40