Solved

Console Application

Posted on 2003-11-06
5
252 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 34

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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