Solved

IDE's first form opened

Posted on 2004-04-15
4
170 Views
Last Modified: 2010-04-05
My application has a Data module that has a TADOConnection control which the other forms use to access an Access database.

At design time when I try to open any form that has controls that referance this Modual when this modual is not open before-hand, Delphi (6) bombs out and closes itself.

Till now I have lived with this but now my 'Projects/Options/Main Form' needs to referance this Modual.

Iv noticed that the IDE automatically loads the Main Form when a project is opened. You can imagin the problem this causes. Now whenever I attempt to open such a project, Delphi automatically bombs out!

What do I do?

Is it possible to make the IDE to load up the Modual first before any other form?

How do you make the IDE load a form/modual, other than the Main Form, first when a project is opened?
0
Comment
Question by:ziche
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 10839859
Hi
You've got two possibilities.
1. In Project/Options/Auto create Forms drag Your data module to the first place.
2. Change order in dpr file
0
 

Author Comment

by:ziche
ID: 10842778
1. The module is already at the top, this doesnt help.
2. How do I do this exactly?
0
 
LVL 17

Expert Comment

by:mokule
ID: 10842926
Hi
Ad 2.
Just Cut Line and copy earlier or later. But it is equivalent to method 1. The only difference is that You can do it without opening project..

What You've got in Your project's *dsk.
Try to change section [Modules]
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 40 total points
ID: 10846484
ziche,

Initially, in your project source, you will have something like this....

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {DataModule2: TDataModule};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TDataModule2, DataModule2);
  Application.Run;
end.

Switch it around so that the DataModule is created first....

 Application.Initialize;
 Application.CreateForm(TDataModule2, DataModule2);
 Application.CreateForm(TForm1, Form1);
 Application.Run;


Hope this helps!

SHane
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question