Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005094 [JEDI VCL] 00 JVCL Components major always 2010-01-06 15:57 2011-06-10 16:10
Reporter migajek View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005094: JvDocking - ManualTabDock crashes if application's Main Form is uninitialized yet.
Description ManualTabDock 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;
Tags No tags attached.
Attached Files zip file icon jvcl_docking.zip [^] (3,030 bytes) 2010-01-13 20:46

- Relationships

-  Notes
(0017110)
obones (administrator)
2010-01-13 16:59

Please provide the zipped sources of a sample application showing this
(0017117)
migajek (reporter)
2010-01-13 20:46

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 ...
(0017469)
AHUser (developer)
2010-06-07 17:53

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker