Forum > General

[SOLVED] Components with console applications

(1/5) > >>

Is there any way to use components with a console application the same way they are used with visual ones?  It would be nice to drop non-visual components on a container, and interact with them visually.  Or do I have to do everything programmatically?

I suppose I could have a visual form that I instantiate but never actually display, but I need to ensure I do this in a way that the resulting app has no gui library dependencies on Linux (it may run on small console-only installations).

Use a DataModule instead of a form for the non-visual components.
Then set the widgetset of your LCL app to NoGUI.
For example LazBuild is a NoGUI app because it depends on LCL through so many units.

Perfect!  It's actually too perfect in that it introduces an issue with waiting, but It's a separate issue so I'll post about it in a new thread.

Back to unsolved.  I can't get this to work.  I set up the DataModule and its components, but ttimer events aren't firing, some Indy stuff works because it's multi-threading and has its own timings, but a lot doesn't.

It seems there is no message processing loop and I can't for the life of me figure out how to do one.  A console app with no widget set appears to have no message processing loop.  A console app derrives directly from TCustomApplication, so doesn't have TApplication.ProcessMessages.

Is what I want to do possible?

To have a window message loop you need ...... a window .... tadaaadaaa  O:-)


[0] Message Index

[#] Next page

Go to full version