Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

tjcusick (Programmer) (OP)
21 Nov 07 11:22
Using Delphi 7.

We created a Date Picker Frame so that we could just drop it onto our forms.  The problem that is happening is that once the Date Picker Frame is placed correctly and then the form is saved, you can no longer open the Form in design mode.

We get a Message:
Error Reading Form
List index out of bounds(2).  Ignore the error and continue?

Ignoring the error and we get:
Error
Error creating form: Access violation at address 4002EBE8 in module 'rtl70.bpl'.  Read of address 0000000C.

Suggestions?

Thanks for the help in advance.

Tom Cusick
harebrain (MIS)
21 Nov 07 18:39
>We created a Date Picker Frame

You mean you created a component, a custom control?

Sounds like it's buggy.  Post code.
tjcusick (Programmer) (OP)
3 Dec 07 14:25
I've attached the pas file because it's over 1000 lines long and didnt want to put it all in here...  I just added the PAS file...  if you want the form too just let me know
roo0047 (Programmer)
4 Dec 07 8:26
Well since it really is a frame, there are some requirements to getting frames to behave on a form.  I use frames quite a bit and always load them at run-time.

My frames are in separate units like yours and are defined in the public section of my main form.

CODE

type
  TMainForm = class(TForm)
    ActionList1: TActionList;    //actions:
    ..
    PageControl: TPageControl;   //tabs:
    TabSheetDept: TTabSheet;
    TabSheetPrGrp: TTabSheet;
    ..
   public
    { Public declarations }
    DeptFrame: TDeptFrame;       //frames:
    PrGrpFrame: TPrGrpFrame;
    ..

My primary frames are created in the OnCreate() of my main form, which loads the frames into TTabSheet(s) of a TPageControl.

CODE

  DeptFrame:= TDeptFrame.Create(Self);
  DeptFrame.Parent:= TabSheetDept;
  DeptFrame.Align:= alClient;

  PrGrpFrame:= TPrGrpFrame.Create(Self);
  PrGrpFrame.Parent:= TabSheetPrGrp;
  PrGrpFrame.Align:= alClient;
And of course Freed in my OnDestroy.  This particular app has over a dozen frames.  The rest are created and loaded only when the parent tab is selected, then freed when another tab is selected.

Although you posted your frame unit code, you haven't shown how it is called.  I suspect that may be where your problem is.  You may simply have to define the frame's parent and alignment as shown.

Roo
Delphi Rules!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close