开发者

C++ Builder - Spawn TThreads On the Fly

开发者 https://www.devze.com 2022-12-14 01:27 出处:网络
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.

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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消