Solved

Console Application

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now