2

i started creating application only using dpr file in delphi 2009 , i think all basic things work i use system ,sysutils and more.... but now i want to use timer and some other non-visual components (some basic indy components to use internet) is there any ways to do this i do not bother using units (but not forms)

1
  • can we also use any non visual componets like this Commented Nov 1, 2010 at 4:23

2 Answers 2

4

You can put non-visual components on a Data Module.

I use that a lot because you still have the design-time benefits (properties and events in the object inspector, logical placement in your designer).

--jeroen

Sign up to request clarification or add additional context in comments.

Comments

1

You can create any component by calling its constructor and passing nil as the owner. You won't need a parent form if you manage it yourself. But for some things, you will still need a project that uses forms, even if you're not placing your component on one. For TTimer, for example, you have to be running a VCL Forms app because it depends on Application and its message loop to make the timer work.

1 Comment

You do not need a VCL Forms app in order to use TTimer. As long as there is a message loop that receives and dispatches WM_TIMER messages for the thread context that TTimer runs in, it will work fine. You can call the Win32 API Get/PeekMessage() and DispatchMessage() functions directly for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.