Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Console Application

Posted on 2003-11-06
5
Medium Priority
?
259 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
[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
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 1500 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 23

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

721 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