New Thread Object

From RAD Studio
Jump to: navigation, search

Go Up to File Menu


File > New > Other > C++Builder > Individual Files > Thread Object

File > New > Other > Delphi > Individual Files > Thread Object

Use this dialog box to define a thread class that encapsulates a single execution thread in a multi-threaded application.

Item Description

Class Name

Type the full class name that you want to define. This dialog box does not prepend a T to the supplied class name; type the full class name, such as TMyThread, rather than typing MyThread.

Named Thread

If you want to name the thread, check Named Thread and then type a name in the Thread Name field.

Naming the thread adds a method to your thread class called NameThreadForDebugging. When the thread starts running, it calls the NameThreadForDebugging method first.

Naming the thread can make it easier to identify a particular thread in the debugger's Thread Status window.

Thread Name

Type the thread name you want to use.

Tip: Clicking OK creates a new unit that defines a thread class with the name(s) supplied in the dialog. You must then supply the code that executes when the thread is run by writing the Execute method in the new unit.

See Also