Solved

Console Application

Posted on 2003-11-06
5
251 Views
Last Modified: 2010-04-05
Hi,

How can I use a visual component in a console application?
If not possible, can I use a form then hide it? Or any other trick?

Thank you,
Sincersly,
Luis Martins
0
Comment
Question by:lfgmartins
5 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9694876
>can I use a visual component in a console
It depends on which components do you want to use.

>can I use a form then hide it?
Yes, you can.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 500 total points
ID: 9694914
you can't drop it on a form but you can cerate it like

//Tdatabase here just as sample, the unit of the vcl you need, you must include into the uses-clause
...
   myDB := TDatabase.Create(Application);
   with myDB do
   begin
      //some property adjaustments
   end;
...

btw. control-vcls are a bit usesless in a console-app,
and of course you can also code a hidden win-app using a form
(key would here to add the line
application.showmainform := false;
in the project-source)

meikl ;-)
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9695370
well you can also create vcl cmp's as nil...

as i remember shold be:

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils, StdCtrls;
var
b: TButton;
begin
  b := Tbutton.Create(nil);
  b.Name := 'Button';
  b.Caption := 'This is a nil button';
  Writeln(b.Caption);
  Sleep(3000);
  b.Free;
end.

F68 ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9695768
>well you can also create vcl cmp's as nil...
oh yes, f68, it is a must i guess (because application is per default not available)
0
 
LVL 33

Expert Comment

by:Slick812
ID: 9696388
hello lfgmartins, you can't do "Visual" controls on a console, maybe if you give more information about what "Visual" control or effect you are trying to do, we could help you more,, ,  or consider swithing to a GUI application
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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