views:

250

answers:

1

I'm looking for the ability to spawn a thread or function so that it returns immediately to the calling line and continue on with the program but continues with the thread work.

For instance, if you call Form.ShowDialog(), it will create a modeless form that has its own UI thread.

Is there a way to do this (no form) without having to declare a TThread class? I guess sort of like an anonymous thread, if that even exists.

+1  A: 

I don't know exactly why you don't want to create a TThread subclass, but if you are using the Windows version of C++ Builder you can use the _beginthreadex function (declared in process.h).

hjhill
Thanks for the info - I also found a SO question here that discusses _beginthreadex more in detail: http://stackoverflow.com/questions/331536/windows-threading-beginthread-vs-beginthreadex-vs-createthread-c
0A0D