Threads an Forms ...

I'm writing a c++ builder3 app in which i need to create a form (window) within the context of the thread such that the thread owns the message que.
p.s: i would prefere to use the thread class provided with cbuilder but alternatives are welcome
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BitHawkAuthor Commented:
Adjusted points to 150
Load the form from the thread's code . For example , if your thread starts with function Funcx() , load the form within this function . Then do a standard message loop , like the same you do in the main function of your program , for example

MSG mx;
while (GetMessage(&mx,0,0,0))

BitHawkAuthor Commented:
WxW, that might not work because class TForm's 3 contructors require
1. a TComponent object
2. a TComponent object and an int
3. the WHND handle of the parent window

but a thread derived from TThread has TObject as its only ancestor.

Could you think of another way ?

thanx, BitHawk
Why , can't they be standalone windows ? Can't you pass NULL for a Parent Window Handle ?

In that case , your only solution will be creating the form yourself ( registering the class and doing the message box ) . As an alternative , make your form a dialog box , thats easier to process using a message loop .

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BitHawkAuthor Commented:
Wxw, I think your NULL sugestion should work, let me try it out, if it works, ill give you the points.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.