Solved

App without a form

Posted on 2000-05-02
7
176 Views
Last Modified: 2010-04-04
How can I have application without a form? Ive tried coding the form to ShowWindow(Application.Handle, SW_HIDE) but I would prefer it to not have a form at all. Also can I still include components with my app as I would not be able to drop the component on the form? Thanks for any help.
Regards
Smurff
0
Comment
Question by:smurff
[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
7 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2769382
Just the all the forms from the project, and do all the work in the Project source (the .DPR file).

You can still instatiate objects and component, but keep in mind that now you have to do it manually... and remember to free them.

Alex
0
 
LVL 3

Expert Comment

by:raidos
ID: 2769388
Sure you can have an application without forms.

But then you will have to init every Component yourself.

If you can live with the fast that there are forms in the Exe just put this line in the projects source.

Application.ShowMainform := False;


Good Luck

//raidos
0
 

Expert Comment

by:cheka021100
ID: 2769400
Hi,
Just try create the components
in run-time.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:smurff
ID: 2769434
cheers, can anyone give an example of a program with just the dpr and how would I initiate the components in runtime?
Thanks again
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2769725
0
 
LVL 1

Accepted Solution

by:
zwarte earned 25 total points
ID: 2769749
exemple1 shows you a dpr file that displays a simple message when compiled and this requires no other code.

exemple 2 shows a dpr file, using a blanc form (unit1) to which it adds a label (I know you don't want a form, but I just wanted to demonstrate that you could create a form and a label at run-time, you can of course also do this for non-visual components, and then you won't need a form to display them, which I now did :-)


exemple1

program Project1;

uses
  Forms,dialogs;

{$R *.RES}

begin
  Application.Initialize;
  showmessage('This is a sample program');
  Application.Run;
end.


exemple2 :


program Project1;

uses
  Forms,dialogs,stdctrls,
  unit1 in 'unit1.pas' {form1};

{$R *.RES}
var
   form1 : tform1;
   label1 : tlabel;
begin
  Application.Initialize;
  showmessage('This is a sample program');
  form1 := tform1.create(application);
  label1 := tlabel.create(form1);
  label1.top := 10;
  label1.left := 10;
  label1.parent := form1;
  label1.caption := 'hello there';
  form1.show;
  showmessage('there you go');
  label1.free;
  form1.free;
  Application.Run;
end.

Tom,
0
 
LVL 3

Author Comment

by:smurff
ID: 2769869
Raidos: your answer with the showmainform was top thanks, but zwart explained alot. Thanks, once again Ive been helped out within a day. Cheers all!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 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