Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using VCL objects in console applications

461 views
Skip to first unread message

Frank Darbyshire

unread,
Mar 27, 2002, 3:42:17 AM3/27/02
to

Hi Can any one help me?

I need to write a small console application to process some data in the back ground. This will be called by NT scheduler.
I would like to use data base components (non visual e.g. TTable) I think I should be able to use them but I do not know how to instantiate them in Delphi 5 in a Console app.

Thanks in advance for any replies.

Frank


Finn Tolderlund

unread,
Mar 27, 2002, 4:48:38 AM3/27/02
to

"Frank Darbyshire" <frank.d...@kvaerner.com> wrote in message
news:3ca185e9_1@dnews...

> I need to write a small console application to process some data in the
back ground. This will be called by NT scheduler.
> I would like to use data base components (non visual e.g. TTable) I think
I should be able to use them but I do not know how to
> instantiate them in Delphi 5 in a Console app.

Have you tried
Table := TTable.Create(nil);

Finn Tolderlund


Nick Ryan

unread,
Mar 27, 2002, 7:06:09 AM3/27/02
to
> I need to write a small console application to process some data in the
back ground. This will be called by NT scheduler.
> I would like to use data base components (non visual e.g. TTable) I think
I should be able to use them but I do not know how to instantiate them in
Delphi 5 in a Console app.

Put the table components in a datamodule. In your code make sure that you
manually create the datamodule (ie MyDataModule := TMyDateModule.Create...)
and also destroy it once you're finished with it.

ie.

program Foo;
...
use dmMyDataModule;
...
begin
try
MyDataModule := TMyDateModule.Create( NIL );
<do stuff with the datamodule / components on it>
finally
FreeAndNIL( MyDataModule );
end; {try}
end.

Nick


0 new messages