Solved

Console Application

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month4 days, 22 hours left to enroll

636 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